Skip to content

feat(docs): add table of contents to README#1032

Merged
johnnyreilly merged 7 commits intoTypeStrong:masterfrom
jsjoeio:issue-204/readme-table-contents
Dec 16, 2019
Merged

feat(docs): add table of contents to README#1032
johnnyreilly merged 7 commits intoTypeStrong:masterfrom
jsjoeio:issue-204/readme-table-contents

Conversation

@jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Nov 4, 2019

This PR adds a table of contents to the README (auto-generated using github-markdown-toc).

It also makes the heading of the README look a little better.

Resolves one task from #1024

Gif

Here's the package markdown-toc in action:
ezgif com-optimize

UPDATE
I automated it by adding a pre-push hook that runs this script:

"generate-toc": "markdown-toc -i ./README.md && git add README.md && git commit -m 'chore: update docs'"

It's super fast! And I did pre-push because I figured pre-commit might be too much.

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Dec 10, 2019

(friendly) bump @johnnyreilly

@johnnyreilly
Copy link
Member

johnnyreilly commented Dec 10, 2019

Sorry I missed this Joe - been snowed! This looks super cool!!

I actually didn't realize you could include html in a markdown file. I must admit to a a gut feeling of "but it's HTML in a markdown file - outrageous!". But I can get past that 😉

So what's the process for regeneration?

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Dec 10, 2019

No worries at all!

😂 Fair point!

So now that you're asking, I'm second-questioning the package/tool I used...It looks like this one doctoc might be easier to set up as a git hook so then the TOC always stays up to date?

Let me know if you think that would be worth it, and I'll make some time to investigate this weekend.

@johnnyreilly
Copy link
Member

Oh that sounds great! Yeah automating is always a good goal and so if you are game for looking into that I'd be super grateful!

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Dec 13, 2019

@johnnyreilly I got it working! 😄

Check it out. Updated the description. Open to feedback if you have any opinions on anything too!

@johnnyreilly
Copy link
Member

Awesome! I'll try and take a look this weekend. Ping me if I forget!

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Dec 16, 2019

@johnnyreilly friendly ping 😄

@johnnyreilly
Copy link
Member

johnnyreilly commented Dec 16, 2019

Looks awesome! So this regenerates what sits between <!-- toc --> and <!-- tocstop --> upon prepush? Nice!

@johnnyreilly johnnyreilly merged commit 232babc into TypeStrong:master Dec 16, 2019
@jsjoeio jsjoeio deleted the issue-204/readme-table-contents branch December 16, 2019 19:02
@johnnyreilly
Copy link
Member

There might be an issue with this - see linked issue

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Dec 22, 2019

Hoping to address in #1045

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

Successfully merging this pull request may close these issues.

2 participants