3 ms·
I've recently been researching this for my own needs, and this author's md -> pandoc -> etc chain is pretty much where I settled. Reading this article, I was ho
by delinka 8y ago
I've recently been researching this for my own needs, and this author's md -> pandoc -> etc chain is pretty much where I settled. Reading this article, I was hoping to find a way to point code blocks at a git repo (local, remote, w/e) so that as code changes, the book follows (I do mean during the formatting phase - not that an ebook would follow a remote repo to get code.) I did not find that solution in this article.
Has anyone come up with a method for doing what I want? Maybe the ```lang code blocks in md could take parameters like repo, file, line range; then an update to pandoc would fix it all right up. Thoughts?
- agravier 8y agoYou could probably hack something together with pp and python?
- misternugget 8y agoYou should take a look at embedmd, which allows you to include files (or just portions of a file) in a Markdown file: https://github.com/campoy/embedmd https://github.com/campoy/embedmd As I wrote in the post, I didn't use it because it doesn't allow me to include a portion of something and then comment out a part of that, but today I got thinking: if it could include a portion of a function and also the relevant (semantic?) context, it would be 99% of what I need. But the "relevant context" is the tricky part, I guess. I like what git diff does, when it shows the signature of a changed function (does it simply use the first of the previous lines that are less intended?), but I guess it's hard to get really right... edit: GitChapter is also a really interesting project. If it didn't use a real git repository, but something like folders that resemble single commits, I think I'd use it. https://github.com/chrissound/GitChapter/ https://github.com/chrissound/GitChapter/