-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Work In Progress - Toc v5.3.x rewrite #7961
Draft
pmario
wants to merge
88
commits into
TiddlyWiki:master
Choose a base branch
from
pmario:toc-v5.3.x-rewrite
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+2,578
−235
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\function makeTocState() [[$:/state/toc]addsuffix<__path__>addsuffix[/]addsuffix<currentTiddler>] <$qualify name="toc-state" title=<<makeTocState>> >
…de less error prone
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
The existing "Table-of-Contents Macros" tiddler got an overhaul, to make it more consistent and easier to understand |
…e using more functions
… restructuring for better readability
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was created to create a Vercel Preview
All TOC-macros Rewritten
The toc-macro now use toc-include, toc-filter and toc-hide fields as discussed at Talk:
Initial discussion at Talk (Part1)
CTRL-click Chevron Expands / Folds Tree Branches
Advantage: If everything is expanded, a "normal" click only fold the "current" branch
New Node Fields
New tiddler fields allow the new macros to have fine-grained control over toc branches on a "per node" / "per branch" level.
toc-filter
toc-filter
, that filter will replace the standard filter that normally creates the "child list" of that node.[tag<currentTidder>!has[draft.of]]
if you do not want to list draft-tiddlers[all[shadows+tiddlers]tag<tag>!has[draft.of]$(sort)$]
where the last element is a text-substitution of the sort parameter of the toc macro.toc-include
toc-hide
:and[prefix[todo]]
... all accumulated tiddlers prefixedtodo
will be removed:and
filter-run-prefix, the filter[prefix[todo]]
is equivalent to[all[tiddlers]prefix[todo]]
toc-itemTemplate
text
All titlelists of filters added to the new fields are internally evaluated using
[subfilter[tf.toc-*]]
The field names used are defined with global variables. So for expert users, they can be overwritten like this.
New Macro Parameters
captionField (default: caption)
tagField
parentField
itemTemplate
toc-defaultItemTemplate
procedure, which is specific to toc-macrostext
toc-itemTemplate
field is set in the current node it will take precedence over the macro parameterThe new fields should work with every toc-* macro.
Test Styles are part of the JSON test-suite linked below ;)
Requested (but not implemented yet) features from Part-1:
$:/config/toc/
currentTidder configuration to allow "per node" parameter change, whithout "touching" a user-created tocTest Data
The JSON attachment contains some
test-*
tiddlers that I use for testing atm. They are chaotic, but contain a bit of info and some linkstoc-include
dtoc-filter
edJSON file can be found at: https://talk.tiddlywiki.org/t/toc-macros-rewritten-a-lot-of-new-fuctionality-part-2/9071?u=pmario