wilkinsona / project-generator

3 stars 4 forks source link

Refactor help document generation #38

Closed mbhave closed 5 years ago

mbhave commented 5 years ago

We can iterate on this PR to make any improvements to the help document API.

snicoll commented 5 years ago

Thank you very much @mbhave, I like the new structure a lot.

IMO, there is still a major issue in the current design that I haven't been able to fix. While I think that it is reasonable that a section shouldn't be tied to a given rendering technology, this makes the contributions of additional sections harder.

We can't hardcode the renderer in MustacheSection and a 3rd party that wants to contribute a template with some data should be able to do so with a one-liner-ish which is not the direction this PR is heading.

I've tried to simplify that a bit but it's still awkward.

At the end of the day, if the convention for the "Help document" is that mustache templates are automatically picked from a given location, I should be able to contribute a section with the name of the template and my model without any additional required dependency. Having to specify the renderer around makes unit testing harder for not good reason.