From 5600bcd131c605aa55f5440bb51590c6cc49a379 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 26 Oct 2021 21:44:43 +0800 Subject: [PATCH] Add pandoc doc --- docs/content/en/content-management/formats.md | 8 +++++++- docs/data/docs.json | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/content/en/content-management/formats.md b/docs/content/en/content-management/formats.md index 5654be7f0f0..f47a657d9fd 100644 --- a/docs/content/en/content-management/formats.md +++ b/docs/content/en/content-management/formats.md @@ -51,7 +51,7 @@ Hugo passes reasonable default arguments to these external helpers by default: - `asciidoctor`: `--no-header-footer -` - `rst2html`: `--leave-comments --initial-header-level=2` -- `pandoc`: `--mathjax` +- `pandoc`: `--mathjax --toc -s --quiet` {{% warning "Performance of External Helpers" %}} Because additional formats are external commands, generation performance will rely heavily on the performance of the external tool you are using. As this feature is still in its infancy, feedback is welcome. @@ -120,6 +120,12 @@ parameters. Run Hugo with `-v`. You will get an output like INFO 2019/12/22 09:08:48 Rendering book-as-pdf.adoc with C:\Ruby26-x64\bin\asciidoctor.bat using asciidoc args [--no-header-footer -r asciidoctor-html5s -b html5s -r asciidoctor-diagram --base-dir D:\prototypes\hugo_asciidoc_ddd\docs -a outdir=D:\prototypes\hugo_asciidoc_ddd\build -] ... ``` +### External Helper pandoc +preserveTOC +: By default, Hugo removes the table of contents generated by pandoc and provides it through the built-in variable [`.TableOfContents`](/content-management/toc/) to enable further customization and better integration with the various Hugo themes. This option can be set to `true` to preserve pandoc's TOC in the generated page. + +{{< code-toggle config="markup.pandoc" />}} + ## Learn Markdown Markdown syntax is simple enough to learn in a single sitting. The following are excellent resources to get you up and running: diff --git a/docs/data/docs.json b/docs/data/docs.json index 3a0bfe59b16..75c5b82eeba 100644 --- a/docs/data/docs.json +++ b/docs/data/docs.json @@ -1668,6 +1668,9 @@ "failureLevel": "fatal", "workingFolderCurrent": false, "preserveTOC": false + }, + "pandoc": { + "preserveTOC": false } }, "mergeStrategy": {