Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Feature Request: Module for constructing code tutorials. Include code blocks (diff files) #40

Open
tswast opened this issue Nov 18, 2016 · 3 comments

Comments

@tswast
Copy link

tswast commented Nov 18, 2016

I'd love to be able to run a diff command as part of the pre-processor for making tutorials / codelabs.

Would such a module be in scope for this project? I guess it wouldn't necessarily be cross-platform to be able run commands from the environment.

@amyreese
Copy link
Owner

The biggest concern would be around the security implications of allowing arbitrary shell commands to be run when ostensibly building documentation, especially in combination with the ability to include content from remote URLs. If there are specific features that you'd like to have, then I'd rather see those implemented as custom modules instead.

@tswast
Copy link
Author

tswast commented Nov 18, 2016

Makes sense to me. Yeah, it could get nasty with things like !INCLUDEURL where commands could get run without the user expecting it.

I think what I want is something like embedmd where I can include a code block from another file. I'd really like if I could define the code blocks by diffing two files, but I'm having trouble visualizing what the output of that would look like (other than just plain diff/patch syntax, which isn't great for copy-paste).

@tswast tswast changed the title Feature Request: Module for running shell commands / diffs Feature Request: Module for constructing code tutorials. Include code blocks (diff files) Nov 18, 2016
@amyreese
Copy link
Owner

It might make sense to add support for a generic syntax highlighter, like Pygments, though it would make more sense to do that as a post processor, after the real Markdown has been formatted. At that point, anything in a <code> tag could be safely run through the syntax highlighter to generate the final HTML. Alternatively, you could run files through Pygments as a separate step before running MarkdownPP, so that they're already marked up before being included into the markdown document.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants