diff options
Diffstat (limited to 'docs/content/en/content-management/formats.md')
-rw-r--r-- | docs/content/en/content-management/formats.md | 50 |
1 files changed, 3 insertions, 47 deletions
diff --git a/docs/content/en/content-management/formats.md b/docs/content/en/content-management/formats.md index f85c304cf..ccc45b943 100644 --- a/docs/content/en/content-management/formats.md +++ b/docs/content/en/content-management/formats.md @@ -49,7 +49,7 @@ Hugo passes reasonable default arguments to these external helpers by default: 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. {{% /note %}} -### External helper Asciidoctor +### Asciidoctor The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo. [See the Asciidoctor docs for installation instructions](https://asciidoctor.org/docs/install-toolchain/). Make sure that also all @@ -59,52 +59,9 @@ optional extensions like `asciidoctor-diagram` or `asciidoctor-html5s` are insta External `asciidoctor` command requires Hugo rendering to _disk_ to a specific destination directory. It is required to run Hugo with the command option `--destination`. {{% /note %}} -Some [Asciidoctor](https://asciidoctor.org/man/asciidoctor/) parameters can be customized in Hugo: +Some Asciidoctor parameters can be customized in Hugo. See [details]. -Parameter | Comment ---- | --- -backend | Don't change this unless you know what you are doing. -doctype | Currently, the only document type supported in Hugo is `article`. -extensions | Possible extensions are `asciidoctor-html5s`, `asciidoctor-bibtex`, `asciidoctor-diagram`, `asciidoctor-interdoc-reftext`, `asciidoctor-katex`, `asciidoctor-latex`, `asciidoctor-mathematical`, `asciidoctor-question`. -attributes | Variables to be referenced in your AsciiDoc file. This is a list of variable name/value maps. See [Asciidoctor's attributes](https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#attributes-and-substitutions). -noHeaderOrFooter | Output an embeddable document, which excludes the header, the footer, and everything outside the body of the document. Don't change this unless you know what you are doing. -safeMode | Safe mode level `unsafe`, `safe`, `server` or `secure`. Don't change this unless you know what you are doing. -sectionNumbers | Auto-number section titles. -verbose | Verbosely print processing information and configuration file checks to stderr. -trace | Include backtrace information on errors. -failureLevel | The minimum logging level that triggers a non-zero exit code (failure). - -Hugo provides additional settings that don't map directly to Asciidoctor's CLI options: - -workingFolderCurrent -: Sets the working directory to be the same as that of the AsciiDoc file being processed, so that [include](https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/#include-files) will work with relative paths. This setting uses the `asciidoctor` cli parameter `--base-dir` and attribute `outdir=`. For rendering diagrams with [asciidoctor-diagram](https://asciidoctor.org/docs/asciidoctor-diagram/), `workingFolderCurrent` must be set to `true`. - -preserveTOC -: By default, Hugo removes the table of contents generated by Asciidoctor 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 Asciidoctor's TOC in the generated page. - -Below are all the AsciiDoc related settings in Hugo with their default values: - -{{< code-toggle config="markup.asciidocExt" />}} - -Notice that for security concerns only extensions that do not have path separators (either `\`, `/` or `.`) are allowed. That means that extensions can only be invoked if they are in one's ruby's `$LOAD_PATH` (ie. most likely, the extension has been installed by the user). Any extension declared relative to the website's path will not be accepted. - -Example of how to set extensions and attributes: - -```yml -[markup.asciidocExt] - extensions = ["asciidoctor-html5s", "asciidoctor-diagram"] - workingFolderCurrent = true - [markup.asciidocExt.attributes] - my-base-url = "https://example.com/" - my-attribute-name = "my value" -``` - -In a complex Asciidoctor environment it is sometimes helpful to debug the exact call to your external helper with all -parameters. Run Hugo with `-v`. You will get an output like - -```txt -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 -] ... -``` +[details]: /getting-started/configuration-markup/#asciidoc ## Learn markdown @@ -115,7 +72,6 @@ Markdown syntax is simple enough to learn in a single sitting. The following are * [Markdown Tutorial (Interactive), Garen Torikian][mdtutorial] * [The Markdown Guide, Matt Cone][mdguide] -[`emojify` function]: /functions/emojify/ [ascii]: https://asciidoctor.org/ [config]: /getting-started/configuration/ [developer tools]: /tools/ |