dyna3/doc/gendoc.litcoffee

24 lines
1.1 KiB
Plaintext

- The documentation will be generated by a coffeescript template (gendoc.litcoffee) which collates in the proper order several particular Markdown files, starting with README.md. The list of files includes all of the Literate Coffeescript files, with the actual code stripped out, leaving just the Markdown. The resulting dyna3.md file will be further processed into HTML and placed in the site directory.
```javascript
fs = require 'fs'
docsrcs = [
'README.md', 'src/dyna3.litcoffee',
'src/helpers/pkglock_to_externals.litcoffee', 'docbuild/extlist.md',
'doc/tech.md', 'doc/gendoc.litcoffee'
]
if process.argv.length > 2
process.stdout.write docsrcs.join ' '
process.stdout.write "\n"
process.exit 0
striplit = (text) -> String(text).replace(/^```javascript[^]*?```\n/mg,'')
incfile = (fn, filt = null) ->
if (filt is null)
if (/litcoffee$/.test(fn)) then filt = striplit
else filt = (x)->x
process.stdout.write filt fs.readFileSync fn
process.stdout.write "\n"
incfile f for f in docsrcs
```