michaelstepner / pandoc-mustache

Pandoc filter for variable substitution using Mustache syntax
Creative Commons Zero v1.0 Universal
55 stars 14 forks source link

(Dynamic) Metadata from Pandoc Command Line #8

Closed jefferyyuan closed 5 years ago

jefferyyuan commented 5 years ago

It would be great if we can use the metadata passed in command line:

The filter can just parse and add the metadata from command line, and use it when parse the markdown content.

Thanks

michaelstepner commented 5 years ago

@jefferyyuan, note that the same result could be achieved by redirecting the output of your "date" command to a YAML file which is referenced using pandoc-mustache. I'm also not sure what syntax would be used to implement this feature request, i.e how would metadata be referenced in the mustache style.

I've pasted the contributing section from the README below.

Contributing

Project Status: Inactive

This code is not being actively developed. It was created to fulfill my pandoc writing needs, and the current feature set is adequate for me.

If you have a feature request, it is unlikely that I will be able to implement it for you. You can create an issue to generate discussion. If you implement a feature, you can file pull request and I will review it eventually, as time permits. If you're interested in making major additions to the code, I'd be happy to welcome a new maintainer to the project.

copart commented 3 years ago

https://github.com/michaelstepner/pandoc-mustache/pull/11 implements this.

Your example would allow {{date}} inside your markdown content and the date will be inserted. However, as @michaelstepner pointed out, you could of just redirected the date to a YAML file.