Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/pauby/chroma-powershellconsole-css

PowerShell Console CSS for the Chroma Syntax Highlighter (as used by Hugo)
https://github.com/pauby/chroma-powershellconsole-css

chroma css hugo powershell

Last synced: 28 days ago
JSON representation

PowerShell Console CSS for the Chroma Syntax Highlighter (as used by Hugo)

Awesome Lists containing this project

README

        

# chroma-powershellconsole-css

PowerShell Console CSS for the Chroma Syntax Highlighter (as used by [Hugo](https://gohugo.io))

This is a stylesheet you can use with [Chroma](https://github.com/alecthomas/chroma) to create code sections in the style of the PowerShell default console window.

To use (for Hugo):

1. Set `pygmentsUseClassic` to `false` (or remove it entirely as Hugo defaults to Chroma);
2. Set `pygmentsUseClasses` to `true` (this allows the CSS stylesheet to work);
3. Put the `chroma-powershellconsole.css` stylesheet into `static\css` in your Hugo site;
4. Add loading the `css\chroma-powershellconsole.css` into the of your page (using for example `
{{< highlight powershell "hl_lines=3-5" .}}
PS> Some code

Some error text
that spills onto multiple
lines
{{< / highlight }}

// Your post markdown
```

Make sure you have the

tag before the code block. Then highlight those lines you want to appear as error messages using the [hl_lines option in Hugo](https://gohugo.io/content-management/syntax-highlighting/#configure-syntax-hightlighter). Don't forget to close the
tag.

What this does it restyle the highlighted code to appear as error styled text. However for each code block you can't have highlighted text and error styled text. You get one or the other.

You could used a shortcode for this in Hugo if you wanted. This is just the CSS. How you implement it is entirely up to you!