Recently Eric Shulman shared a very impressive tool which can be used for authoring!
It can create an outliner, a feature (outlining) quite necessary in long writings like novels, theses, project reports,...It is a smart designed Table of Contents (TOC) generator.
It not only generates a flexible table of content, but also generate its TOC as an outliner.
Recently Eric Shulman shared a very impressive tool which can be used for authoring!It can create an outliner, a feature (outlining) quite necessary in long writings like novels, theses, project reports,...It is a smart designed Table of Contents (TOC) generator.
and much more ...
\define toc-list(here,exclude)
<$list filter="""[title[$here$]tagging[]] $exclude$ -[[$here$]]""">
<$link/><br>
<$macrocall $name="toc-list" here=<<currentTiddler>> exclude="""$exclude$ -[[$here$]]"""/>
</$list>
\end
My point? WRITE in what is easiest. PUBLISH through TW which is about the most flexible tool around for organisation and search.Good as it is, TiddlyToolmap would be a MUCH more useful resource in TW.
\define toc-list(here,exclude)
<$list filter="""[title[$here$]tagging[]] $exclude$ -[[$here$]]""">
<$text text="[["/><<currentTiddler>><$text text="]]"/>
<$macrocall $name="toc-list" here=<<currentTiddler>> exclude="""$exclude$ -[[$here$]]"""/>
</$list>
\end
I changed toc-list as belowIt seems now it handles tiddlers with space in their title.
\define toc-list(here,exclude)
<$list filter="""[title[$here$]tagging[]] $exclude$ -[[$here$]]""">
<$text text="[["/><<currentTiddler>><$text text="]]"/>
<$macrocall $name="toc-list" here=<<currentTiddler>> exclude="""$exclude$ -[[$here$]]"""/>
</$list>
\endPlease have a look and confirm if this is the right solution!
-e
By default TiddlyBook uses "sequential reader" interface that lets one steps through all the TOC items or all tiddlers.How one can have this interface on those tiddlers only existed in TOC not all tiddlers?
<$list filter="[<currentTiddler>!tag[bookcover]!is[system]]">
<div class="hideForPrint">
@@.floatleft {{TiddlyBook/Popups/Chapters}} @@
@@.floatright {{TiddlyBook/Popups/Appendix}} @@
<div style="text-align:center;white-space:nowrap">
<$wikify name="all" text="""<$macrocall $name="toc-list" here={{TiddlyBook/RootTag}} />""">
<$vars first={{{ [enlist<all>first[]] }}}>
<$vars prev={{{ [enlist<all>before<currentTiddler>] ~[<first>] }}}>
<$vars next={{{ [enlist<all>after<currentTiddler>] ~[<first>] }}}>
<$list filter=<<prev>>>
<span class="tt-navbar-button">
<$link tooltip=<<toc-caption>>>{{$:/core/images/chevron-left}}</$link>
</span>
</$list>
<$list filter=<<next>>>
<div style="display:inline-block;">
@@.smaller ''//next topic://''<br>@@
@@.largest <$link>''<<toc-caption>>''</$link>@@
</div>
<span class="tt-navbar-button">
<$link tooltip=<<toc-caption>>>{{$:/core/images/chevron-right}}</$link>
</span>
</$list>
</$vars>
</$vars>
</$vars>
</$wikify>
</div>
@@.clear @@
</div>
</$list>
<$vars first={{{ [enlist<all>first[]] }}}>
<$vars NO_first={{{ [enlist<all>first[]] }}}>
My point? WRITE in what is easiest. PUBLISH through TW which is about the most flexible tool around for organisation and search.Good as it is, TiddlyToolmap would be a MUCH more useful resource in TW.
What would TW bring to the table, for this particular application? You can search it, view it, toggle sections, filter by tags, etc. (except there are none -- but there could be if desired).That conversion step between writing and publishing would get tedious, whereas it's instantaneous in TiddlyToolmap.
Now the flexible TOC generator works fine and its outliner is really helpful.My question is how to improve the performance?
[title[$here$]tagging[]]
[tag[$here$]]
\define toc-show-item()
<span class="authortools">
<$droppable actions=<<toc-item-drop>>>
<div class="tc-droppable-placeholder tt-toc-placeholder"></div>
<$draggable tiddler=<<item>> startactions=<<toc-item-dragstart>> endactions=<<toc-item-dragend>> dragimagetype="blank">
<div title="drag to rearrange items">
{{$(item)$||$(toc-template)$}}
</div>
</$draggable>
<div class="tc-droppable-placeholder tt-toc-placeholder"><<toc-item-dragtip>></div>
</$droppable>
</span>
\end
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/91af8f40-822e-486e-8989-25686554b94a%40googlegroups.com.
Am I doing something wrong? I still get double entries in the TOC and the arrow buttons don't show up: http://els-toc.tiddlyspot.com/Thinking I might have some other custom stylesheets or similar that interfered, I also tried it on a completely new and empty TW, but same results.
Hi Mat,Overload toc-show-item with the below one!
You have not authortools and readertools!
--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/116023d7-f73c-481d-b184-30a0fc10d04e%40googlegroups.com.
In any of toc macro is there any simple way to restrict the number of levels?
One minor tweak still to be done for <<toc-tree>>:when the 'max' level is reached, if more levels are present for that item it will still show an open/close arrow.Even so, toggling this arrow will NOT show any more levels.
I think "hiding" information, for performance reasons, without a clear and visible info isn't best practice. So as a user I would expect to get some info, that there are more levels, but I'm not able to see them. As a second step I would demand a possibility to see everything.
Consider the following possible use-case:Suppose I have a "primary" TOC tree that has 3 levels that might represent product categories/sub-categories, navigating down to individual products entries. Then, clicking a product entry opens a separate tiddler that has it's own "secondary" TOC tree with product-specific levels such as "description", "specifications", "reviews", "images", etc.
I can also imagine having a input control to enter the "max" level to be shown in the "primary" tree so that you could easily change from "show the top 3 levels" to "show all levels", simply by clearing the input value.
I have prepared a summary on Eric TOC Tools with a simple installation.This is for people like to give a try or use Eric flexible TOC and outliner in their real work.I hope Eric confirm if the procedure given below is correct.Regarding the license I assume it is open source, but Eric himself will explain.
The Eric TOC tools is a set of macros, templates, and stylesheets to create flexible table of contents by Eric Shulman.
It can create an outliner, a feature (outlining) quite necessary in long writings like novels, theses, project reports,...
It is a smart designed Table of Contents (TOC) generator.
It not only generates a flexible table of content, but also generates its TOC as an outliner.
With the outliner, you can see in a single glance the overall status of your contents (book, report, ...). See how contents (sections, chapters, ...) are organised. See which character appear in which scene. Quickly rearrange things. Write notes for each item as you keep the big picture in view.
- It is possible to drag'n drop a tiddler title from the river into the TOC (outliner)
- It uses $:/HistoryList!!currenttiddler to highlight the most recently opened tiddler
- It can exclude items and multiple branches in the TOC
- It can switch between author mode and reader mode (in reader mode one cannot edit the TOC)
- It uses a local window on hover lets you create new item and new branch
- It uses a local window on hover lets you create new item and new branch
- It has toc-list macro, a simple recursion, that returns the entire TOC contents as a simple list of tiddlers
- It has a ViewTemplate addition that uses the toc-list output to present next/previous buttons to provide a "sequential reader" interface that lets you step through all the TOC items, one at a time.
[prefix[TiddlyTools/TOC]] [[TiddlyTools/ReadOnly/Stylesheet]]
[[TiddlyTools/ReadOnly]] [[TiddlyTools/NavBar/Bottom]]
Thanks for clarification!I will delete my original post here and this one (your reply) will remain for readers!So, people should consider this right protected and can be used with Permission.
The feature rich solutions are valuable like Eric's but the do it yourself code patterns can reduce the need to maintain feature rich solutions.
How often do we need all the features?
just thoughts for consideration.
Tony
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] +[append<actionTiddler>putbefore<item>]" />
On Saturday, January 25, 2020 at 3:26:21 AM UTC-8, Mohammad wrote:
Recently Eric Shulman shared a very impressive tool which can be used for authoring!
It can create an outliner, a feature (outlining) quite necessary in long writings like novels, theses, project reports,...It is a smart designed Table of Contents (TOC) generator.
and much more ...
In the "much more" category, see http://tiddlytools.com/InsideTW/#TiddlyTools%2FNavBar%2FBottom* <<toc-list>> (defined in TiddlyTools/TOC/Macros) is a VERY simple recursion, that returns the entire TOC contents as a simple list of tiddlers
\define toc-list(here,exclude)
<$list filter="""[title[$here$]tagging[]] $exclude$ -[[$here$]]""">
<$link/><br>
<$macrocall $name="toc-list" here=<<currentTiddler>> exclude="""$exclude$ -[[$here$]]"""/>
</$list>
\end
* TiddlyTools/NavBar/Bottom is a ViewTemplate addition that uses the <<toc-list>> output to present next/previous buttons to provide a "sequential reader" interface that lets you step through all the TOC items, one at a time.enjoy,-e
Further input: It seems append does not work with tiddler have space in their name and it needs to get the input using double brackets when there is a space in title.
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] +[append<actionTiddler>putbefore<item>]" />
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>] +[putbefore<item>]" />
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>] +[putafter<item>]" />
<$set name="order" filter="[<item>tagging[]]">
<$list filter=<<order>>> <$action-deletefield $field="list-before"/> <$action-deletefield $field="list-after"/> </$list>
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-[<oldtag>] [<item>]" />
<$action-listops $tiddler=<<oldtag>> $field="list" $subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<item>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>]" />
</$set>
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] +[insertbefore:item<actionTiddler>]" />
On Monday, February 24, 2020 at 11:04:02 AM UTC-8, Mohammad wrote:Further input: It seems append does not work with tiddler have space in their name and it needs to get the input using double brackets when there is a space in title.Instead of using:
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] +[append<actionTiddler>putbefore<item>]" />TiddlyTools/TOC now uses:
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>] +[putbefore<item>]" />This avoids the use of the "append" filter (which expects a space separated list) and instead, just explicitly appends the actionTiddler at the end, then moves it into positionSimilarly, when using "shift drop" (drop after), it now does:
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>] +[putafter<item>]" />Also, I added handling to "ctrl drop" (drop into) so it works like the other handlers and builds the full "order" while removing any "list-before" or "list-after" fields on the individual entries:
<$set name="order" filter="[<item>tagging[]]">
<$list filter=<<order>>> <$action-deletefield $field="list-before"/> <$action-deletefield $field="list-after"/> </$list>
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-[<oldtag>] [<item>]" />
<$action-listops $tiddler=<<oldtag>> $field="list" $subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<item>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>]" />
</$set>
With these code tweaks, TiddlyTools/TOC now handles drag-and-drop of tiddlers with spaces in their titles.Thank for all your help testing the various edge cases for TiddlyTools/TOC.
enjoy,-e
* root
** child1
*** gchild1
*** gchild2
** child2
** child3
\define toc-item-dragdata() $:/temp/TOC/dragdata\define toc-item-dragdata-path() $:/temp/TOC/dragdata/path\define toc-item-dragstart() <$action-setfield $tiddler=<<toc-item-dragdata>> text=<<actionTiddler>> /><$action-setfield $tiddler=<<toc-item-dragdata-path>> text=<<path>> />\end
\define toc-item-drop()<$reveal default=<<actionTiddler>> type="nomatch" text=<<item>>> <!-- DON'T DROP ON SELF --> <!-- get OLDTAG and NEWTAG, exclude special TiddlyBook tags --> <$vars sourcetags={{{ [<actionTiddler>get[tags]] }}} sourcepath={{{ [<toc-item-dragdata-path>get[text]] }}} targettags={{{ [<item>get[tags]] }}}> <$vars oldtag={{{ [<sourcepath>split[/]]-[<actionTiddler>]+[last[]] }}} newtag={{{ [enlist<targettags>!enlist<toc-ignore-tags>] }}}> ......
.....
One more question:I confused with drag and drop when there are more than a tag! (I mean an entry in the TOC tree has more than one tags)Example:
* root
** child1
*** gchild1
*** gchild2
** child2
** child3they have a hierarchy and create a tree.Now assume gchild2 not only tagged with child1 but also tagged with foo and bar!Then I tried to drag and drop gchild2 over child3 (no modifier) I see gchild2 remains under child1 branch and also appears before child3 (gets the root tag as expected)Is there any limitation here, or I made a mistake?--Mohammad
\define toc-item-dragdata() $:/temp/TOC/dragdata
\define toc-item-dragdata-path() $:/temp/TOC/dragdata/path
\define toc-item-dragstart()
<$action-setfield $tiddler=<<toc-item-dragdata>> text=<<actionTiddler>> />
<$action-setfield $tiddler=<<toc-item-dragdata-path>> text=<<path>> />
\end
\define toc-item-dragend()
<$action-deletetiddler $tiddler=<<toc-item-dragdata>> />
<$action-deletetiddler $tiddler=<<toc-item-dragdata-path>> />
\end
\define toc-item-drop()
<$reveal default=<<actionTiddler>> type="nomatch" text=<<item>>> <!-- DON'T DROP ON SELF -->
<!-- get OLDTAG and NEWTAG, exclude special TiddlyBook tags -->
<$vars sourcepath={{{ [<toc-item-dragdata-path>get[text]] }}}
targetpath=<<path>> >
<$vars oldtag= {{{ [<sourcepath>split[/]]-[<actionTiddler>]+[last[]] }}}
newtag={{{ [<targetpath>split[/]]-[<item>]+[last[]] }}}>
<$reveal default=<<modifier>> type="match" text="normal"> <!-- DROP BEFORE SIBLING -->
<$set name="order" filter="[<newtag>tagging[]]">
<$list filter=<<order>>> <$action-deletefield $field="list-before"/> <$action-deletefield $field="list-after"/> </$list>
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-[<oldtag>] [<newtag>]" />
<$action-listops $tiddler=<<oldtag>> $field="list" $subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>] +[putbefore<item>]" />
</$set>
</$reveal>
<$reveal default=<<modifier>> type="match" text="shift"> <!-- DROP AFTER SIBLING -->
<$set name="order" filter="[<newtag>tagging[]]">
<$list filter=<<order>>> <$action-deletefield $field="list-before"/> <$action-deletefield $field="list-after"/> </$list>
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-[<oldtag>] [<newtag>]" />
<$action-listops $tiddler=<<oldtag>> $field="list" $subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<newtag>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>] +[putafter<item>]" />
</$set>
</$reveal>
<$reveal default=<<modifier>> type="match" text="ctrl"> <!-- DROP AS CHILD -->
<$set name="order" filter="[<item>tagging[]]">
<$list filter=<<order>>> <$action-deletefield $field="list-before"/> <$action-deletefield $field="list-after"/> </$list>
<$action-listops $tiddler=<<actionTiddler>> $field="tags" $subfilter="-[<oldtag>] [<item>]" />
<$action-listops $tiddler=<<oldtag>> $field="list" $subfilter="-[<actionTiddler>]" />
<$action-listops $tiddler=<<item>> $field="list" $subfilter="[enlist<order>] -[<actionTiddler>] [<actionTiddler>]" />
</$set>
</$reveal>
</$vars>
</$vars>
</$reveal>
\end