You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the citeproc filter to the pandoc converter.
There are several PRs for it this feature already. However, I think
simply adding `--citeproc` is the cleanest way to enable this feature,
with the option to flesh it out later, e.g., in #7529.
Some PRs and issues attempt adding more config options to Hugo which
indirectly configure pandoc, but I think simply configuring Pandoc via
Pandoc itself is simpler, as it is already possible with two YAML
blocks -- one for Hugo, and one for Pandoc:
---
title: This is the Hugo YAML block
---
---
bibliography: assets/pandoc-yaml-block-bibliography.bib
...
Document content with @citation!
There are other useful options, e.g., #4800 attempts to use `nocite`,
which works out of the box with this PR:
---
title: This is the Hugo YAML block
---
---
bibliography: assets/pandoc-yaml-block-bibliography.bib
nocite: |
@*
...
Document content with no citations but a full bibliography:
## Bibliography
Other useful options are `csl: ...` and `link-citations: true`, which
set the path to a custom CSL file and create HTML links between the
references and the bibliography.
The following issues and PRs are related:
- Add support for parsing citations and Jupyter notebooks via Pandoc and/or Goldmark extension #6101
Bundles multiple requests, this PR tackles citation parsing.
- WIP: Bibliography with Pandoc #4800
Passes the frontmatter to Pandoc and still uses
`--filter pandoc-citeproc` instead of `--citeproc`.
- Allow configuring Pandoc #7529
That PR is much more extensive and might eventually supersede this PR,
but I think --bibliography and --citeproc should be independent
options (--bibliography should be optional and citeproc can always be
specified).
- Pandoc - allow citeproc extension to be invoked, with bibliography. #8610
Similar to #7529, #8610 adds a new config option to Hugo.
I think passing --citeproc and letting the users decide on the
metadata they want to pass to pandoc is better, albeit uglier.
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.
55
55
{{% /warning %}}
56
56
57
57
### External Helper AsciiDoc
58
58
59
-
[AsciiDoc](https://github.com/asciidoc/asciidoc) implementation EOLs in Jan 2020 and is no longer supported.
60
-
AsciiDoc development is being continued under [Asciidoctor](https://github.com/asciidoctor). The format AsciiDoc
59
+
[AsciiDoc](https://github.com/asciidoc/asciidoc) implementation EOLs in Jan 2020 and is no longer supported.
60
+
AsciiDoc development is being continued under [Asciidoctor](https://github.com/asciidoctor). The format AsciiDoc
61
61
remains of course. Please continue with the implementation Asciidoctor.
62
62
63
63
### External Helper Asciidoctor
64
64
65
-
The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo.
65
+
The Asciidoctor community offers a wide set of tools for the AsciiDoc format that can be installed additionally to Hugo.
66
66
[See the Asciidoctor docs for installation instructions](https://asciidoctor.org/docs/install-toolchain/). Make sure that also all
67
67
optional extensions like `asciidoctor-diagram` or `asciidoctor-html5s` are installed if required.
68
68
@@ -110,13 +110,63 @@ Example of how to set extensions and attributes:
110
110
my-attribute-name = "my value"
111
111
```
112
112
113
-
In a complex Asciidoctor environment it is sometimes helpful to debug the exact call to your external helper with all
113
+
In a complex Asciidoctor environment it is sometimes helpful to debug the exact call to your external helper with all
114
114
parameters. Run Hugo with `-v`. You will get an output like
115
115
116
116
```
117
117
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 -] ...
118
118
```
119
119
120
+
### External Helper Pandoc
121
+
122
+
[Pandoc](https://pandoc.org) is a universal document converter and can be used to convert markdown files.
123
+
In Hugo, Pandoc can be used for LaTeX-style math (the `--mathjax` command line option is provided):
Note that Hugo will **not** pass its metadata YAML block to Pandoc; however, it will pass the **second** meta data block, denoted with `---` and `...` to Pandoc. Thus, all pandoc settings should go there.
153
+
154
+
You can also add all elements from a bibliography file (without citing them first) using:
155
+
156
+
```
157
+
---
158
+
title: My Publications
159
+
---
160
+
---
161
+
bibliography: assets/bibliography.bib
162
+
nocite: |
163
+
@*
164
+
...
165
+
```
166
+
167
+
It is also possible to provide a custom [CSL style](https://citationstyles.org/authors/) by passing `csl: path-to-style.csl` as a Pandoc option.
168
+
169
+
120
170
## Learn Markdown
121
171
122
172
Markdown syntax is simple enough to learn in a single sitting. The following are excellent resources to get you up and running:
0 commit comments