org-babel-tangle.py icon indicating copy to clipboard operation
org-babel-tangle.py copied to clipboard

Rewrite

Open thblt opened this issue 7 years ago • 0 comments

This first version is a butched draft. A complete version should support:

  • at the very least, noweb
  • if possible, default values for header arguments in document preamble.

Quick notes for a possible rewriting:

  • Use Haskell! Pandoc can do 99% of the job. A Pandoc AST holds the code blocks with header arguments parsed, and extra indentation removed. Only noweb would remain to handle.
  • noweb can also be used to include the results of a code block, by including it like this:
     <<block_name(optional arguments)>>
    
    I don't think I'll ever support this, as it would mean rewriting most of org-babel, and I really don't see a use case for it. (Also, code blocks could be elisp, which means actually running from inside Emacs)
  • A different approach to noweb could be to let Org handle it, if it's not too slow. Let org expand noweb references, capture the result and tangle.
  • Parsing org headers is probably hard, replacing them with command-line arguments would be easier.

thblt avatar May 26 '18 08:05 thblt