From 9cfdd9ccc07d482f67fb65cdd1e9bbf12a995a77 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 24 Oct 2018 14:13:23 +0100 Subject: [PATCH] Use short token for code highlighting Signed-off-by: Stephen Finucane Closes: #5349 --- docs/content/en/content-management/formats.md | 2 +- markup/rst/convert.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/content/en/content-management/formats.md b/docs/content/en/content-management/formats.md index ccc45b943..9aff0eb76 100644 --- a/docs/content/en/content-management/formats.md +++ b/docs/content/en/content-management/formats.md @@ -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 %}} diff --git a/markup/rst/convert.go b/markup/rst/convert.go index b7aa5a2ce..eae87fd48 100644 --- a/markup/rst/convert.go +++ b/markup/rst/convert.go @@ -82,10 +82,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) }