The source is already intended to be documentation. There's relatively little work to be done:
Identify fragment cross-references:
Use is explicit in the fragments.
“Where used” is often useful.
Build code indexes, variable lists, etc.
Transform fragments and references for rendering.