Compare commits

...

2 commits

Author SHA1 Message Date
Stephen Finucane a2a4117890
Merge 9cfdd9ccc0 into 54a8f0ce21 2024-03-27 23:01:36 +01:00
Stephen Finucane 9cfdd9ccc0 Use short token for code highlighting
Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #5349
2023-10-26 12:25:14 +01:00
2 changed files with 3 additions and 3 deletions

View file

@ -42,7 +42,7 @@ tool on your machine to be able to use these formats.
Hugo passes reasonable default arguments to these external helpers by default:
- `asciidoctor`: `--no-header-footer -`
- `rst2html`: `--leave-comments --initial-header-level=2`
- `rst2html`: `--leave-comments --initial-header-level=2 --syntax-highlight=short`
- `pandoc`: `--mathjax`
{{% note %}}

View file

@ -81,10 +81,10 @@ func (c *rstConverter) getRstContent(src []byte, ctx converter.DocumentContext)
// handle Windows manually because it doesn't do shebangs
if runtime.GOOS == "windows" {
pythonBinary, _ := internal.GetPythonBinaryAndExecPath()
args := []string{binaryPath, "--leave-comments", "--initial-header-level=2"}
args := []string{binaryPath, "--leave-comments", "--initial-header-level=2", "--syntax-highlight=short"}
result, err = internal.ExternallyRenderContent(c.cfg, ctx, src, pythonBinary, args)
} else {
args := []string{"--leave-comments", "--initial-header-level=2"}
args := []string{"--leave-comments", "--initial-header-level=2", "--syntax-highlight=short"}
result, err = internal.ExternallyRenderContent(c.cfg, ctx, src, binaryName, args)
}