Comments (5)
Sorry for the (inexcusably) late reply; I'll test this out. Can you provide any other info about this particular Eleventy config?
- What template option are you using?
- Can you provide an example of the stringified JSON option object you're passing in?
from eleventy-plugin-toc.
In my case I have tried two ways and options are not being uptaken by the plugin, they are just being ignored. I was to use UL instead of OL:
const tocOptions = {
tags: ['h2', 'h3', 'h4'], // which heading tags are selected
wrapper: 'nav', // element to put around the root `ol`
wrapperClass: 'toc-abc', // class for the element around the root `ol`
ul: true,
flat: true,
}
module.exports = function(eleventyConfig) {
//Plugins
eleventyConfig.setLibrary(
'md',
markdownIt(mdOptions)
.use(markdownItAnchor, mdAnchorOpts)
)
//eleventyConfig.addPlugin(pluginTOC,tocOptions);
eleventyConfig.addPlugin(pluginTOC, {
tags: ['h2', 'h3', 'h4'], // which heading tags are selected
wrapper: 'nav', // element to put around the root `ol`
wrapperClass: 'toc-abc', // class for the element around the root `ol`
ul: true,
flat: false,
});
from eleventy-plugin-toc.
@helmutgranda Just published 1.1.0 which supports .eleventy.js
options in addPlugin
from eleventy-plugin-toc.
@Heydon Recent updates also fixed an issue with JSON options in templates. If you're still using this plugin, can you update the version and see if that works for you? Thanks!
from eleventy-plugin-toc.
This issue is >1y old and should be resolved by prior work. However, if anyone is still having this issue, I'll give a week to comment, then close. Thanks!
from eleventy-plugin-toc.
Related Issues (20)
- clarify documentation HOT 2
- Add ARIA patterns to the wrapper element HOT 1
- Make wrapper element optional
- Nested list is rendered as ol with "ul" option set to true HOT 1
- `TemplateContentRenderError` was thrown > cheerio.load() expects a string HOT 5
- ToC is generated out of order HOT 6
- Use the table of content in another page HOT 3
- Output is escaped HOT 2
- <h2> TOCs rendering, but not <h3> or <h4>
- PluginTOC renders permalink symbol from markdown-it HOT 1
- Allow wrapper to take a function HOT 6
- Position TOC within article content - After first paragraph HOT 1
- Feature request: Ability to append or prepend TOC items
- Add Custom CSS Classes
- Error: filter not found: toc (via Template render error) HOT 1
- Layout.html specific custom anchors
- IDs on headings otherwise it doesn't work HOT 2
- Followed steps but nothing is displaying HOT 11
- HTML entities are not escaped
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 eleventy-plugin-toc.