Comments (6)
doctoc places the TOC always on top of the file and includes the main title like you described.
I usually go in and edit the file afterwards.
Since the toc is always on top it helps doctoc to replace it with an updated one if necessary see here.
This could be improved however and I'd love to see and pull in contributions that improve this.
from doctoc.
It would be nice to see the table of contents go under the heading and quote:
# My Cool Project
> Definitely the coolest thing since the ice age
## How to be cool
There's only one rule: act cool.
## When it's not cool to be cool
Funerals.
When toc'd, I'd like to see:
# The Cool Project
> Definitely the coolest thing since the ice age
- [The Cool Project](#the-cool-project)
- [How to be cool](#the-art-of-being-cool)
- [When it's not cool to be cool](#when-its-not-cool-to-be-cool)
## How to be cool
There's only one rule: act cool.
## When it's not cool to be cool
Funerals.
from doctoc.
Actually in that case The Cool Project
should probably not be part of the toc, since the toc is below that heading, don't you think?
So if we'd omit that, we would possibly have to adjust indentation level as well.
This could easily be implemented, i.e.. with update-section, we just have the hash out all the edge cases like the ones I just mentioned first.
from doctoc.
Yeah, I totally agree -- The Cool Project
shouldn't be part of the TOC.
from doctoc.
Ok, and I this will already take care of correct indentation even if there is no #
header.
So this should be fairly simple with the update-section module I mentioned above. I'm a bit swamped right now so it may be a while.
However any PR that beats me to it along with nice tests will be very welcome ;)
from doctoc.
This fix has been published with 0.5.1
. doctoc now replaces existing tocs instead of always adding a new one to the top of the file.
from doctoc.
Related Issues (20)
- Doc HOT 1
- Update dependencies to fix security issues HOT 14
- please release/tag doctoc with the <!-- DOCTOC SKIP --> feature included HOT 6
- TOC Does not generate in a file produced from a powershell script.
- Support for .mdx files HOT 4
- Feature request: add ability to include headings before the TOC's `<!-- START -->` flag HOT 3
- Create title and description before table of contents HOT 1
- Feature Request: Generate TOC across multiple md docs
- containerize doctoc HOT 4
- %5C bug with --github option HOT 2
- Migrate Travis-CI.org to Travis-CI.com / Re-enable CI HOT 3
- Hala
- Smashing on someone, standing on, laying on ect....
- version mismatch between npmjs and github
- Not correct link
- Feature request - numbers instead of bullets
- Hi
- Rest API autopilot trade buy and sell,make binance Cridit card give maximum amount for trading and withdraw
- Sent
- Killer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctoc.