Why the macro "timeline Macro (Examples)" from the official documentation doesn't work on my local TiddlyWiki?

144 views
Skip to first unread message

Rafael Oliveira

unread,
Jul 30, 2020, 11:35:56 AM7/30/20
to tiddl...@googlegroups.com
I was checking the timeline Macro (Examples) on the official TW documentation and it works fine there. However, when I import it to my local TiddlyWiki (node.js version) I cannot see anything inside this tiddler. It appears like the following:


Inside it there's the following content:

I understand that in the second sample I need to change the tag subfilter... But it's not showing even the buttons. Am I missing something that I should change to make it work?

Eric Shulman

unread,
Jul 30, 2020, 2:00:46 PM7/30/20
to TiddlyWiki
On Thursday, July 30, 2020 at 8:35:56 AM UTC-7, Rafael Oliveira wrote:
I was checking the timeline Macro (Examples) on the official TW documentation and it works fine there. However, when I import it to my local TiddlyWiki (node.js version) I cannot see anything inside this tiddler.

The official TW documentation uses a set of special macros that make formatting of examples and other documentation content easier.  When you copied an example tiddler to your own document, it no longer has the benefit of the documentation macros.  To view the examples in the tiddler you posted, just remove everything except the parts within the tripled double-quotes.

That is,
<<timeline format:"DD/MM/YYYY">>
and
<<timeline limit:30 subfilter:"tag[Definitions]" format:DD/MM/YYYY">>
As you noted, in the second example, you will still need to change the tag subfilter.

-e

Rafael Oliveira

unread,
Jul 30, 2020, 2:25:54 PM7/30/20
to TiddlyWiki
Ah, I see... It worked now without generating those buttons.  So the $macrocall is a different macro stored in a different tiddler? What would be the procedure to import it to my TW as well so I'll be able to create buttons on my tiddlers as well?

I've tried importing the MacroCallWidget but I don't think that I'm in the right track this time...

Eric Shulman

unread,
Jul 30, 2020, 2:49:52 PM7/30/20
to TiddlyWiki
On Thursday, July 30, 2020 at 11:25:54 AM UTC-7, Rafael Oliveira wrote:
Ah, I see... It worked now without generating those buttons.  So the $macrocall is a different macro stored in a different tiddler? What would be the procedure to import it to my TW as well so I'll be able to create buttons on my tiddlers as well?


The $macrocall is a standard TWCore  widget.  The custom part is the ".example" macro name.   Here's a list of the special Documentation Macros


If you use $:/AdvancedSearch, system tab, and enter "$:/editions/tw5.com", you will find quite a few tiddlers ending in "-macros".

This includes https://tiddlywiki.com/#%24%3A%2Feditions%2Ftw5.com%2Fdoc-macros, which define many (but not all) of the
macros used to format the documentation.

If you import everything from $:/editions/tw5.com, you should then be able to view all the examples in the same way they are
shown when looking at the published documentation directly on tiddlywiki.com

-e

Rafael Oliveira

unread,
Jul 31, 2020, 1:44:26 AM7/31/20
to tiddl...@googlegroups.com
I'm running the official documentation samples now :)

Just one curiosity about how to import tiddlers properly... On the official documentation all the tiddlers in $:/editions/tw5.com are the following:
Screenshot from 2020-07-31 02-28-42.png
















At first I've tried selecting that entire list to drag and drop on my local TW but that plan failed... I dragged and dropped one by one. Is there a smarter way of importing multiple tiddlers at once?

My guess is that I'd need to use the filter option and export the tiddlers in a package. I've got to this filter expression but I didn't manage to figure out how I'd use it in this case... In a javascript perspective I'd imagine something like " ^.*editions/tw5.com.*$". But it doesn't work... Can I use a javascript expression in the filter expression field? And the filter expression option is the right way of exporting a specific group of tiddlers (instead of doing it one by one as I did earlier)?

Eric Shulman

unread,
Jul 31, 2020, 2:57:15 AM7/31/20
to TiddlyWiki
On Thursday, July 30, 2020 at 10:44:26 PM UTC-7, Rafael Oliveira wrote:
I'm running the official documentation samples now :)

Just one curiosity about how to import tiddlers properly... On the official documentation all the tiddlers in $:/editions/tw5.com are the following:

You want to select all of the tiddlers whose titles begin with $:/editions/tw5.com
(there are a few other tiddlers that have "editions/tw5.com" in their title, but you
don't need those)

To select the tiddlers, use the $:/AdvancedSearch, Filters tab, and enter:
[prefix[$:/editions/tw5.com]]

This will return a list of all the desired tiddlers.
Then, use the "export tiddlers" button (the "half box with up arrow") and select "JSON file"
This will download a "tiddlers.json" file to your system.
Then, drag-and-drop that file into your own TiddlyWiki to start the $:/Import process.

-e

Rafael Oliveira

unread,
Jul 31, 2020, 5:55:28 PM7/31/20
to tiddl...@googlegroups.com
Thanks Eric,

I understood that the [prefix[name]] will get all tiddlers that begin with name. Is that right? I've checked this introduction to filter notation on the official documentation and l've seen there's some predefined words that I can use. In my case, I think those filters would be used 99% of the time with the following situations:

1- A search that get all tiddlers that have a specific word inside the title ( In a regular expression it'd be something like "^.*word.*$"). Let's say the name of the tiddler is "create icons on tiddlywiki", if I search the word "icons" it'd appear in the list. The [prefix[]] syntax seems to work only with words that are at the beginning and the [title[]] syntax gets tiddlers exactly as they are. Is there additional syntax that I can use with those prefixes?
2- A way of searching tiddlers that have a specific word inside their body instead of their title. I'm assuming that tiddlywiki already has something like that because when I do a simple search on the main page bar I can see that TW differentiates words in the title from words in the body...
3- A way of searching tiddlers that have a specific word inside their body or title.
4- A way of using the AND logic to filter tiddlers that have two or more words at the same time ( Something like: [prefix[word1]&&[prefix[word2]] )

Are those searches simple to do in TW?

Eric Shulman

unread,
Jul 31, 2020, 6:50:21 PM7/31/20
to tiddl...@googlegroups.com
On Friday, July 31, 2020 at 2:55:28 PM UTC-7, Rafael Oliveira wrote:
1- A search that get all tiddlers that have a specific word inside the title ( In a regular expression it'd be something like "^.*word.*$"). Let's say the name of the tiddler is "create icons on tiddlywiki", if I search the word "icons" it'd appear in the list. The [prefix[]] syntax seems to work only with words that are at the beginning and the [title[]] syntax gets tiddlers exactly as they are. Is there additional syntax that I can use with those prefixes?
[search:title[word]]
 
2- A way of searching tiddlers that have a specific word inside their body instead of their title. I'm assuming that tiddlywiki already has something like that because when I do a simple search on the main page bar I can see that TW differentiates words in the title from words in the body...
[search:text[word]]
 
3- A way of searching tiddlers that have a specific word inside their body or title.
[search:text,title[word]]

4- A way of using the AND logic to filter tiddlers that have two or more words at the same time ( Something like: [prefix[word1]&&[prefix[word2]] )
[search:title[word1]search:title[word2]]

also... for an OR search:
[search:title[word1]] [search:title[word2]]

The basic documentation on the search[] operator is here:

To help you further understand the search[] operator,
I recommend you view my PowerSearch "filter generator", here:

Using this form, you can easily select from various search-related filter options including:
* choose where to search (tiddlers, shadows, system, orphans, etc.)
* match a title prefix and/or suffix
* match a tag value
* choose which fields to search (default is "title, text, tags")
* modify the search using flags (default is "words")
* sorting options (title, created, or modified)
* the actual search term (text to look for)

As you select the options, PowerSearch constructs the corresponding filter syntax for you and shows the results in a multi-column list below
There are also buttons to export or delete all the matching tiddlers, and you can also click on the generated filter syntax to directly copy it
to the clipboard, so you can easily paste it into your own document.

Note: if you want to install the PowerSearch in your own document, just drag-and-drop these two tiddlers:
   TiddlyTools/FilterGenerators/PowerSearch
and
   TiddlyTools/Macros/edit-list

PowerSearch is already tagged with "$:/tags/AdvancedSearch" so it will
automatically be added as an extra tab in the $:/AdvancedSearch tiddler.  This
allows you to get quick access to the form just by clicking the magnifying glass
icon in the standard TiddlyWiki sidebar.

enjoy,
-e

Rafael Oliveira

unread,
Aug 1, 2020, 12:24:03 AM8/1/20
to TiddlyWiki
Wow, this PowerSearch tiddler really simplifies the searches that I can do. It also will help me understand better how to create macros on TW. Thanks for sharing it :)

I got curious about two more things:

1- I was looking inside the PowerSearch code. The part that prints the results is this one:

\define doSearch_showresults()
<blockquote style="overflow-y:auto;max-width:100%;max-height:$(height)$;">
   
<div class="columns$(cols)$ small nowrap">
     
<$list filter=<<filter>>><$link/><br></$list>
   
</div>
</
blockquote>

\end


I'd like to display the created date or modification date on this list as well... I think it's just a matter of finding the right variable, like in:

 <$list filter=<<filter>>><$link/>        <$date><br></$list>

I didn't manage to find the right variable though... On the official documentation  $link is listed as a Widget but I didn't find any other Widget that looks like the creation date or modified date. Can I easily display those dates with my search by modifying that line?

2- Is there any way of showing the highlight syntax of the "TiddlyWiki language" to facilitate its development?

Eric Shulman

unread,
Aug 1, 2020, 1:00:38 AM8/1/20
to TiddlyWiki
On Friday, July 31, 2020 at 9:24:03 PM UTC-7, Rafael Oliveira wrote:
Wow, this PowerSearch tiddler really simplifies the searches that I can do. It also will help me understand better how to create macros on TW. Thanks for sharing it :)

You're welcome!
 
1- I was looking inside the PowerSearch code. The part that prints the results is this one:
\define doSearch_showresults()
<blockquote style="overflow-y:auto;max-width:100%;max-height:$(height)$;">
   
<div class="columns$(cols)$ small nowrap">
     
<$list filter=<<filter>>><$link/><br></$list>
   
</div>
</
blockquote>
\end

I'd like to display the created date or modification date on this list as well... I think it's just a matter of finding the right variable, like in:
 <$list filter=<<filter>>><$link/>        <$date><br></$list>

You're close.

Inside the <$list>...</$list>, the <<currentTiddler>> is set to the value of each tiddler that matches the filter. 

In this context, <$link /> displays a link to the current tiddler.

To show the modified (or created) field, you can use the <$view> widget, like this:
<$list filter=<<filter>>>
   <$link/> <$view field="modified" format="date" template="0MM/0DD/YYYY" />
<br>
</$list>


2- Is there any way of showing the highlight syntax of the "TiddlyWiki language" to facilitate its development?

I'm so used to the TiddlyWiki syntax, that I just use the standard EditTemplate textarea input without any
enhancements.

However, there are a few plugins that replace/enhance the standard textarea input control.  I think that
CodeMirror is perhaps the most fully developed alternative editor plugin for TiddlyWiki... but I don't
know if it does TiddlyWiki syntax highlighting.  There's also the "highlight.js" plugin, which supports
code highlighting "brushes" for many different languages (but not yet for TiddlyWiki syntax).
I think someone has also been working on incorporating a VIM-based editor with support for TiddlyWiki
syntax... but haven't been following that effort very closely, so I'm not sure how far along it is.
Try searching this Google group to find out who is working on it.

-e

Rafael Oliveira

unread,
Aug 2, 2020, 3:19:16 PM8/2/20
to tiddl...@googlegroups.com
Thanks Eric,

I've been playing with your PowerSearch tiddler and it's been really helpful to learn about the search syntax. In the end there's a way of searching for regexp as well :)
Would it be also possible to filter by date instead of just sorting it? I mean, selecting all tiddlers that I've created in a specific year, month or day?

About the highlight syntax, I've actually installed a vim plugin last week thinking it'd somehow display .tid files in a pretty way inside vim. After you mentioned it I realized it was about the TiddlyWiki syntax. It works, for reading and learning how TW syntax works that's good enough for me. On my computer I can use firenvim. :)

Reply all
Reply to author
Forward
Message has been deleted
0 new messages