zakhenry / embedme

Utility for embedding code snippets into markdown documents
MIT License
229 stars 38 forks source link

Support including snippets of files #71

Open holdenk opened 3 years ago

holdenk commented 3 years ago

I'd really like to be able to include snippets of files like in asciidoctor.

zakhenry commented 3 years ago

Hi, I'm not familiar with asciidoctor, can you provide an example of how that might look with embedme?

holdenk commented 3 years ago

Totally. So in asciidoctor I can add a tags=blah to the end of an include statement and then when reading in the source file it will look for a line with tag::blah[] and then include all of the text until the line end::blah[]. This makes it really simple to include snippets of files. I've got a post I've done using asciidoctor and Jekyll https://raw.githubusercontent.com/scalingpythonml/scalingpythonml.github.io/master/_posts/2020-11-03-a-first-look-at-dask-on-arm-on-k8s.asciidoc and the generated post is at https://scalingpythonml.com/2020/11/03/a-first-look-at-dask-on-arm-on-k8s.html

Totally understand if it's not part of the vision for embedme, but if it is I'd love to be able to simplify my workflow and stay in markdown using embedme :)

zakhenry commented 3 years ago

Ahh right I getcha, is this essentally the same thing as https://github.com/zakhenry/embedme/issues/48 ?