-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dispatch PANDOC_OPTIONS base on input extensions #3492
Comments
Please implement this. No changes other than |
There's one thing I don't understand and missed last time I looked: self.config_dependencies = [str(site.config['PANDOC_OPTIONS'])] What's this |
|
I'll leave that alone then as it is working well in the PR. (Good to know it is watching changes from conf.py though I find that sometimes changes in conf.py is not propagated when using |
This could be a bug — please report it (we will need specific details about what you’re changing, in what cases does it work, and if it happens with |
I'll watch out for that in the future. Thanks. |
Summary
Currently,
COMPILERS
only has a keypandoc
, andPANDOC_OPTIONS
is set for all the extensions specified there. The proposed feature simply suggests to have configurable dispatch logic to allow multiple extensions calling pandoc with a different set ofPANDOC_OPTIONS
.Example use case
My personal use for this would be to convert one of my site currently using
.md
and.markdown
to mean a different target format. Both will be converted to HTML, but one of them is slideshow, another is normal "article"/post.Another possible use case is, if one want to specify markdown extensions in pandoc, say
-t markdown+...-...
, thenCOMPILERS['pandoc'] = ['.rst', '.md']
won't work withPANDOC_OPTIONS = ['-t', 'markdown+...-...']
because that would be wrong input format for.rst
.Suggested implementation
Probably the natural way is to promote
where the keys are those in
COMPILERS['pandoc']
.If it makes sense I can send a PR doing that. It seems that it only requires changes in https://github.com/getnikola/nikola/blob/master/nikola/plugins/compile/pandoc.py#L52-L56, is it true?
The text was updated successfully, but these errors were encountered: