defunkt/tomdoc — Issue #18: Use Mustache to render the output
Author: dasch
Created: 2011-11-13 11:33:13+00:00
State: open

I think Mustache templating would be a much better way to render the documentation output. The current way - concatenating strings and whatnot - is really not going to scale well.

I suggest something along the lines of:

- Mustache templates are stored in `/templates/`, with each format having its own subdir, e.g. `/templates/html/` and `/templates/console/`.
- All rendering is done through Mustache templates and partials, so only a scope definition (class/module) should be rendered directly, as it will be responsible for rendering its own method definitions.
- View/Presenter classes could be added to aid in the rendering.

### Example

```mustache

{{name}}

{{description}}

Examples

{{examples}}

Class Methods

{{#class_methods}}
{{> class_method}}
{{/class_methods}}

Instance Methods

{{#instance_methods}}
{{> instance_method}}
{{/instance_methods}}
```