defunkt / tomdoc

A TomDoc Ruby library.
http://tomdoc.org/
MIT License
114 stars 16 forks source link

Use Mustache to render the output #18

Open dasch opened 12 years ago

dasch commented 12 years ago

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:

<h1 class="class-definition">{{name}}</h1>

{{description}}

<h2>Examples</h2>

{{examples}}

<h2>Class Methods</h2>

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

<h2>Instance Methods</h2>

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

@defunkt: I would be willing to implement this if you were interesting in going down this route.

trans commented 12 years ago

Actually, taking a step back, I'd suggest that the templates be separate project(s). And let tomdoc focus on parsing.

trans commented 12 years ago

So I "flipped the script" and created tomparse to handle the parsing. If you want to move forward with using mustache templates, then that would be great.