FransBouma / DocNet

Your friendly static documentation generator, using markdown files to build the content.
http://fransbouma.github.io/DocNet/
248 stars 36 forks source link

[wip] Add Handlebars support and escaping @@ tags in markdown code #34

Closed vladnega closed 8 years ago

vladnega commented 8 years ago

Fixes #33. You can now write the following in your markdown files and the @@ tag won't cause the respective function to be called:

@@include(api.html)
```

The above would simply generate the following in your final HTML file:

@@include(api.html)


I've also added Handlebars partials support. This can be called in your markdown file using:

@@render(path_to_partial.html,path_to_data.json)



All functions return user friendly error messages to help him debug the code.

More functions like `include` and `render` can be easily added to the C# code. Please have a look at the `PartialsSelector` function.
FransBouma commented 8 years ago

Please only ready-to-merge PRs with a single feature which is complete. A lot of code changes in your PR and it includes a change that was postponed (the htm->html) change, as it needs configuration and better handling (this is in progress).

Your change alters the regexp, but that's not what is intended with #33. In #33, the parsing of @@include has to take place in the markdowndeep parser so context where @@include is used is taken into account. A regexp just matches everywhere and I don't want a parser relying on that. THe current code (with the regexp) is working but needs to be replaced by a non-regexp solution.