Is there any way to download TiddlyWiki documentation as a PDF?

775 views
Skip to first unread message

tam

unread,
May 27, 2019, 12:52:11 PM5/27/19
to TiddlyWiki
I am planning to spend a bit of time learning how to use TiddlyWiki in more depth and I have tried to get the documentation in a PDF format.

At first I thought it would be easy - just "Export all" as static HTML then convert to a PDF. Of course this gives me all the tiddlers in alphabetical order. This is not much good to me, ideally I would need them to be in roughly the order they appear in the contents menu of tiddlywiki.com.

Is there anyway to do this? (I'm guessing probably not).

Thanks!

@TiddlyTweeter

unread,
May 27, 2019, 1:02:30 PM5/27/19
to TiddlyWiki
But its a very good question!

Mat

unread,
May 27, 2019, 2:19:14 PM5/27/19
to TiddlyWiki
I'd say no because TW is non-linear.

But it is a very interesting question. There is definitely need for linearity sometimes, even pretty often. I recently made a proposal for compound tiddlers but for your case it would be more relevant with something that traverses through a tree, i.e the ToC contents menu, and opens each tiddler. That should be doable but I'm afraid I don't have the time right now. Still hope this info was of any value.

<:-)

Mark S.

unread,
May 27, 2019, 2:25:42 PM5/27/19
to TiddlyWiki
Here's a kit. The rest is left as an exerceise ....

If you export from the advanced search, tiddlers export in whatever order
your filter uses.

Do you have PDF software to put chunks of PDF documents together? I'll
assume so for the moment.

You can open all the documents in the table of contents, then use the
"Tiddlers in the storyriver" from the advanced search dropdown choices.
Then export to static html.

So how do you open all those tiddlers?

Here's some code to open the tiddlers starting with "HelloThere" . For this
to work right, you need to first go into control pane, settings, "Tiddler
Opening Behaviour", and set it to "Bottom".

\define swear(yourit)
<$action-navigate $to="""$yourit$"""/>
<$list filter="""[tag[$yourit$]]""" variable="imit" >
<$macrocall $name=swear yourit=<<imit>>/>
</$list>
\end
<$button>Action<br/>
<$macrocall $name=swear yourit="HelloThere"/>
</$button>

Once you've exported, close other tiddlers, change "HelloThere" to the next
menu item (e.g. "Learning"), and repeat. There's only about a dozen
top-level entries.

If you're really brave, you could change "HelloThere" to "TableOfContents",
but I suspect that opening all the tiddlers at once will crash your
browser. If it worked, it would allow you to do this without separate steps.

There may be other tiddlers that are not part of the table of contents
tree. You can figure out which of those are important and export separately.

Good luck!

On Monday, May 27, 2019 at 9:52:11 AM UTC-7, tam wrote:
>
> I am planning to spend a bit of time learning how to use TiddlyWiki in
> more depth and I have tried to get the documentation

> <https://tiddlywiki.com/>in a PDF format.


>
> At first I thought it would be easy - just "Export all" as static HTML
> then convert to a PDF. Of course this gives me all the tiddlers in
> alphabetical order. This is not much good to me, ideally I would need them

> to be in *roughly* the order they appear in the contents menu of

@TiddlyTweeter

unread,
May 27, 2019, 2:26:04 PM5/27/19
to TiddlyWiki
The very fact its so complex is pause for thought, I think?

I never realised.

SylvainComte

unread,
May 27, 2019, 2:54:59 PM5/27/19
to TiddlyWiki
You may just transclude all tiddlers in one single tiddler with something like

<$list filter=[all[tiddlers]]>

!! {{!!title}}

{{}}
</$list>

And then export the tiddler.

It will be very messy and some print styling is recommended.

You may also get inspiration with TiddlyPac : I made a modification of viewtemplate with a recursive macro included (sorry it's in French). Be careful with recursions.

https://know-rmandie.frama.io/TiddlyPAC/tiddlyPAC-Normandie.html#%24%3A%2Fcore%2Fui%2FViewTemplate%2Fbody:%24%3A%2Fcore%2Fui%2FViewTemplate%2Fbody%20%24%3A%2Fpac%2FmacroChapitre%20%5B%5BPorter%20%C3%A0%20Connaissance%5D%5D

You may also work on an adaptation of toc macro https://tiddlywiki.com/#%24%3A%2Fcore%2Fmacros%2Ftoc

Change toc-caption to include text transclusion

\define toc-caption()
<$set name="tv-wikilinks" value="no">
<$transclude field="caption">
<$view field="title"/>
</$transclude>

<$transclude field="text" />

</$set>
\end

Hope this may help

Sylvain
@sycom

@TiddlyTweeter

unread,
May 27, 2019, 3:15:10 PM5/27/19
to tiddl...@googlegroups.com
"Just" here is doing a lot of work! :-)

