amyreese / markdown-pp

Preprocessor for Markdown files to generate a table of contents and other documentation needs
MIT License
309 stars 68 forks source link

Variables #17

Open bumper314 opened 8 years ago

bumper314 commented 8 years ago

I suggest implementing variables. There might be a header section where variables are defined:

product: GitHub

Then some way to reference in the MD doc, like {{product}}.

leotrs commented 8 years ago

+1

leotrs commented 8 years ago

@jreese if there's interest, I can work on a quick PR.

amyreese commented 8 years ago

If this is going to be implemented, I would like it to follow something like this:

I've actually done something more or less just like this in a different project (Nib), if you'd like inspiration for implementation, or if you'd like to factor that out into a library of some sort.

julesmaregiano commented 5 years ago

Anything new about this? Would really need something like that :angel:

joncamfield commented 5 years ago

Over at https://github.com/SAFETAG/SAFETAG/ ; we use markdown-pp to compile together a ton of files into one guide for HTML/PDF/etc. construction. We'd love to move more content into a YAML-y metadata header; but this would be local to each sub-file rather than global. If there is movement here, it would be great to enable a few other paths for usage of YAML metadata/variables.

A likely difficult (if handy for my use case!), or at least likely to lead to confusing states option: YAML variables are valid until / reset by the next YAML block

A less powerful, but certainly much easier option would be to spit out a table (what github does; see https://github.com/SAFETAG/SAFETAG/blob/master/en/exercises/assessment_plan/index.md for an example of yaml rendered as a table)