markdown-toc icon indicating copy to clipboard operation
markdown-toc copied to clipboard

Feature request: ability to set a custom prefix for the menu URLs

Open simonw opened this issue 4 years ago • 0 comments

I'm using this tool for my README here: https://github.com/simonw/datasette-graphql/blob/main/README.md

That's for a Python tool that is published to PyPI, and the README on PyPI is rendered on this page: https://pypi.org/project/datasette-graphql/

Unfortunately, the links on that page don't work - because PyPI's Markdown renderer strips out the #fragment ID references from the page.

I'd love to be able to run markdown-toc like this:

markdown-toc README.md -i --url-prefix='https://github.com/simonw/datasette-graphql/blob/main/README.md'

This could generate a table of contents that looks like this:

- [Installation](https://github.com/simonw/datasette-graphql/blob/main/README.md#installation)
- [Usage](https://github.com/simonw/datasette-graphql/blob/main/README.md#usage)
...

This would mean that links on the currently broken https://pypi.org/project/datasette-graphql/ page would instead take the user to the right spot in the README hosted on GitHub.

simonw avatar Dec 04 '20 21:12 simonw