What happens if the user needs to read the docs in order to understand how to make them?

A Catch 22. How can they know how to make the document without the document that explains it being made they need to make? :--) I'm semi-serious.

Best wishes
Josiah

TonyM

unread,
May 27, 2019, 9:13:24 PM5/27/19
to TiddlyWiki
Hi Tam,

It is interesting to read your request. Tell us more how/where you will use the resulting PDF?

As Mat points out TiddlyWiki.com is non-linear, it is not a book, it makes full use of an interactive table of contents, search and optional paths. This is better organised that any PDF can be. I have actually built a version of TiddlyWiki.com for the new user but it includes the ability to take notes and more.

Unless you plan to print your PDF can I ask where will you read your PDF that you can't instead open the tiddlywiki itself? If you want to read everything in a wiki, perhaps a button to tag each read tiddler with a "read" tag.

Sticking to your original request.
If we come up with a good solution, perhaps others will also use this, not just for tiddlywiki.com.

Ideally if we could export it to pdf with the chapter headings in the contents of the pdf and then use the search within pdf it may be almost as easy to read it in pdf. This may actually be possible by generating a HTML tiddler/file with the correct use of headings and sections etc... and feeding this into a good html to PDF converter.

But this could need lots of work, but it could be a worthwhile investment as it would be a way to publish the content of TiddlyWiki as a book, and some authors may want this. With careful design the one wiki could contain both the draft and revised versions of a book.

Quick and easy
The quick and easy way is to create a tiddler which transcludes all the content you want to package in your PDF, open that tiddler in a new window and use the browsers print function to print to PDF (assuming you have installed a "print to pdf" printer). Note however to do the whole TableOfContents can be a disaster. see Transcluding the content you want to package in your PDF

Transcluding the content you want to package in your PDF
Mark and Sylvain address this in this thread, but the idea of say using the TableOfContents to generate this view may be compromised by some loops, ie a lower tiddler referencing a higher tiddler, resulting in a loop.

I have a design pattern I am keen to explore that iterates the whole Table of Contents (TOC) adding a branch field to each tiddler, that contains the path from the Top of the TOC to the current tiddler. If you come to the same tiddler and it already contains a branch then a reference to the tiddler in its branch is given to stop any infinite loops, and repeating content. The Branch could be use as bread crumbs as well. We could also use the kin operator to list all tiddlers not in the TOC as appendices.

So I am working on this now.

Regards
Tony

bimlas

