Comments (4)
Don't remember deactivating the discussions tab but it's back now.
Thanks for the describing your use case! This feature sounds like it's out of scope for svelte-toc
though. If the goal is to render anchors for each heading like on the demo site for this component:
then my advice would be to use a markdown/HTML parser that allows customizing the output based on tag. This site uses
mdsvex
with plugins rehype-autolink-headings
and rehype-slug
in svelte.config.js
to do this:
Lines 3 to 30 in b7f6f49
from svelte-toc.
Thanks, @janosh.
I was think that was breaking the bank, as the rehype
has a plugin doing exactly what I need, but unfortunately is broken and not maintained. I need it for animations, so the rehype-slug
will be close, but not enough.
Anyway thanks a lot!
BTW. Is it possible to detect in someway when ToC is turning to be fixed position? My use case is on top of my content currently and can't find a way to move it out at the exact time.
from svelte-toc.
BTW. Is it possible to detect in someway when ToC is turning to be fixed position? My use case is on top of my content currently and can't find a way to move it out at the exact time.
Maybe this helps? https://css-tricks.com/how-to-detect-when-a-sticky-element-gets-pinned
from svelte-toc.
https://css-tricks.com/how-to-detect-when-a-sticky-element-gets-pinned
Thanks again!
from svelte-toc.
Related Issues (20)
- Quick questions HOT 1
- Getting error about resolving `$app/stores` HOT 7
- Strange behaviour HOT 16
- Prevents scroll when using smart zoom on macOS HOT 1
- Component persisting on page change when not required HOT 2
- How do I customize the font-size of each item of the ToC? HOT 4
- New prop for toc nav overflow-y HOT 1
- Component insists on starting at full height above the text HOT 4
- Svelte-toc interferes with other anchor links in the document HOT 9
- [Question]TypeScript support HOT 4
- Is there an option to hide the scrollbar if the ToC doesn't reach certain size? Or just hide in general? HOT 4
- Disable blur initial transition animation HOT 1
- SvelteKit page navigation breaks when svelte-toc is shown HOT 1
- Add option to only show sublevel headings below currently active top-level heading
- Issues with highlighting the correct content HOT 1
- `keepActiveTocItemInView` should be false by default HOT 3
- Hide when intersecting with user-specified DOM nodes
- Add slots for custom ToC items HOT 1
- Add tests
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 svelte-toc.