michaelstepner / pandoc-mustache

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

allow self-referencing for YAML-blocks in md files #2

Closed trenkert closed 4 years ago

trenkert commented 6 years ago

right now, pandoc-mustache depends on an external yaml-file from which to draw its variables. Would it be possible to include a function that - if no mustache: ./external_variables.yaml has been specified, mustache reads the yaml-block of the input file and expects references to variables in the body text?

something like

---
date: 1.1.1970
---

The day of {{date}} does not lie in the future

?

rriemann commented 6 years ago

This would be an interesting feature. :+1:

michaelstepner commented 6 years ago

This is an interesting idea. I'm not sure off hand if it's in the spirit of the Mustache templating spec, but it does seem useful. I'd welcome more discussion. I'd potentially merge a pull request that implements this.

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.

rriemann commented 4 years ago

Has this been closed as wont-fix or has this been implemented?

copart commented 3 years ago

I implemented what I believe this issue was requesting.

Submitted as a pull request: https://github.com/michaelstepner/pandoc-mustache/pull/11