unread,
May 28, 2019, 2:15:53 AM5/28/19
to TiddlyWiki
A possible solution is to install Kin filter (https://bimlas.gitlab.io/tw5-kin-filter/) on https://tiddlywiki.com/ wiki, create a new tiddler with the following content

<$list filter="[[TableOfContents]kin::to[]first[5]]">

  ! <$view field="title"/>

  <$transclude field="text"/>

</$list>

Since the Kin filter is not used as a filter here, but as a generator (blank braces), it lists the tiddlers in the order of the crawl. The order roughly covers the order of the table of contents (It travels in depth first of all), for example:

TableOfContents
About
Acknowledgements
Contributors
History of TiddlyWiki
License
Releases
AlphaReleases
BetaReleases
TiddlyDesktop Releases
TiddlyWiki Releases
TiddlyWiki5 Versioning
RoadMap
Community

vivaldi_2019-05-28_08-13-40.png


Open the print dialog (usually Ctrl-P) and the destination "printer" should be the PDF format (available in Chrome for example).

In this example, it only export the first 5 tiddlers (because of `first[5]`), because displaying all the tiddlers takes a lot of time (not sure that it works at all). 


bimlas

unread,
May 28, 2019, 2:25:08 AM5/28/19
to TiddlyWiki
Note: If you first edit TableOfContents tiddler, the tiddlers will appear in the same order as they appear in the table of contents: just add the 'sort[]' parameter:

<div class="tc-table-of-contents">

<<toc-selective-expandable 'TableOfContents' 'sort[]'>>

</div>

vivaldi_2019-05-28_08-24-31.png


TonyM

unread,
May 28, 2019, 3:24:11 AM5/28/19
to TiddlyWiki
Folks,

I have built a Linear Table Of Contents that appears in a single tiddlywiki, such as it would create a single tiddler with the content from the Table Of Contents. Its working well, but It fails due to the size of tiddlywiki.com (offline copy).

I can list all the titles but if I transclude the content for each tiddler on clicking "done, the result is never displayed. The Wiki seems to freezes, and closing the browser the only option.

I wonder if there are some settings that would allow it to work.

Regards
Tony

SylvainComte

unread,
May 28, 2019, 10:28:25 AM5/28/19
to tiddl...@googlegroups.com
Hello,

Maybe spliting it in sub-chapters ?

I did hack the toc macro to make a book macro. freezes the browser tab when using the whole wiki (<<book TableOfContents>>)... But not if I uses book macro for each first level chapter (see TiddlyWiki-Book.tid). I don't know why...

It's a bit raw out of the box and needs a lot polishing but works (see example attached - note i'm behind a proxy firewall so a lot of external ressources are blocked) - nearly 900 pages!!! Had to put this on a sharing partner (available only 7 days and 100 downloads. Be fast! ;-) : https://send.firefox.com/download/f2b11c6f0dcc233b/#bL4F1OBL1gib8gYiQnbnaA (edit : with the corrected macro, "only" 140 pages)

You may play with it by yourself : get the "book.tid" macro and the "TiddlyWiki-Book.tid" tiddlers in your own copy.

cheers

Sylvain
@sycom
bookMacro.tid
TiddlyWiki-Book.tid

SylvainComte

unread,
May 28, 2019, 10:48:39 AM5/28/19
to TiddlyWiki
Mmmhhh

sorry, I discovered a very annoying typo in previous send. I did edit the post, but for those using email here is the good versions for the .tid's and .pdf (only140 pages now...)

cheers

Sylvain
@sycom


Le mardi 28 mai 2019 16:28:25 UTC+2, SylvainComte a écrit :
Hello,

Maybe spliting it in sub-chapters ?

I did hack the toc macro to make a book macro. freezes the browser tab when using the whole wiki (<<book TableOfContents>>)... But not if I uses book macro for each first level chapter (see TiddlyWiki-Book.tid). I don't know why...

It's a bit raw out of the box and needs a lot polishing but works (see example attached - note i'm behind a proxy firewall so a lot of external ressources are blocked) - nearly 900 pages!!! Had to put this on a sharing partner (available only 7 days and 100 downloads. Be fast! ;-) : https://send.firefox.com/download/f2b11c6f0dcc233b/#bL4F1OBL1gib8gYiQnbnaA

bookMacro.tid
TiddlyWiki-Book.tid

Jeremy Ruston

unread,
May 28, 2019, 2:47:45 PM5/28/19
to tiddl...@googlegroups.com
Hi Sylvain

I did hack the toc macro to make a book macro. freezes the browser tab when using the whole wiki (<<book TableOfContents>>)... But not if I uses book macro for each first level chapter (see TiddlyWiki-Book.tid). I don't know why…

It would be interesting if you could try your hacked doc macro on the latest prerelease that incorporates a number of performance optimisations to the indexing performed by the core:


The indexing optimisations are described in more detail here:


It’ll be interesting to see if you get any improvements, and to use the recent improvements to the performance instrumentation to help identify the specific filters that need improvement:


Best wishes

Jeremy


It's a bit raw out of the box and needs a lot polishing but works (see example attached - note i'm behind a proxy firewall so a lot of external ressources are blocked) - nearly 900 pages!!! Had to put this on a sharing partner (available only 7 days and 100 downloads. Be fast! ;-) : https://send.firefox.com/download/285dc36d71cf93d7/#Gj_WNWkdrRULJb6HUkOe5A

--
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 post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/33b16758-88c6-46b6-853a-da7bc62c9103%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<bookMacro.tid><TiddlyWiki-Book.tid>

TonyM

unread,
May 28, 2019, 7:29:03 PM5/28/19
to TiddlyWiki
Tam,

