Jermolene / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
7.78k stars 1.16k forks source link

All toc macros should accept current tiddler as default tag parameter #8289

Open springerspandrel opened 1 week ago

springerspandrel commented 1 week ago

Is your feature request related to a problem? Please describe. As noted in this discussion, It would be more consistent with other macros, such as tag macro, if toc macros (the whole family of them) defaulted to showing toc for the current tiddler whenever no parameter is specified. This kind of "toc-starting-here" is convenient in projects where the "home" node for each tags serves as an important (view-template enhanced) hub for information related to that tag. An intuitive view template for this purpose should not need anything more than <<toc>> (or <<toc-selective-expandable>>, etc.) to make a table of contents based on the current location as a tag home.

Describe the solution you'd like This whole family of macros (<<toc>> <<toc-expandable>> <<toc-selective-expandable>> <<toc-tabbed-internal-nav>> <<toc-tabbed-external-nav>>) should all treat the current tiddler as the default tag value, if no parameter is specified.

Describe alternatives you've considered Constructing a macro call with filter language to specify current tiddler as the tag parameter, so that a view template could add a toc within any tiddler which has tag-children. (It's not intuitive, and I wouldn't want to explain it to a beginner! But this should be a beginner-friendly feature to add.)

Jermolene commented 5 days ago

Thanks @springerspandrel that seems reasonable, it is probably one for @pmario

pmario commented 5 days ago

I'll have a closer look