I've been using Markdown recently.
One of my biggest problems with Markdown is that Markdown has no syntax for including files within a document (vs., say, the listings
package for LaTeX).
I'd like to extend Markdown to support including whole and partial files as code snippets. For instance, it could look like this:
![:include src/foo/bar.rb](10-20)
and that would put the contents of bar.rb
lines 10-20 into my document as a code
block. The rationale is that
- documentation can be updated as the code changes. (vs. copy and paste which always gets outdated)
- you can then unit test the exact code that is in the documentation
My questions are:
- What should the syntax be?
- Has this already been done and I am missing it?