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

Command execution #13

Closed vonpupp closed 8 years ago

vonpupp commented 9 years ago

Hello,

Is it possible to execute commands and include the output of the console within a document using your pre-processor? If not, do you know any tool that allows to do this?

Thank you very much!

amyreese commented 9 years ago

This is not currently available, but would certainly be possible by adding a simple module to the system. It would essentially consist of a regex to look for some sort of special syntax, eg, !EXEC(...), and then generate a transform to replace the one line with a list of lines with the resulting output from the command.

I would be happy to review a pull request if you'd like to create this module, just follow the examples in https://github.com/jreese/markdown-pp/tree/master/MarkdownPP/Modules

vonpupp commented 9 years ago

I found a tool called knitr which I have not fully tested it yet, but it seems to do what I'm looking for, if not I will submit a PR.

Thank you very much for your fast reply.