Update Chroma highlighting docs

To the upcoming Hugo v0.30.
This commit is contained in:
Bjørn Erik Pedersen 2017-10-14 13:56:59 +02:00
parent 6adead19d6
commit ce10cc02e3
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
5 changed files with 11709 additions and 9 deletions

View File

@ -22,21 +22,21 @@ If you want to continue to use Pygments (see below), set `pygmentsUseClassic=tru
The example below shows a simple code snippet from the Hugo source highlighted with the `highlight` shortcode. Note that the gohugo.io site is generated with `pygmentsUseClasses=true` (see [Generate Syntax Highlighter CSS](#generate-syntax-highlighter-css)).
* `linenos=inline` turns on line numbers. Note that the `inline` value only has an effect in Pygments.
* `linenos=inline` or `linenos=table` (`table` will give copy-and-paste friendly code blocks) turns on line numbers.
* `hl_lines` lists a set of line numbers or line number ranges to be highlighted. Note that the hyphen range syntax is only supported for Chroma.
* `linenostart=199` starts the line number count from 199.
With that, this:
```
{{</* highlight go "linenos=inline,hl_lines=8 15-17,linenostart=199" */>}}
{{</* highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" */>}}
// ... code
{{</* / highlight */>}}
```
Gives this:
{{< highlight go "linenos=inline,hl_lines=8 15-17,linenostart=199" >}}
{{< highlight go "linenos=table,hl_lines=8 15-17,linenostart=199" >}}
// GetTitleFunc returns a func that can be used to transform a string to
// title case.
//

View File

@ -1,6 +1,9 @@
/* Background */ .chroma { background-color: #f0f0f0 }
/* Error */ .chroma .err { }
/* LineTableTD */ .chroma .lntd { ; vertical-align: top; padding: 0; margin: 0; border: 0; }
/* LineTable */ .chroma .lntable { ; border-spacing: 0; padding: 0; margin: 0; border: 0; width: 100%; overflow: auto; display: block; }
/* LineHighlight */ .chroma .hl { background-color: #ffffcc; display: block; width: 100% }
/* LineNumbersTable */ .chroma .lnt { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; display: block; }
/* LineNumbers */ .chroma .ln { ; margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
/* Keyword */ .chroma .k { color: #007020; font-weight: bold }
/* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold }

View File

@ -1,3 +1,14 @@
.chroma .lntable pre {
padding: 0;
margin: 0;
border: 0;
}
.chroma .lntable pre code {
padding: 0;
margin: 0;
}
pre, .pre {
overflow-x: auto;
overflow-y: hidden;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long