2 comments

[ 2.8 ms ] story [ 14.9 ms ] thread
Not to take away from this (I'd probably use it if I used markdown), but RestructuredText has file inclusion out of the box.

http://docutils.sourceforge.net/docs/ref/rst/directives.html...

  $ for f in main.rst include1.rst include1.1.rst; do
    echo "$f"
    cat "$f"
  done 

  main.rst
  ==================================
  Demo of RestructuredText inclusion
  ==================================
  
  .. contents::
  
  First include a file
  ====================
  
  .. include:: include1.rst
  include1.rst
  
  This is the first included file
  -------------------------------
  
  Which includes another file.
  
  .. include:: include1.1.rst
  include1.1.rst
  
  And this is the last included file
  ..................................
  
  Fin.

  $ lynx --dump main.html

  Demo of RestructuredText inclusion
  
     Contents
       * [1]First include a file
            + [2]This is the first included file
                 o [3]And this is the last included file
  
  [4]First include a file
  
  [5]This is the first included file
  
     Which includes another file.
  
  [6]And this is the last included file
  
     Fin.
  
  References
  
     1. file:///home/aaron/tmp/main.html#first-include-a-file
     2. file:///home/aaron/tmp/main.html#this-is-the-first-included-file
     3. file:///home/aaron/tmp/main.html#and-this-is-the-last-included-file
     4. file:///home/aaron/tmp/main.html#id1
     5. file:///home/aaron/tmp/main.html#id2
     6. file:///home/aaron/tmp/main.html#id3