Got totally distracted with an idea this morning involving Scheme, S-expressions, ASTs, literate programming, and knowledge graphs.
The literate program markup looks like this:
https://github.com/PaulBatchelor/Recurse/blob/main/scratch/edexp/proto.e
This builds up a s-expressions as trees (take my word for it)
It "tangles" into scheme code that looks like this:
https://github.com/PaulBatchelor/Recurse/blob/main/scratch/edexp/output.scm
It "weaves" into knowledge graph markup (dagzet), which can then be rendered into an HTML document like this one:
https://pbat.ch/recurse/dz/edexp_test/program/
Once in the knowledge graph format, I can treat every atom in the tree like a node in a graph and connect them to any other nodes in the graph. I can also use it to create emergent structures in my knowledge graph, such as this dynamically produced comments page: