In my package (pandoc-pdf, not yet published), I would like to enable the user to configure different behavior for different file extensions.
Concretely that means having a mapping from strings that define file extensions to strings that specify the behavior. For example:
“md” → “gfm”
“text” → “markdown+hard_line_breaks”
It should be up to the user how many and which extensions are configured; the list can also be empty.
Because of the latter requirement, I can not simply include a sequence of config settings in the package.
I could instruct the user to instead edit
config.cson manually, as is required by some other packages, too. Maybe like this:
pandoc-pdf: ... pandocMap: "md": "gfm" "text": "markdown+hard_line_breaks"
The drawback is that these settings show up slightly weird in the settings dialog:
I guess I could add a hook that adds normalized descriptions like
Extension 'md' instead of
Pandoc Map Md.
Another possibility would be to use a multiline text field that contains something like
md: gfm text: markdown+hard_line_breaks
which I then parse myself. It is possible to put multiline strings into a config value, and it shows up as a scrollable text field, which is however styled to a height of 50px and therefore unusable. I guess I could try hacking the CSS, but doesn’t seem like a good idea.
What do you think / recommend?