I will also look at Jeremy's suggestion but I have attached a PDF of one section of tiddlwiki.com as an example. To hasten your request I can send you a pdf for each high level section if you want, but I would like to automate it further and use jeremys suggestions.


Regards
Tony

On Tuesday, May 28, 2019 at 2:52:11 AM UTC+10, tam wrote:
Learning.pdf

SylvainComte

unread,
May 29, 2019, 6:35:10 AM5/29/19
to TiddlyWiki
Hi Jeremy and all,

I've updated the "book" macro (which is a very bad name) that have been made too fast. It now works for full tiddlywiki.com. I tried it in both 5.1.19 and 5.1.20 prerelease and did not notice difference (about 10 seconds on my machine which is not a race beast). I did not make real instrumented tests though...

It appears that previous version of my macro was not really recursive (fixing the typos also killed this propertie). Now it works and <<book TableOfContents>> will deliver the full wiki in one Tiddler with sort of hierarchical classfication : "!!title" of a sub-chapter will be in lower level of heading than is parent, but included titles will keep up their hierarchical level. So if you have a "! Some title" in the text of a tiddler, it will remain "h1" even if the tiddler is sub-chapter of a sub-chapter and has a "h3" title...

I can now confirm that whole tiddlywiki.com is about 900 pages long !!

Attached the "book" macro for players and putted the pdf on firefox send for Tam (and 99 other people who like long readings ;-)

Also, dealing with the toc macro, I noticed a <<__variable__>> notation that I didn't met before and which seems to stand for $(variable)$. Is this documented anywhere? are there differences?

regards,

Sylvain
@sycom
Hi Sylvain

To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.
bookMacro.tid

Jeremy Ruston

unread,
May 29, 2019, 8:38:10 AM5/29/19
to tiddl...@googlegroups.com
Hi Sylvain


On 29 May 2019, at 11:35, SylvainComte <sylvai...@gmail.com> wrote:


Also, dealing with the toc macro, I noticed a <<__variable__>> notation that I didn't met before and which seems to stand for $(variable)$. Is this documented anywhere? are there differences?

The double underscore syntax for referencing macro parameters was introduced in v5.1.16:

https://tiddlywiki.com#Macro%20Definitions%20in%20WikiText

Adding double underscores to a parameter name allows one to refer to the parameter as a variable, instead of the value being inserted via textual substitution. That makes it much easier to deal with issues where a parameter contains e.g. a double quote.

The old way:

\define mymacro(text)
<$text text="$text$"/>
\end

<<mymacro Text>> --> this works

<<mymacro 'Te"xt'>> --> this doesn't work because of the double quote

The new way:

\define mymacro(text)
<$text text=<<__text__>>/>
\end

<<mymacro Text>> --> this works

<<mymacro 'Te"xt'>> --> this now works too

There are still situations where textual substitution is required, but it’s generally better to use the new double underscore syntax when possible, just to avoid these troubling edge cases where things stop working in the presence of innocuous characters.

Best wishes

Jeremy

tam

unread,
May 30, 2019, 2:54:44 PM5/30/19
to tiddl...@googlegroups.com
Thank you Sylvain, Tony and all! This is fantastic, I hope it is useful to many other people as well.

It is interesting to read your request. Tell us more how/where you will use the resulting PDF?

Hi Tony. I have recently started using Polar Bookshelf to manage most of my non-fiction reading. I believe it is partly inspired by the idea of incremental reading, which I thought was kind of interesting. The reasons I would choose to read TiddlyWiki.com in Polar instead are:

1. I can keep track of what I have and haven't read. Polar allows you to mark what you have read as you go and extract relevant information and convert it into Anki flashcards.

2. I want to keep as much of my reading in the same place as possible. Polar is designed to help you read multiple books at once, and it is easier to keep track of what I am reading if it is all in one repository.

This is better organised that any PDF can be.

I completely agree.

I have actually built a version of TiddlyWiki.com for the new user but it includes the ability to take notes and more.

This sounds cool - have you made it available anywhere?

If you want to read everything in a wiki, perhaps a button to tag each read tiddler with a "read" tag.

I can't believe I didn't think of this. It makes my 1st reason kind of irrelevant. I think I would also find it useful to tag sections that I didn't understand to go back to later, and probably a bunch of other useful stuff.

