Each page should have a "xyz.proto" file. This will get processed and various things get inserted as follows:
Source code would be inserted by "%source filename". And the file would be processed to replace any troublesome html things with proper html entities so the source would render properly.
Also a master file would generate the "table of contents" page. This would reference all the parts and pieces and cause them to get processed.
This scheme would have all the proto files in a directory (perhaps labeled "proto") and make would be run on that directory whenever a new page was added. This directory should be kept under git management.
Tom's Computer Info / tom@mmto.org