orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

feat: tangle

Open danilshvalov opened this issue 2 years ago • 0 comments

This PR develops ideas #435 (part of the code was taken right from there). In this PR, I implemented inheritance of properties for code blocks and headings.

Examples

All the following examples tangle code block to test.lua:

  1. Document property:

    #+PROPERTY: header-args :tangle test.lua
    
    #+begin_src lua
    local foo = "bar"
    #+end_src
    
  2. Heading property:

    * Heading
    :PROPERTIES:
    :tangle: test.lua
    :END:
    
    #+begin_src lua
    local foo = "bar"
    #+end_src
    

    or

    * Heading
    :PROPERTIES:
    :header-args: :tangle test.lua
    :END:
    
    #+begin_src lua
    local foo = "bar"
    #+end_src
    
  3. Code block property:

    #+begin_src lua :tangle test.lua
    local foo = "bar"
    #+end_src
    

TODO

  • [x] Use queries instead of recursion
  • [ ] Remove magic constants
  • [ ] Add tests
  • [ ] Add documentation

danilshvalov avatar Sep 25 '23 23:09 danilshvalov