Documentation is extracted from the Fosc class files and written to Markdown format. This can then be converted to HTML using Pandoc.
Markdown extraction can be done in SuperCollider for a single class as follows:
FoscMarkdownFile("/path/to/ClassFile.sc").write("/path/to/MarkdownFile.md");Code blocks found in the class file are interpreted and their post output and any images generated are included in the output. See the TestClass.sc file for details.
FoscDocumentationGenerator("/path/to/class/tree", "/path/to/markdown/tree", clean: false).generate;Set clean to true to delete the output path first.
It may be convenient to use GNU Make to build the documentation, particularly during development. A Makefile is provided with the following defined targets:
Individual target outputs can also be built, e.g.:
make www/base/FoscObject.htmlPandoc converts the generated Markdown files to HTML, adding syntax highlighting for SuperCollider and LilyPond code blocks. The SuperCollider syntax is defined in supercollider.xml; LilyPond syntax highlighting is built-in to Pandoc.
Some code examples in particular class files regularly but inconsistently fail to build - the interpreter crashes without displaying any error output or writing the Markdown file.
agent/FoscMutation.sc, particularly the rewriteMeter methodmaker/FoscDurationSpecifier.scMultiple examples in these classes are flagged nointerpret until this can be fixed.
Some methods designed for use in an interactive environment use Post directly to display formatted information. I don’t know how to capture this using interpret. One example of this is FoscMeter.inspect.