Reopen issue 346 - Include file-content as part of markdown
Please reopen https://github.com/github/markup/issues/346 - just look at the comments to see the support for this feature
+1
+1
+1
Subscribe works better than +1 !!! +1
+1
+1
+1
+1
I have been working (in a private repo) on a Ruby class, MarkdownHelper, whose first method is include(template_file_path, markdown_file_path). I had intended to make this public, and to put it onto Rubygems.org.
I've seen in (much) earlier issues that GitHub has security concerns. Should I share their concern, and not go public?
Fwiw, I have made public my GitHub repository MarkdownHelper.
The first feature is file inclusion for GitHub markdown, supporting included text as:
- Highlighted code block.
- Plain code block.
- Verbatim text.
I wouldn't even mind if it were as simple as including an entire file inline. My use case is to be able to display a mermaid diagram tracked in its own .md document across multiple documents.
Then the verbatim inclusion might be helpful to you?
+1
Would be awesome to include .js files in markdown documentation
I've put up a markdown helper with file inclusion on RubyGems:
https://rubygems.org/gems/markdown_helper
@BurdetteLamar I am not clear what your markdown helper does exactly. What do I add to my README.md or README.rst on Github to use your markdown helper to include a file within it?
Specify each file inclusion via an include pragma, which has the form:
- @[format](relative_file_path)
where:
- format (in square brackets) is one of the following:
- Highlighting mode such as
[ruby], to include a highlighted code block. This can be any Ace mode mentioned in GitHub Languages. [:code_block], to include a plain code block.[:verbatim], to include text verbatim (to be rendered as markdown).
- Highlighting mode such as
- relative_file_path (in parentheses) points to the file to be included.
[The formatting of my doc is correct on GitHub, but gets mangled on RubyDoc.info. In answering you, I may have discovered a fix.! Will work on it.]
@BurdetteLamar Do I need to add markdown_helper-0.1.5.gem in the root of my Github repo for it to work? If not, where should it go?
@mcarans First, thanks for the earlier nudge. Got my doc fixed so it's right both on GitHub and RubyGems.
Second, let's take this offline, say, to email at [email protected]. Or Skype at burdette.lamar.
I've seen over at GH that @mcarans often(?) codes in Python.
My method MarkdownHelper#include is not all that much code, so it wouldn't be hard to port it from Ruby to Python.
But that idea brings me back to something I'd thought before: Maybe we should have an agreed-upon specification for include files (i.e., specify the format for the include pragma). Then implementations that honor that spec would be able to process anyone's input.
Alternatively, there could be just two "universal" implementations, one (say, sh) that works on Linux, and one (say, Powershell) that works on Windows.
Thoughts?
[I know this is a bit off-topic for GH, but I don't know where else to go with this idea. Suggestions welcome.]