jgm/pandoc

Config file for customizing output

stomar opened this issue · 4 comments

There should be a feature for customizing the output writer's behavior (a command line option specifying a configuration file).

This would be very helpful for documents in foreign languages (e.g. in connection with the --smart option and the style for the used "curly" quotes). It would also be useful for authors who need to meet certain styling conventions, possibly different for different documents.

Some things that should be customizable:

  • general
    • table of contents entry for the epub cover image (default: "Title Page")
  • with the --smart option
    • curly quotes (opening/closing/inner/outer separately)
    • dashes (substitution of -- and ---)

Best regards,
Marcus

To quote from my mail from Fri, 21 Oct 2011 11:46:21 +0200 which somehow
didn't seem to have made it to the pandoc list:

Actually one might also want to apply such configuration to only a
part of the text (say in a multilingual document), so the granularity
should IMO be "sub-documental".

This could also cover things like the "don't convert newlines to spaces
for Chinese text" I asked for recently.

bpj commented

Other things:

  • Headings for TOC, footnotes and bibliography
  • The symbol/text used for footnote backlinks
  • The markup used for block/span types, e.g.
    for the markdown writer:
Emph:
  start: _
  end: _
Strong:
  start: __
  end: __

This issue seems to mix two feature requests:

  • additional options to configure writers, especially for internationalization (e.g. headings for TOC, footnotes and bibliography...)
  • support of setting such options in a config file

The former could be implemented by configurable extensions (see below).

The latter was also discussed before in #2069. I would welcome a way to read all pandoc options (as listed with pandoc --help) from a config file. By now only some of these options can be set as document metadata (option -M / --metadata) but others such as pdf-engine, self-contained... not. The requested config file format could look like this:

---
pdf-engine: xelatex
self-contained: true
metadata:  
  key: value...
variable:
  key: value...
extension:
  foobar:
    Emph:
      start: _
      end: _
---

Example usage:

  • pandoc -t html (adds --self-contained from config file)
  • pandoc -t markdown+foobar
mb21 commented

This issue seems to mix two feature requests:

Agreed.

  • additional options to configure writers, especially for internationalization (e.g. headings for TOC, footnotes and bibliography...)

There has been progress on this: see Translations.hs and --abbreviations (c93d069) for example. For additional suggestions, please open (and look for) more specific issues – or maybe ask on pandoc-discuss first.

  • support of setting such options in a config file

see #4627