-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Redcarpet comes with a TOC-renderer. I'd like to use that one and drafted a pretty rough implementation in my fork.
It is already usable like the following: Copy (better: symlink) the relevant file (e.g. README.md) while changing its extension to .md_toc (e.g. README.md_toc: ln -s README.md README.md_toc). Then call render as usally, but run through the file twice:
<%= render 'markdown.md_toc' %>
<%= render 'markdown.md' %>
In the implementation as-is, you have to specify the full filename I guess (didnt try without, shouldnt work) to dissociate between the two files (alternative, rename to something like README_TOC.md_toc.
I agree that the API is not yet ready for winning awards, but its just a hacky sketch for now. What do you think about that feature? How would you like the API to look like (maybe render_toc 'readme'?).