You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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'?).
The text was updated successfully, but these errors were encountered:
If there weren't rails/rails#35222, one could also use render partial 'readme', format: :md_toc . But it wont work due to a bug (takes the wrong TemplateHandler).
I am not sure if I can push further the TOC rendering soon, or if that has to wait a decade.
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: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'
?).The text was updated successfully, but these errors were encountered: