Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ToC autogeneration hook #8

Open
xginn8 opened this issue Feb 26, 2020 · 2 comments
Open

Add ToC autogeneration hook #8

xginn8 opened this issue Feb 26, 2020 · 2 comments

Comments

@xginn8
Copy link
Contributor

xginn8 commented Feb 26, 2020

Having a table of contents for each masterclass would make navigation easier. We should be able to autogenerate that fairly easily as a precommit git hook, using something like https://github.com/thlorenz/doctoc perhaps.

cc @hedss @garethtdavies

@garethtdavies
Copy link
Contributor

doctoc works great for manual generation - I used doctoc README.md --github --notitle. Output here. However, I hit this issue when using it as a pre-commit hook thlorenz/doctoc#161. I'm also concerned adding a git hook also becomes a barrier to quick/trivial contributions, which are unlikely to change the structure of the document and having to install the dependencies etc...

It does emit a nice warning not to manually edit:

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
.....
<!-- END doctoc generated TOC please keep comment here to allow auto update -->

@hedss
Copy link
Contributor

hedss commented Feb 27, 2020

I've started looking at Markdown All In One with Gareth suggested, and the table seems to work fine with the GH compatibility enabled. I'm going to add this to the Docker MC I'm writing and see how it goes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants