{"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\n<$set name=\"tv-wikilinks\" value=\"no\">\n\t<$transclude tiddler={{{ [<__viewFieldTemplate__>!is[blank]then<__viewFieldTemplate__>else] }}}\n\t\tfield=<<__viewField__>>\n\t>\n\t\t<$view field=\"title\"/>\n\t\n\n\n\\end\n\n\\define tocP-body(tag,exclude,path,field:\"parent\",viewField,itemClassFilter:\"\",sort:\"[sort[]]\")\n\\whitespace trim\n<$let currentTiddler=<<__tag__>> >\n
    \n\t<$list filter=\"\"\"[has<__field__>!has[draft.of]] -[<__tag__>] -[subfilter<__exclude__>] :filter[get<__field__>match<__tag__>] +[subfilter<__sort__>]\"\"\">\n\t\t<$let item=<> 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
  1. >>\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={{{ [get[target]else] }}}>\n\t\t\t\t\t\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\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=<> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<> path=<> field=<<__field__>> viewField=<<__viewField__>>/>\n\t\t\t\t\t
  2. \n\t\t\t\t\n\t\t\t\n\t\t\n\t\n
\n\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\n<$qualify name=\"tocP-state\" title={{{ [[$:/state/tocP]addsuffix<__path__>addsuffix[-]addsuffix] }}}>\n\t<$set name=\"toc-item-class\" filter=<<__itemClassFilter__>> emptyValue=\"toc-item-selected\" value=\"toc-item\">\n\t\t
  • >>\n\t\t<$link to={{{ [get[target]else] }}}>\n\t\t\t<$reveal type=\"nomatch\" stateTitle=<> text=\"open\">\n\t\t\t\t<$button setTitle=<> setTo=\"open\" class=\"tc-btn-invisible tc-popup-keep tc-tiny-gap-right\">\n\t\t\t\t\t<$transclude tiddler=<> />\n\t\t\t\t\n\t\t\t\n\t\t\t<$reveal type=\"match\" stateTitle=<> text=\"open\">\n\t\t\t\t<$button setTitle=<> setTo=\"close\" class=\"tc-btn-invisible tc-popup-keep tc-tiny-gap-right\">\n\t\t\t\t\t<$transclude tiddler=<> />\n\t\t\t\t\n\t\t\t\n\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t\n\t\t<$transclude tiddler=\"$:/config/wikilabs/tocP/newChild\"/>\n\t\t<$reveal type=\"match\" stateTitle=<> text=\"open\">\n\t\t\t<$macrocall $name=\"tocP-expandable\" tag=<> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> viewField=<<__viewField__>> path=<<__path__>> field=<<__field__>>/>\n\t\t\n\t\t
  • \n\t\n\n\\end\n\n\\define tocP-unlinked-expandable-body(tag,exclude,path,field:\"parent\",viewField,itemClassFilter,sort:\"[sort[]]\")\n\\whitespace trim\n\n<$qualify name=\"tocP-state\" title={{{ [[$:/state/tocP]addsuffix<__path__>addsuffix[-]addsuffix] }}}>\n\t<$set name=\"toc-item-class\" filter=<<__itemClassFilter__>> emptyValue=\"toc-item-selected\" value=\"toc-item\">\n\t\t
  • >>\n\t\t\t<$reveal type=\"nomatch\" stateTitle=<> text=\"open\">\n\t\t\t\t<$button setTitle=<> setTo=\"open\" class=\"tc-btn-invisible tc-popup-keep\">\n\t\t\t\t\t<$transclude tiddler=<>/>\n\t\t\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t\t\t\n\t\t\t\n\t\t\t<$reveal type=\"match\" stateTitle=<> text=\"open\">\n\t\t\t\t<$button setTitle=<> setTo=\"close\" class=\"tc-btn-invisible tc-popup-keep tc-tiny-gap-right\">\n\t\t\t\t\t<$transclude tiddler=<> />\n\t\t\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t\t\t\n\t\t\t\n\t\t\t<$transclude tiddler=\"$:/config/wikilabs/tocP/newChild\"/>\n\t\t\t<$reveal type=\"match\" stateTitle=<> text=\"open\">\n\t\t\t\t<$macrocall $name=\"tocP-expandable\" tag=<> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>> field=<<__field__>> viewField=<<__viewField__>>/>\n\t\t\t\n\t\t
  • \n\t\n\n\\end\n\n\\define tocP-expandable-empty-message(viewField)\n<$macrocall $name=\"tocP-linked-expandable-body\" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> field=<<__field__>> viewField=<<__viewField__>> path=<> exclude=<>/>\n\\end\n\n\\define tocP-expandable(tag,exclude,path,field:\"parent\",viewField,viewFieldTemplate,itemClassFilter,sort:\"[sort[]]\")\n\\whitespace trim\n<$let path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}} currentTiddler=<<__tag__>> >\n\t<$set name=\"excluded\" filter=\"[subfilter<__exclude__>] [<__tag__>]\">\n\t\t
      \n\t\t\t<$list filter=\"\"\"[has<__field__>!has[draft.of]] -[<__tag__>] -[subfilter<__exclude__>] :filter[get<__field__>match<__tag__>] +[subfilter<__sort__>]\"\"\">\n\t\t\t\t<$list filter=\"[all[current]toc-link[no]]\" emptyMessage=\"\"\"<$macrocall $name=\"tocP-expandable-empty-message\" viewField=<<__viewField__>>/>\"\"\" >\n\t\t\t\t\t<$macrocall $name=\"tocP-unlinked-expandable-body\" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> viewField=<<__viewField__>> field=<<__field__>> exclude=<> path=<>/>\n\t\t\t\t\n\t\t\t\n\t\t
    \n\t\n\n\\end\n\n\\define tocP-linked-selective-expandable-body(tag,exclude,path,field:\"parent\",viewField,itemClassFilter,sort:\"[sort[]]\")\n\\whitespace trim\n<$qualify name=\"tocP-state\" title={{{ [[$:/state/tocP]addsuffix<__path__>addsuffix[-]addsuffix] }}}>\n\t<$set name=\"toc-item-class\" filter=<<__itemClassFilter__>> emptyValue=\"toc-item-selected\" value=\"toc-item\" >\n\t\t
  • >>\n\t\t\t<$link to={{{ [get[target]else] }}}>\n\t\t\t\t\t<$list filter=\"[has<__field__>] :filter[get<__field__>match<..currentTiddler>] +[limit[1]]\"\n\t\t\t\t\t\tvariable=\"ignore\"\n\t\t\t\t\t\temptyMessage=\"\"\"<$button class='tc-btn-invisible'>{{$:/core/images/blank}}\"\"\"\n\t\t\t\t\t>\n\t\t\t\t\t<$reveal type=\"nomatch\" stateTitle=<> text=\"open\">\n\t\t\t\t\t\t<$button setTitle=<> setTo=\"open\" class=\"tc-btn-invisible tc-popup-keep tc-tiny-gap-right\">\n\t\t\t\t\t\t<$transclude tiddler=<> />\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t<$reveal type=\"match\" stateTitle=<> text=\"open\">\n\t\t\t\t\t\t<$button setTitle=<> setTo=\"close\" class=\"tc-btn-invisible tc-popup-keep tc-tiny-gap-right\">\n\t\t\t\t\t\t\t<$transclude tiddler=<> />\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t\t\n\t\t\t<$transclude tiddler=\"$:/config/wikilabs/tocP/newChild\"/>\n\t\t\t<$reveal type=\"match\" stateTitle=<> text=\"open\">\n\t\t\t\t<$macrocall $name=\"tocP-selective-expandable\" tag=<> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>> field=<<__field__>> viewField=<<__viewField__>>/>\n\t\t\t\n\t\t
  • \n\t\n\n\\end\n\n\\define tocP-unlinked-selective-expandable-body(tag,exclude,path,field:\"parent\",viewField,itemClassFilter,sort:\"[sort[]]\")\n\\whitespace trim\n<$qualify name=\"tocP-state\" title={{{ [[$:/state/tocP]addsuffix<__path__>addsuffix[-]addsuffix] }}}>\n\t<$set name=\"toc-item-class\" filter=<<__itemClassFilter__>> emptyValue=\"toc-item-selected\" value=\"toc-item\">\n\t\t
  • >>\n\t\t\t<$list filter=\"[has<__field__>] :filter[get<__field__>match<..currentTiddler>] +[limit[1]]\"\n\t\t\t\tvariable=\"ignore\"\n\t\t\t\temptyMessage=\"\"\"<$button class='tc-btn-invisible'>{{$:/core/images/blank}}<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\"\"\"\n\t\t\t>\n\t\t\t\t<$reveal type=\"nomatch\" stateTitle=<> text=\"open\">\n\t\t\t\t\t<$button setTitle=<> setTo=\"open\" class=\"tc-btn-invisible tc-popup-keep\">\n\t\t\t\t\t\t<$transclude tiddler=<>/>\n\t\t\t\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t<$reveal type=\"match\" stateTitle=<> text=\"open\">\n\t\t\t\t\t<$button setTitle=<> setTo=\"close\" class=\"tc-btn-invisible tc-popup-keep\">\n\t\t\t\t\t\t<$transclude tiddler=<> />\n\t\t\t\t\t\t<$macrocall $name=\"tocP-viewfield\" viewField=<<__viewField__>>/>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t<$transclude tiddler=\"$:/config/wikilabs/tocP/newChild\"/>\n\t\t\t<$reveal type=\"match\" stateTitle=<> text=\"open\">\n\t\t\t\t<$macrocall $name=\"tocP-selective-expandable\" tag=<> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> exclude=<<__exclude__>> path=<<__path__>> field=<<__field__>> viewField=<<__viewField__>>/>\n\t\t\t\n\t\t
  • \n\t\n\n\\end\n\n\\define tocP-selective-expandable-empty-message(viewField)\n<$macrocall $name=\"tocP-linked-selective-expandable-body\" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> field=<<__field__>> viewField=<<__viewField__>> exclude=<> path=<>/>\n\\end\n\n\\define tocP-selective-expandable(tag,exclude,path,field:\"parent\",viewField,viewFieldTemplate,itemClassFilter,sort:\"[sort[]]\")\n\\whitespace trim\n<$let path={{{ [<__path__>addsuffix[/]addsuffix<__tag__>] }}} currentTiddler=<<__tag__>> >\n\t<$set name=\"excluded\" filter=\"[subfilter<__exclude__>] [<__tag__>]\">\n\t\t
      \n\t\t\t<$list filter=\"\"\"[has<__field__>!has[draft.of]] -[<__tag__>] -[subfilter<__exclude__>] :filter[get<__field__>match<__tag__>] +[subfilter<__sort__>]\"\"\">\n\t\t\t\t<$list filter=\"[all[current]toc-link[no]]\"\n\t\t\t\t\tvariable=\"ignore\"\n\t\t\t\t\temptyMessage=\"\"\"<$macrocall $name=\"tocP-selective-expandable-empty-message\" viewField=<<__viewField__>>/>\"\"\"\n\t\t\t\t>\n\t\t\t\t\t<$macrocall $name=\"tocP-unlinked-selective-expandable-body\" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=<<__itemClassFilter__>> field=<<__field__>> viewField=<<__viewField__>> exclude=<> path=<>/>\n\t\t\t\t\n\t\t\t\n\t\t
    \n\t\n\n\\end\n\n\n\\define tocP-tabbed-external-nav(tag,exclude,path,selectedTiddler:\"$:/temp/tocP/selectedTiddler\",unselectedText,missingText,template:\"\",field:\"parent\",viewField,sort:\"[sort[]]\")\n\\whitespace trim\n<$tiddler tiddler={{{ [<__selectedTiddler__>get[text]] }}}>\n\t
    \n\t\t<$linkcatcher to=<<__selectedTiddler__>>>\n\t\t\t
    \n\t\t\t\t<$macrocall $name=\"tocP-selective-expandable\" tag=<<__tag__>> sort=<<__sort__>> itemClassFilter=\"[all[current]] -[<__selectedTiddler__>get[text]]\" exclude=<<__exclude__>> field=<<__field__>> viewField=<<__viewField__>>/>\n\t\t\t
    \n\t\t\n\t\t
    \n\t\t\t<$reveal stateTitle=<<__selectedTiddler__>> type=\"nomatch\" text=\"\">\n\t\t\t\t<$transclude mode=\"block\" tiddler=<<__template__>>>\n\t\t\t\t\t

    <>

    \n\t\t\t\t\t<$transclude mode=\"block\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t<<__missingText__>>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t<$reveal stateTitle=<<__selectedTiddler__>> type=\"match\" text=\"\">\n\t\t\t\t<<__unselectedText__>>\n\t\t\t\n\t\t
    \n\t
    \n\n\\end\n\n\n\\define tocP-tabbed-internal-nav(tag,exclude,path,selectedTiddler:\"$:/temp/tocP/selectedTiddler\",unselectedText,missingText,template:\"\",field:\"parent\",viewField,sort:\"[sort[]]\")\n\\whitespace trim\n<$linkcatcher to=<<__selectedTiddler__>>>\n\t<$macrocall $name=\"tocP-tabbed-external-nav\" tag=<<__tag__>> sort=<<__sort__>> selectedTiddler=<<__selectedTiddler__>> unselectedText=<<__unselectedText__>> missingText=<<__missingText__>> template=<<__template__>> exclude=<<__exclude__>> field=<<__field__>> viewField=<<__viewField__>>/>\n\n\\end\n"},"$:/plugins/wikilabs/tocP/Stylesheet":{"title":"$:/plugins/wikilabs/tocP/Stylesheet","created":"20170201173552575","modified":"20170201214003877","tags":"$:/tags/Stylesheet","type":"text/css","text":".tc-tabbed-table-of-contents .wltc-btn-new-child {\n display: none;\n}\n\n.tocp .tc-tiddlylink {\n color: green;\n}\n\n/* needed if streams headings are shown */\n\n.tc-toc-caption h1,\n.tc-toc-caption h2,\n.tc-toc-caption h3,\n.tc-toc-caption h4,\n.tc-toc-caption h5,\n.tc-toc-caption h6 {\n display: inline-block;\n}"},"$:/plugins/wikilabs/tocP/toggle-new-child-button":{"title":"$:/plugins/wikilabs/tocP/toggle-new-child-button","created":"20170127145849380","modified":"20170201213725315","tags":"","type":"text/vnd.tiddlywiki","text":"<$button>\n<$action-setfield $tiddler=\"$:/config/wikilabs/tocP/newChild\" text=\"{{||$:/wikilabs/ui/buttons/new-child-alone}}\"/>\nEnable \"New Child\" buttons\n\n<$button>\n<$action-deletetiddler $tiddler=\"$:/config/wikilabs/tocP/newChild\"/>\nDisable \"New Child\" buttons\n"},"$:/wikilabs/images/new-child-alone":{"title":"$:/wikilabs/images/new-child-alone","created":"20170127140027445","modified":"20170201213725304","tags":"","type":"text/vnd.tiddlywiki","text":"\n\t\n\t\n\t\n\n\n"},"$:/wikilabs/ui/buttons/new-child-alone":{"title":"$:/wikilabs/ui/buttons/new-child-alone","caption":"{{$:/wikilabs/images/new-child-alone}} NewChildHere","created":"20170127140235853","description":"NewChildHere & add parent field","modified":"20170202134649899","tags":"$:/tags/ViewToolbar","type":"text/vnd.tiddlywiki","text":"\\define newHereValue()\n$(currentTiddler)$\n\\end\n\n\\define newChildButton(field:\"parent\")\n<$button tooltip=\"\"\"New Child -> \"$field$: $(currentTiddler)$\" \"\"\" aria-label=\"new child here\" class=<>>\n<$action-sendmessage $message=\"tm-new-tiddler\" $field$=<>/>\n<$list filter=\"[prefix[yes]]\">\n{{$:/wikilabs/images/new-child-alone}}\n\n<$list filter=\"[prefix[yes]]\">\n<$text text=\"New Child Here\"/>\n\n\n\\end\n<$macrocall $name=newChildButton field=<> />"},"$:/plugins/wikilabs/tocP/history":{"title":"$:/plugins/wikilabs/tocP/history","text":"V 0.3.2 - 2023.07.01\n\n* Improve \"cooperation\" with streams-plugin\n\nV 0.3.0 - 2023.06.27\n\n''Important'': These macros use a new parameter order\n\n* Add a `viewField` parameter, that will allow us to change the link text\n** defaults to: `caption`\n\n* Add a `viewFieldTemplate` parameter, which works in combination with the `viewField` parameter\n* This will make it possible to work with stream-lists\n\n* Add examples to show, how tocP can work with the \"streams-plugin\" fields\n** tocP can read the streams structure\n** The other way around ''is not possible'' atm, \n*** tocP uses does not use the `stream-list` field. It's not needed\n\nV 0.2.0 - 2023.06.22\n\n* Custom icons can be used for open and closed state\n\n* New \"New Child\" icon. Only 1 toolbar icon is left\n** The second toolbar icon caused confusion anyway\n\n* ''sort'' parameter is a subfilter now\n** ''Important:'' The ''sort'' parameter is ''not'' backwards compatible\n\n* ''exclude'' parameter is a subfilter now\n* Update code based on core TOC macros from TW v5.3.0\n* Plugin is compatible with TW >=v5.2.1\n\nV 0.1.3 - 2020.12.25\n\n* update to TW v5.2.2\n\nV 0.1.2 - 2020.12.25\n\n* update license\n\nV 0.1.1 - 2020.01.19\n\n* Update license link/text\n\nV 0.1.0 - 2017\n\n* improved / fixed tool button tooltips\n* fixed plugin license typo\n* new [[StyleSheet|$:/plugins/wikilabs/tocP/Stylesheet]] setting for `.tocp` class. It sets the default link color to green, which should set it apart from the standard toc\n** This is probably a temporary solution, because it doesn't work for tabbed tocPs\n\n* The \"New Child\" buttons now show a more detailed tooltip\n** The actual \"field-name: value\" pair which will be used to create the new child\n\n* tocP now shows the tooltip field, if available in tiddlers. see [[examples|GettingStarted]] or open [[level-1]] in edit mode"},"$:/plugins/wikilabs/tocP/icon":{"title":"$:/plugins/wikilabs/tocP/icon","text":"\n\n"},"$:/plugins/wikilabs/tocP/license":{"title":"$:/plugins/wikilabs/tocP/license","text":"[[Parent Based TOC Plugin|https://wikilabs.github.io/#edition-tocP]] (c) Mario Pietsch - 2017-2024\n\nhttps://opensource.org/licenses/BSD-3-Clause\n"},"$:/plugins/wikilabs/tocP/readme":{"title":"$:/plugins/wikilabs/tocP/readme","text":"This plugin contains several \"Table of Content\" macros, that have the same parameters as the core toc macro. The main difference is, that it doesn't use tags to create the TOC scructure. It uses a \"parent\" field in so called \"child - tiddlers\".\n\n''Detailed Documentation''\n\nMore details about this plugin can be found at: https://wikilabs.github.io/editions/tocP\nMore plugins, themes and editions can be found at: https://wikilabs.github.io/\n\n''Important''\n\nThese macros are intended to be \"drop in replacement\" of the core macros. ... They have the exact same parameter names. Instead of \"parent\" it still uses \"tag\" as the first parameter. \n\n''Usage''\n\n```\n
    \n<>\n
    \n\n
    \n<>\n
    \n\n
    \n<>\n
    \n\n
    \n<>\n
    \n\n
    \n<>\n
    \n\n
    \n<>\n
    \n\n```\n\n''For Streams .. WIP''\n\n```\n
    \n<$set name=\"tv-wikilinks\" value=\"no\">\n<>\n
    \n```\n\n''streamTextTemplate'': is just a `<$transclude mode=block/>`\n''viewField'': usually needs to be `text` if a template is used\n\n```\n
    \n<$set name=\"tv-wikilinks\" value=\"no\">\n<>\n\n
    \n```\n\n''Simple Configuration''\n\n* Enable / Disable the inline \"New Child\" button\n** {{$:/plugins/wikilabs/tocP/toggle-new-child-button}}\n\n''Known Problems''\n\n* The \"tabbed\" versions don't show the \"New Child\" buttons\n* Color customisation isn't possible atm"}}}