Generalize Toc related tasks to function with other filetypes#295
Generalize Toc related tasks to function with other filetypes#295lervag merged 4 commits intolervag:masterfrom
Conversation
|
Thanks, this seems very useful! I've been busy lately, but I'll find time to review this as soon as I can! |
|
Sorry for the delay. I made some small adjustments and merged this now. The main changes were:
|
I like this a lot! And I would greatly appreciate your help in realizing it. I will have opinions on how to this should be done, but you probably already know that by now. I think your suggestion looks relevant. I think a first step would be to recognize which options should be considered filetype specific and thus part of the Perhaps we should open a new issue to properly discuss this? |
fixes: #288
PR changes:
WikiTocworks with other filetypesWikiTocGenerateandWikiTocGenerateLocalworks with other filetypesAsciidoc
Asciidoc works without problems with
WikiToc. ForWikiTocGenerate, since asciidoc supports natively table of contents, I've implemented a minimal check that parse the lines between the first level heading and the next heading, and searches for some special keywords that asciidoc can understand. If no first level heading is found, it is created a new one with the name of the file. Then it will append to it the special keywords. It doesn't do anything if it found everything.Showcase
Screen.Recording.2023-04-20.at.23.39.49.mov
Org
Org works without problems with
WikiToc. ForWikiTocGenerateI've tried to make it as compatible as possible with what I've found online, but since his poor standardization outside of Emacs and my ignorance of the filetype I don't think is the best implementation. It will append on top of the file the string#+OPTION toc: g:wiki_toc_depth.Showcase
Screen.Recording.2023-04-20.at.23.47.55.mov
Next Step
If you like the idea I'll open a new issue to discuss the feature. I've in mind to generalise the plugin even more and come to a point were the user need only to specify a directory and a dictionary of filetypes he wants and that's it. In other words having a multi-filetype wiki were if I press enter in a markdown file it create a markdown link and if I am in an asciidoc file it does an asciidoc file.
I was thinking of something like this: