I excised a snippet to make a tiddler more readable, but won't they add up over time?

144 views
Skip to first unread message

David

unread,
Feb 28, 2020, 9:10:19 AM2/28/20
to TiddlyWiki
I'm a progammer and am seeing if using TiddlyWiki might work well for documenting some of my projects.  It seems so.

I have some SQL code that is a part of one task I'm doing.  I wnated to spawn that code off into another document so that the main one was not cluttered with so much info that wasn't needed very often.  So I used that excise feature to put the SQL code into another tiddler and I left a link to that in the main tiddler.  I like it.

The excised code i named "SQL to get Sample Records". 

Then it occurred to me that if I like this and add a bunch more projects, then that tiddler name is not all that specific, and will probably need to be improved.  If I were in a file system, that sql code might be in its own folder so that such a simple name would be appropriate.

So what do you guys do for TiddlyWiki?  In a way, these Tiddler names make it so that everything is, in essence, in one folder. 

I guess I need to perhaps make the name more specific, with a prefix that resembles the name of the project or task.

Instead of "SQL to get Sample Records"
Maybe "Customer Design Change 2020 Feb - SQL to get Sample Records", though long and clumsy, is a tiddler name that will be better as more and more projects get documented in my TW.

does that sounds like the best way to go?
What are you guys doing in this kind of scenario?

Eric Shulman

unread,
Feb 28, 2020, 10:18:26 AM2/28/20
to TiddlyWiki
On Friday, February 28, 2020 at 6:10:19 AM UTC-8, David wrote:
Then it occurred to me that if I like this and add a bunch more projects, then that tiddler name is not all that specific, and will probably need to be improved.  If I were in a file system, that sql code might be in its own folder so that such a simple name would be appropriate.
So what do you guys do for TiddlyWiki?  In a way, these Tiddler names make it so that everything is, in essence, in one folder.  
I guess I need to perhaps make the name more specific, with a prefix that resembles the name of the project or task.

While everything is, as you say, "in one folder", you can use the "/" character within a tiddler title to add a suffix that simulates a folder naming convention.

Thus, if you have a tiddler named "TiddlerA", and you want a related tiddler to be "Example", but want to ensure a unique tiddler title (so that you can create other Example tiddlers in the future), you could name the related tiddler as "TiddlerA/Example".  Similarly, if you wanted a related tiddler for writing "Notes" about TiddlerA, you could name that tiddler "TiddlerA/Notes".  This has the advantage that, when listed alphabetically, all the related tiddlers are grouped together, like this:

TiddlerA
TiddlerA/Example
TiddlerA/Notes
TiddlerA/References
etc.

Of course, there are many other strategies for naming and differentiating tiddlers, but the above works nicely for many use-cases.  In fact, you can see this approach to tiddler names if you examine the list of TWCore "shadow" tiddlers (in the sidebar tabs, select "More" and then "Shadows" to see the list).  There are nearly 2000 (!) shadow tiddlers, grouped by purpose or function using names that contain "/" characters.

You can also view these tiddlers in a *simulated* directory hierarchy using the "More>Explore" sidebar tab.  This tab takes each name and chops it up into pieces based on the the "/" character, and then generates a "folder tree" that shows each level of tiddlers *as if* it were a folder even though the tiddlers actually include the full path in their titles.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)



Mark S.

unread,
Feb 28, 2020, 10:44:18 AM2/28/20
to TiddlyWiki
Link anxiety is the main reason I use links so infrequently. Unfortunately, in TW a title is both a unique
identifier and a title. When you're putting documentation together, you don't want to spend 10 minutes
just making sure you've got a title that will survive the ravages of time.

Most other wiki-type products have some way of tracking and maintaining links, so that you don't
accidentally create orphaned links.

Flibble's Relink plugin can help reduce link anxiety:


It can find and rename your standard text links and transclusions, which frees you to get back to thinking
about your documentation, rather than your naming structure. To be honest, I haven't used it much, but
so far it seems pretty solid.

On Friday, February 28, 2020 at 6:10:19 AM UTC-8, David wrote:

David

unread,
Feb 28, 2020, 2:13:29 PM2/28/20
to TiddlyWiki

On Friday, February 28, 2020 at 10:18:26 AM UTC-5, Eric Shulman wrote:
You can also view these tiddlers in a *simulated* directory hierarchy using the "More>Explore" sidebar tab.  This tab takes each name and chops it up into pieces based on the the "/" character, and then generates a "folder tree" that shows each level of tiddlers *as if* it were a folder even though the tiddlers actually include the full path in their titles.

Thanks for that reply!  Very helpful!

But one thing about the above info about Explore... When I look at that folder tree, it only shows me pages starting with "$:/" and does not include the "normal" pages/tiddlers that I created.

Eric Shulman

unread,
Feb 28, 2020, 3:46:56 PM2/28/20
to TiddlyWiki
On Friday, February 28, 2020 at 11:13:29 AM UTC-8, David wrote:
But one thing about the above info about Explore... When I look at that folder tree, it only shows me pages starting with "$:/" and does not include the "normal" pages/tiddlers that I created.

The Explore tab ($:/core/ui/MoreSideBar/Explorer) is actually generated using: 
<<tree "$:/">>

and the <<tree>> macro ($:/core/macros/tree) definition has default parameters:
\define tree(prefix: "$:/",separator: "/")

Unfortunately, this means that although you can invoke the <<tree>> macro with a different value for the prefix (and separator), e.g.,
<<tree "something">>
there isn't a way to specify a blank prefix (e.g., <<tree "">>), since any blank parameter value will result in the default parameter value ("$:/") being used.

To get the results you want, you will need to make a small change in $:/core/macros/tree by removing the default parameter value, like this:
\define tree(prefix: "",separator: "/")

This won't affect the sidebar More>Explorer output, since that explicitly uses <<tree "$:/">>, as noted above.  With this single change, you can then write:
<<tree>>
to get a complete tree view of ALL tiddlers in the document.

-e








TonyM

unread,
Feb 28, 2020, 5:06:54 PM2/28/20
to TiddlyWiki
David,

Sometimes using the metaphor of folders is very helpful. If you look into how the $:/ and core tiddlers are named you can see how you can structure tiddlers.

It is quite east to choose what I and others call a namespace eg; $:/config or your own $:/database or $:/excerpt than construct a new tiddler name $:/excerpt/$(currentTiddler)$ in a macro, so there is another unique tiddler $:/excerpt/tiddlername for each tiddler if you want. The lookup operator can help you find it or add and remove prefix operators allow you to quickly locate matching tiddlers in these different namespaces. You could excise text into $:/subtiddlers/tiddlername/excisename for example.

Of course there is an issue when you rename tiddlers, but there are ways to address this, including a Serial number method I plan to publish after another plugin I am developing.

Feel free to discuss further

Regards
Tony

David

unread,
Mar 2, 2020, 9:02:59 AM3/2/20
to TiddlyWiki
This tree macro is excellent!  Thank you!

I can use it to create a tree structure of my projects easily. 

Something that comes to mind... is there a way to specify in that macro not to show a specific tag?

That would be helpful when a project is complete and I don't need to have it clutter up my "active projects" tree any more. 

Maybe I could tag it "archive" or "complete" and have the tree macro not show those records?  I'm guessing a tag might be the most flexible way to make this kind of annotation.  It would be a chore, I imagine, to rename all the files with "/archive/" in the project path to make them seem to move into a different folder.

Mat

unread,
Mar 2, 2020, 11:04:24 AM3/2/20
to TiddlyWiki
Eric Shulman wrote:
To get the results you want, you will need to make a small change in $:/core/macros/tree by removing the default parameter value, like this:
\define tree(prefix: "",separator: "/")

Care to make a PR? Or is there any particular reason to keep that macro less general?

<:-)

Donald Coates

unread,
Mar 3, 2020, 8:07:01 PM3/3/20
to TiddlyWiki
I have been having a lot of fun with the tiddlywiki.files file used in conjunction with customizing tiddler names to read tiddlers in subdirectories and place tiddlers that have specific tags/fields in those directories.  I use this to keep tiddlers separated for any number of reasons like maybe I will want to put all of them in their own tiddlywiki some day.  Maybe this will be useful to you as well.  I know you DB people like to keep stuff super organized.  ;p
Reply all
Reply to author
Forward
0 new messages