TonyM

unread,
May 30, 2019, 7:49:17 PM5/30/19
to TiddlyWiki
  • Tam,
I am glad you have found some answers, this is a great community. Do you have anything to do with the "Productivity Show" by chance?

Did you look at my sample PDF? I added visible checkboxes for read and understood. These check boxes work when in tiddlywiki to tag the underlying tiddler. I will share my Macro if you want to harvest it for ideas.

I think if documents are already broken down into pieces such as the tiddlywiki.com documentation there is a good argument to keep it there and use both the non-linear and interactive features and the linear features of a consolidated view link the macros discussed in this thread. The advantage of tagging the individual tiddlers is if you arrive at a tiddler via the TableOfContents or The Linear Presentation or due to some other organising method you can see at an instant if you have read and understood it.


Hi Tony. I have recently started using Polar Bookshelf to manage most of my non-fiction reading. I believe it is partly inspired by the idea of incremental reading, which I thought was kind of interesting. The reasons I would choose to read TiddlyWiki.com in Polar instead are:

Not withstanding the above Polar looks like a great solution, I wonder if its ability to harvest from HTML is you best method to go from TiddlyWiki to Polar?. I will look into that app in more detail but it looks like a real find. I already use a great tool Foxit Reader (Independant from FireFox) which has great annotation features as well. I generate Invoices through the foxit printer and stamp it with foxit reader as PAID when appropriate. However I have also used it to fill in PDF forms that are broken but foxit can still annotate and save changes on the PDF.

Here is my Linear TOC, Which is now part of my Learning TiddlyWiki Edition

\define branch-depth() <$text text={{{ [enlist<branch>count[]] }}}/>
\define append-branch() $(branch)$ [[$(currentTiddler)$]]
\define branch-heading()
<h2>__[[$(currentTiddler)$]]__</h2>
/
/{{{ [all[current]get[caption]addprefix[Caption: ]] }}}//
\end
\define branch-breadcrumbs()
   
<p><small>:<$list filter="""[enlist<branch>]""" variable=tiddlername><$link to=<<tiddlername>> > > <$text text=<<tiddlername>>/> </$link></$list> (<<branch-depth>>)</small></p>
\end
\define sub-toc()
<small><<list-links filter:"[all[current]tagging[]]">></small>
\end
\define read-understand-checkboxes()   <$checkbox field="read" checked="yes" unchecked="no" default="no"> <small>Read</small></$checkbox> <$checkbox field="understood" checked="yes" unchecked="no" default="no"> <small>Understood</small></$checkbox>
\define tiddler-content()
   
<div style="border-style: none; background-color: #ffffe6; padding: 15px">
       
<$transclude tiddler="$(currentTiddler)$" mode="block"/>
   
</div>
\end
\define each-tiddler()
<$set name=branch value=<<append-branch>> >
    <<branch-heading>>
    <<branch-breadcrumbs>>
    <<sub-toc>>
    <<tiddler-content>>
    <<read-understand-checkboxes>>
  <$list filter="[<currentTiddler>tagging[]]">
     <<each-tiddler>>
   </
$list>
</$set>
\end
\define all-in-toc(roottiddler:"TableOfContents")
<$set name=branch value="[[$roottiddler$]]">
<$set name=roottiddler value="""[[$roottiddler$]]""">
<$tiddler tiddler="$roottiddler$">
    <<branch-heading>>
    <<sub-toc>>
<$list filter="[[$roottiddler$]tagging[]]">
  <<each-tiddler>>
</
$list>
</$tiddler>
</
$set>
</$set>
\end
<style>
@media print {
  h2 {page-break-before: always;}
}
</
style>
<<all-in-toc "Learning">>

Note: the above has the recursive process used to iterate a whole tree, and it will/may fail starting at TabeOfContents - for now it is set to the "Learning" Tiddler.

This sounds cool - have you made it available anywhere? 

I thought I had published it before, but perhaps not. I have placed it here http://tiddlywiki.psat.com.au/learn/ For now you will need to download it and make it your own.
In the near future (release of 5.1.20) I plan to
  • Allow commenting online
  • Allow saving status and annotations online
  • Provide the ability to save your own changes/annotations online to json file in case you loose your local temporary storage.
  • Add more content and guidelines.
Regards
Tony
Reply all
Reply to author
Forward
0 new messages