1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-04 23:39:57 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/$__plugins_wikilabs_tocP.json

1 line
23 KiB
JSON
Raw Normal View History

{"tiddlers":{"$:/plugins/wikilabs/tocP/macros":{"title":"$:/plugins/wikilabs/tocP/macros","created":"20170127103951869","modified":"20170202134116229","tags":"$:/tags/Macro","type":"text/vnd.tiddlywiki","text":"\\define tocP-open-icon() $:/core/images/down-arrow\n\\define tocP-closed-icon() $:/core/images/right-arrow\n\n\\define tocP-viewfield(viewField:\"caption\")\n\\whitespace trim\n<span class=\"tc-toc-caption\" title={{!!tooltip}}>\n<$set name=\"tv-wikilinks\" value=\"no\">\n\t<$transclude tiddler={{{ [<__viewFieldTemplate__>!is[blank]then<__viewFieldTemplate__>else<currentTiddler>] }}}\n\t\tfield=<<__viewField__>>\n\t>\n\t\t<$view field=\"title\"/>\n\t</$transclude>\n</$set>\n</span>\n\\end\n\n\\define tocP-body(tag,exclude,path,field:\"parent\",viewField,itemClassFilter:\"\",sort:\"[sort[]]\")\n\\whitespace trim\n<$let currentTiddler=<<__tag__>> >\n<ol class=\"tc-tocP\">\n\t<$list filter=\"\"\"[has<__field__>!has[draft.of]] -[<__tag__>] -[subfilter<__exclude__>] :filter[get<__field__>match<__tag__>] +[subfilter<__sort__>]\"\"\">\n\t\t<$let item=<<currentTiddler>> path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}}>\n\t\t\t<$set name=\"excluded\" filter=\"[subfilter<__exclude__>] [<__tag__>]\">\n\t\t\t\t<$set name=\"toc-item-class\" filter=<<__itemClassFilter__>> emptyValue=\"toc-item-selected\" value=\"toc-item\">\n\t\t\t\t\t<li class=<<toc-item-class>>>\n\t\t\t\t\t\t<$list variable=\"ignore\" filter=\"[all[current]!toc-link[no]]\" emptyMessage=\"\"\"<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\"\"\">\n\t\t\t\t\t\t\t<$link to={{{ [<item>get[target]else<item>] }}}>\n\t\t\t\t\t\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t\t\t\t\t\t</$link>\n\t\t\t\t\t\t</$list>\n\t\t\t\t\t\t<$transclude tiddler=\"$:/config/wikilabs/tocP/newChild\"/>\n\t\t\t\t\t\t<$macrocall $name=\"tocP-body\" tag=<<item>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<excluded>> path=<<path>> field=<<__field__>> viewField=<<__viewField__>>/>\n\t\t\t\t\t</li>\n\t\t\t\t</$set>\n\t\t\t</$set>\n\t\t</$let>\n\t</$list>\n</ol>\n</$let>\n\\end\n\n\\define tocP(tag,exclude,path,field,viewField,viewFieldTemplate,itemClassFilter,sort:\"[sort[]]\")\n<$macrocall $name=\"tocP-body\" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> field=<<__field__>> viewField=<<__viewField__>>/>\n\\end\n\n\\define tocP-linked-expandable-body(tag,exclude,path,field:\"parent\",viewField,itemClassFilter,sort:\"[sort[]]\")\n\\whitespace trim\n<!-- helper function -->\n<$qualify name=\"tocP-state\" title={{{ [[$:/state/tocP]addsuffix<__path__>addsuffix[-]addsuffix<currentTiddler>] }}}>\n\t<$set name=\"toc-item-class\" filter=<<__itemClassFilter__>> emptyValue=\"toc-item-selected\" value=\"toc-item\">\n\t\t<li class=<<toc-item-class>>>\n\t\t<$link to={{{ [<currentTiddler>get[target]else<currentTiddler>] }}}>\n\t\t\t<$reveal type=\"nomatch\" stateTitle=<<tocP-state>> text=\"open\">\n\t\t\t\t<$button setTitle=<<tocP-state>> setTo=\"open\" class=\"tc-btn-invisible tc-popup-keep tc-tiny-gap-right\">\n\t\t\t\t\t<$transclude tiddler=<<tocP-closed-icon>> />\n\t\t\t\t</$button>\n\t\t\t</$reveal>\n\t\t\t<$reveal type=\"match\" stateTitle=<<tocP-state>> text=\"open\">\n\t\t\t\t<$button setTitle=<<tocP-state>> setTo=\"close\" class=\"tc-btn-invisible tc-popup-keep tc-tiny-gap-right\">\n\t\t\t\t\t<$transclude tiddler=<<tocP-open-icon>> />\n\t\t\t\t</$button>\n\t\t\t</$reveal>\n\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t</$link>\n\t\t<$transclude tiddler=\"$:/config/wikilabs/tocP/newChild\"/>\n\t\t<$reveal type=\"match\" stateTitle=<<tocP-state>> text=\"open\">\n\t\t\t<$macrocall $name=\"tocP-expandable\" tag=<<currentTiddler>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> viewField=<<__viewField__>> path=<<__path__>> field=<<__field__>>/>\n\t\t</$reveal>\n\t\t</li>\n\t</$set>\n</$qualify>\n\\end\n\n\\define tocP-unlinked-expandable-body(tag,exclude,path,field:\"parent\",viewField,itemClassFilter,s