Skip to content

Commit

Permalink
Use short token for code highlighting
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Finucane <[email protected]>
Closes: #5349
  • Loading branch information
stephenfin committed May 18, 2020
1 parent 3cc4152 commit 37685f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/content/en/content-management/formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Hugo passes reasonable default arguments to these external helpers by default:

- `asciidoc`: `--no-header-footer --safe -`
- `asciidoctor`: `--no-header-footer --safe --trace -`
- `rst2html`: `--leave-comments --initial-header-level=2`
- `rst2html`: `--leave-comments --initial-header-level=2 --syntax-highlight=short`
- `pandoc`: `--mathjax`

{{% warning "Performance of External Helpers" %}}
Expand Down
4 changes: 2 additions & 2 deletions markup/rst/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ func (c *rstConverter) getRstContent(src []byte, ctx converter.DocumentContext)
// handle Windows manually because it doesn't do shebangs
if runtime.GOOS == "windows" {
python := internal.GetPythonExecPath()
args := []string{path, "--leave-comments", "--initial-header-level=2"}
args := []string{path, "--leave-comments", "--initial-header-level=2", "--syntax-highlight=short"}
result = internal.ExternallyRenderContent(c.cfg, ctx, src, python, args)
} else {
args := []string{"--leave-comments", "--initial-header-level=2"}
args := []string{"--leave-comments", "--initial-header-level=2", "--syntax-highlight=short"}
result = internal.ExternallyRenderContent(c.cfg, ctx, src, path, args)
}
// TODO(bep) check if rst2html has a body only option.
Expand Down

0 comments on commit 37685f7

Please sign in to comment.