-
-
Notifications
You must be signed in to change notification settings - Fork 981
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabsets don't appear in ToC #1336
Comments
Just came across this. Making sure it doesn't get forgotten 🚀 |
Any solution to this? |
I am using rmarkdown v1.16 and knitr v1.25. I am experiencing the same behavior as the above reported question. Have there been any updates to this? |
@atusy this is great ! However, tabpanel is trickier as I don't think the toc will allow to navigate in the headers that are inside the tabbed panel. In my case it doesn't. Does it work for you ? |
@cderv You are right. My trick just shows ToC whose links are out of order. We need one (?) more trick by JS! Thanks for your help. |
I also think this should be looked into after #1260 when bootstrap upgrade is done because it will change some things. Maybe bs4 will also help with this. |
the stackoverflow link didn't work for me so i'm definitely still waiting for a solution for this! the previous sort-of workaround without navigation is better than nothing though so thanks @atusy |
I made some hacks. With files below, you can navigate to tabsets from floating ToC. https://gist.github.com/atusy/4b076cc084d9e920b34d6d25f85e5176 |
I think the above trick needs lots more improvements which is still difficult for me. Alternatively, I implemented the feature in Feed backs are welcome! |
What are the improvement to be made ? What makes it more difficult to support here than in minidown ? Great package by the way ! There are a lot of great feature in your |
Tow major difficulties are:
Anyway, let's draft and discuss the PR.
Thanks a lot! I'm so glad to hear it!! |
Is it likely that this feature will be implemented? I have a template that builds on |
Sorry, I have no ideas... |
Is this likely to ever get fixed given the shift to Quarto by ... Posit? It's pretty old at this point! It still seems to be relevant, i.e for RMD to html output, when My desire for this to work is based on being a fan of in-document folding and similar structures. Complex documents are better when they allow complexity hiding. Part of that involves support for hierarchical content and interactive reading. A "tabset" might not be the best way to do that, but I'm not aware of other simple alternatives. |
Sorry, but I'm afraid that this issue looks so complicated that there may not be much hope to get it resolved. It shouldn't have been so complicated if we kept the JS dependencies simple and lightweight from the beginning... Last year, I wrote some simple JS code to generate tabsets: https://yihui.org/en/2023/10/section-tabsets/ In theory, it can be used on any HTML page, but unfortunately, rmarkdown is a hairball to some extent that's hard to untangle (#2084). In particular, currently there's no way to disable tabsets, otherwise you could use my JS code to generate tabsets and the headings should appear in TOC as expected. I totally understand the value of in-document folding. If you also happen to be a fan of minimalism like myself (which I think is unlikely to most people), you may consider joining my new adventure, namely litedown. Below is a an example: ---
title: Hello World
output:
litedown::html_format:
meta:
css: ["@default", "@article", "@tabsets"]
js: ["@tabsets", "@sidenotes"]
options:
toc: true
knit: litedown:::knit
---
# My header {.tabset}
## Tab 1
### subheader 1
### subheader 2
## Tab 2
### subheader 3
### subheader 4 |
It appears that when headers are put in tabset format, they don't appear in the table of contents.
Even stranger : when there are subheaders inside the tabsets, these will appear in the toc, but there will be no separation or distinction between the subheaders of different tabs
The text was updated successfully, but these errors were encountered: