
Ask HN: What macro-processing language am I looking for - leksak
I have a project that I want to document and one thing I&#x27;d like to do is to highlight that the application code is decomposed in a way that maps essentially 1-to-1 to the theoretical framework and the way I&#x27;d like to do this is to run `tree` inside of the markup that should be outputted as Markdown in the end.<p>E.g., passing the following input.some_fileextension file to the processor should evaluate the tree command and put the results there<p>bla bla bla<p>$ tree dir<p>bla bla blah<p>Is this a task for pandoc? M4? Something else? I want something close to Jupyter notebooks without needing that _entire_ framework at hand.<p>Or is there some lispy type of thing that I can use?
======
karmakaze
What application code language are you using that doesn't already have one or
more source doc-generators? Can you just tweak or post process the output from
them?

------
Someone
shell? Something like this (definitely buggy; you’ll have to remove the ‘$’
from the line before you evaluate it. I also didn’t check how to match that
dollar sign at the start of a line. I think you can solve both problems by
using a semicolon, not a dollar sign as indicator for ‘evaluate this line’.
You also _may_ want to allow multi-line commands and there maybe more bugs):

    
    
      while read line ; do
        case "$line" in
          \$*) `$line`
          *)  echo $line
          ;;
        esac
      done

