diff --git a/docs/content/en/content-management/formats.md b/docs/content/en/content-management/formats.md index 576ce2fa330..3343fd41122 100644 --- a/docs/content/en/content-management/formats.md +++ b/docs/content/en/content-management/formats.md @@ -50,7 +50,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 --math-output=MathJax` - `pandoc`: `--mathjax` {{% warning "Performance of External Helpers" %}} diff --git a/markup/rst/convert.go b/markup/rst/convert.go index cbc15c81a47..bf01b09500d 100644 --- a/markup/rst/convert.go +++ b/markup/rst/convert.go @@ -72,10 +72,14 @@ 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", + "--math-output", "MathJax https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js"} 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", + "--math-output", "MathJax https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js"} result = internal.ExternallyRenderContent(c.cfg, ctx, src, path, args) } // TODO(bep) check if rst2html has a body only option.