-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do you have any interest in supporting markdown literary programming? #1
Comments
That looks like an interesting approach to literate programming. I can see how putting the markdown in the comments of code could have some advantages. Unfortunately, that isn't really a good fit for what I'm trying to do. For now, I'm focusing only on markdown documents that contain executable code, possibly with multiple programming languages in a single document. So supporting markdown literary programming isn't something I can pursue, at least at this point. |
If I understand @linpengcheng 's request, you may be interested in project pweave. The command pypublish will look for markdown in special comments prefixed by #' and consider anything in between a chunk. Chunk options are provided with #+. The liveness of that project has been questioned, but the main dev seems to address at least bugs. This is for python, for the equivalent in R see https://yihui.name/rlp/. In theory that project supports a long list of languages but I am not sure how much traction it has outside R. I understand @gpoore focus, but the ability to intersperse markdown throughout a project, mixing development and documentation, is very powerful. For instance, I have been able to turn tests into documentation, which means less work and reduced possibility of stale docs. See for instance the examples for project altair_recipes. This is not traditional literate programming in the sense that program output can be included in the output document. Maybe a way to achieve this without broadening this project would be to create a preprocessor that turns a literate program into a markdown file and then push that through codebraid. The easy way is to find all the special comments, remove the prefix and turn everything in between into code chunks. The correct way is to parse the program, find comments and then do the above. The latter unfortunately is language-dependent. Consider the following literate program in python:
A compromise could be to disallow the above at least initially, then one could write a trivial parser that is language independent. This based on the languages I know, on top of my mind. If the prefix is configurable (say #' or #% or #%% as used in other languages), this could have some legs, but it's never as clean as parsing. |
@piccolbo I hope to add "tangling" support for extracting executable code in the near future. That's on my list of planned features. Like you said, it does have some major limitations. Eventually, I want to add support for other parsers beyond Pandoc, and at that point it might be possible to create something like a plugin system for extracting comments from code. For now, though, I'm sticking with Pandoc Markdown so I can focus on refining the code execution and output processing side of things. |
Do you have any interest in supporting markdown literary programming?
Markdown Literary programming that don't break the syntax of any programming language
The text was updated successfully, but these errors were encountered: