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
Add support for a table of contents #51
Comments
Yes I think this would be simple to implement, I'll look into it within a few days/weeks |
Hi @kura |
@Linbreux sure thing, I'll give it a whirl this afternoon and report back. |
Ok, I have a couple of notes:
All I did to make these tweaks was;
|
hi @kura Thanks for the fast and detailed review and tests, really appreciate it!
Yes I also think h1 should be in the TOC!
Yes completely agree! I just made this really quick to see if this was something that would work.
This should be possible, maybe in the config file, or should it be document specific?
Yes I'm aware of this, but thanks for noting ;)
Yes that would be possible, maybe an option for
I will change it to an unordered list. The margin at the bottom is indeed way to much. I don't know if I like the underline text decoration, I think this is a little outdated. This could also be available in a custom css file. |
No problem. I've been looking forward to this feature a for while, some of my documents are pretty large to try and scroll through without a ToC.
I can't think of a reason I'd ever want it to be different in different documents so in the config file seems very reasonable to me.
Also seems like a very reasonable solution to me.
That's fair, although all other links in the wiki pages use the old school link styling of being blue and underlined. :D |
^^ haha yes, that's also something I need to change :) |
@Linbreux just FYI I've started poking the ToC branch. I've managed to make it a little bit faster and am working on switching it over to nested unordered lists. |
@kura Alright! My work was more like a draft to see if it was possible to create a full macro system. Optimization was not yet on my radar, so I'm glad you improved it already! |
@Linbreux that's fair. I gained most of the performance benefits by switching the macro detection and parsing out to a single compiled REGEX and changed it to only run one of the macro classes if a matching macro exists. I tried to get pandoc to do the ToC generation too since |
@kura I also tried that once in the passed, but didn't got it to work. I'm also curious if it's easy to generate an indented unordered list with bs4 ;) |
@Linbreux commented on 7 Sept 2022, 21:39 UTC:
My approach to this was iterators, basically iterate until the header level changes, if the level increases then assign a ul to the previous element and continue iteration. Stepping up and down levels as necessary. |
Any updates on this? |
@adamwojt commented on 20 Sept 2022, 17:19 UTC:
Some of the discussion around this has also happened in a sort of unrelated discussion about replacing pandoc, one of the options for the replacement would come with a |
I tried doing this with Pandoc and no matter the approach it did not work.
I would welcome any input on getting it working with Pandoc though.
- K
…On 1 Dec 2022, 22:16 +0000, Dhruva Sambrani ***@***.***>, wrote:
@kura does it make sense to add a custom pandoc command option so that people can add whatever changes they want easily? Obviously, this would go against the grain of #70, but I am a huge fan of pandoc and would instead prefer to use the full power of it.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I would like to be able to insert a table of contents in some pages, ideally with some macro like
[toc]
. Would this be a possible future addition.The text was updated successfully, but these errors were encountered: