hugo/markup
Sebastian Höffner c91c64a1aa
markup: add --citeproc to pandoc converter
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.
2023-08-08 15:45:27 +02:00
..
asciidocext Replace the old log setup, with structured logging etc. 2023-06-18 13:03:04 +02:00
blackfriday Remove Blackfriday markdown engine 2022-05-29 11:50:58 +02:00
converter all: Fix comments for exported functions and packages 2023-05-18 21:25:27 +02:00
goldmark Replace the old log setup, with structured logging etc. 2023-06-18 13:03:04 +02:00
highlight deps: Fix Chroma dependency version 2023-07-31 21:01:43 +02:00
internal markup: Fix typo in function and struct names 2023-06-01 17:59:44 +02:00
markup_config Add all config to docshelper.json 2023-08-07 13:42:54 +02:00
org Replace the old log setup, with structured logging etc. 2023-06-18 13:03:04 +02:00
pandoc markup: add --citeproc to pandoc converter 2023-08-08 15:45:27 +02:00
rst Don't panic on invalid security whitelist regexp 2023-06-28 08:57:28 +02:00
tableofcontents all: Fix comments for exported functions and packages 2023-05-18 21:25:27 +02:00
markup.go Create a struct with all of Hugo's config options 2023-05-16 18:01:29 +02:00
markup_test.go Create a struct with all of Hugo's config options 2023-05-16 18:01:29 +02:00