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

[Feature] Write the TOC somewhere in the markdown #7

Open
alanfranz opened this issue Jan 6, 2017 · 0 comments
Open

[Feature] Write the TOC somewhere in the markdown #7

alanfranz opened this issue Jan 6, 2017 · 0 comments

Comments

@alanfranz
Copy link

Hello,
thanks for the tool.

There's one feature I'd really like in it: the ability to directly manipulate a Markdown file and inserting the TOC in a specific place, in order to make the update automatic.

Let's suppose a README.md like

## Hello

asdasdasd

## Table Of Contents

xyahdyshasyhd

### Other title

I'd like to do something like

gh-md-toc insert-toc-at "Table Of Contents" README.md 

And I would get on stdout the FULL README.md, with whatever was inside the "Table Of Contents" replaced by the TOC:

## Hello

asdasdasd

## Table Of Contents

* [Hello](#hello)
* [Table Of Contents)(#table-of-contents)
  * [Other title](#other-title)

### Other title

I suppose I could achieve a similar result in bash with awk/sed/similar tools, but IMHO this feature would be quite in line with gh-md-toc purpose.

I'm no go expert, but if you think you don't have time to do it but you would accept a PR for it, I can try coding it myself.

@ekalinin ekalinin changed the title Write the TOC somewhere in the markdown [Feature] Write the TOC somewhere in the markdown Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants