billryan / gitbook-plugin-etoc Goto Github PK
View Code? Open in Web Editor NEWElegant toc plugin for GitBook
License: MIT License
Elegant toc plugin for GitBook
License: MIT License
when i use the same name as bellows:
1. Header1
1.1 aa
1.2 bb
2. Header2
2.1 aa
1.1 and 2.1 use the same name aa
, but it didn't work when I click 2.1
Hey, I I've recently discovered unexpected behavior of your plugin.
Expected behavior:
No toc is shown, and the content is not inside the toc.
Workaround
There seems to be a problem with the headings behavior. Using a single level 3 title or setting mindepth to 2 fixes the problem. So I think there is something wrong with the headline detection. It will insert a empty toc that get filled with the actual site content.
Setup:
Node Docker Image 7.7.3
Gitbook 3.2.2
etoc 1.1.9
Custom css for dark theme:
.book.color-theme-2 #toc, .book.color-theme-2.toc {
background-color: rgba(255,255,255,.15);
}
Plugin is only activated - no configuration is used
Used markdown file:
test.md.txt
(Renamed it because Github doesn't accept markdown files as an attachment)
The purpose of TOC is to help readers navigate different sections conveniently, TOC is in the top of page currently, which is not friendly for readers. But fix TOC on the right may break the original page layout, any ideas?
In some cases I would prefer a toc without numbering, because it may confuse readers when these numbers are not reflected in the actual headers throughout the text.
Nils
If i include a markdown document via
{% include "./test.md" %}
the headings that appear their are not included in the generated TOC.
it does not work.
my md is like :
# mock测试指南
*by 李@测试部*
- - - - -
<!-- toc -->
#aaaaaaaaaaaaaaaaaaaaa1
对于分层系统来说,为了测试充分,需要针对每一层进行测试
it looks like the latest version doesn't take into account the maxdepth setting anymore. For example, if I set it to 3, it still shows h4 headers.
Steps to reproduce: specify user-defined anchors as follows:
# My section 1 {#section1}
Nice work otherwise, thank you for sharing!
it is a NICE feature that TOCs are generated automatically when the depth of headers is a greater than 3 by default.
while this markdown, has no level-3 headers, but so many level-2 headers that readers always 'get lost' in some section.
i guess depending on the amount of level-2 headers will also be an additional nice feature. setting mindepth=2
can meet this case, but Zero Configuration
will be much more greater ?
When l build the gitbook I have :
TypeError: Cannot read property 'name' of undefined (In file 'file.md')
My book.json config :
{
"gitbook": "2.x.x",
"language": "en",
"title": "My Title",
"author": "My Name",
"plugins": ["heading-anchors", "etoc"],
"pluginsConfig": {
"etoc": {
"h2lb": 3,
"mindepth": 3,
"maxdepth": 4,
"notoc": false
}
},
"structure": {
"readme": "readme.md",
"summary": "summary.md"
}
}
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.