Newbie: Tiddlers out of order from Content tiddler structure when exporting to HTML

106 views
Skip to first unread message

Rachel J. Kline

unread,
Jun 18, 2020, 4:05:19 PM6/18/20
to TiddlyWiki
Hi guys,

I have been scouring the message boards, Tiddlywiki's Getting Started resources, and Youtube videos. I'm wondering if I'm making this more complicated than it needs to be. I created my first wiki template using Francis Meetze awesome tutorials. I have my Contents tiddler all set up in the order I would like to present information. Essentially I am using TW to create research reports to send to colleagues.

When I export my template to HTML to test it, all my Tiddlers are out of order. Is there a resource you can point me to for this? Or does anyone have an explanation that breaks down where I'm going wrong? It got a little better once I disabled camel case linking, but there are still tiddlers out of order.

Also- is it possible to export a TW and omit certain tiddlers? For example, if I have a report I'm working on and I have a Task tiddler with "ToDo" and "Completed" nested inside it, would I be able to hide those from the public view of the TW?

For the content layout, could my issue be that I'm exporting without a hosting service? I'm still a little foggy on this aspect as well in terms of sharing my TWs.

I'm using MacOS and TiddlyWiki Desktop.

I appreciate any insights or resources you guys can provide. I just downloaded TW desktop last night, and I've gotten a pretty good handle of it, but some things feel very lost on me yet. Thanks for your understanding!

Saq Imtiaz

unread,
Jun 18, 2020, 4:18:58 PM6/18/20
to TiddlyWiki
Rachel: can you please provide a link to the tutorial you followed?

Can you also explain what process you are following to export to HTML? Both controlling the order and omitting certain tiddlers should be possible, but the details of how depends on how you are exporting.

TW Tones

unread,
Jun 18, 2020, 6:25:59 PM6/18/20
to TiddlyWiki
Rachel,

Welcome to the Tiddlywiki community. A Few Quick pints in relation to tiddlywiki to help you get started
  • Using tiddlywiki to export static webpages is but one of many features, extra popular of late
  • It is capable of far more than that which means all you ask for is possible and much more
  • Also there are other ways to publish tiddlywiki content other than html exports
Finally it is important you know you should feel free to ask for help here, multiple focused posts are fine.
  • Where possible try and describe what you want rather than how it is not working unless you are close to a solution
  • Do share assumptions you have made
  • Provide links to references such as the tutorial, others may not be aware of what you speak, as it is a large community.
Once again, Welcome
Lean on us

Regards
Tony

Rachel J. Kline

unread,
Jun 20, 2020, 12:54:03 AM6/20/20
to TiddlyWiki
Hi Saq!


This link should take you to the full playlist, but the best point of reference for how I built my Contents Tab will but in tutorial #2.

Here's how I would like my reports to be structured, denoting the ( * ) as separate tiddlers:

* Summary
* Objectives
        * Supporting Info 1
        * Supporting Info 2
*Findings
        * Supporting Info 1
        * Supporting Info 2
*Conclusion

I would like to be able to export this Wiki so I can share the link as a finished report directly with colleagues and also be able to bookmark the link on my other devices to reference it.

Ideally, I would also like to do all my note taking/task management inside of one TW. So, when I have a Task tiddler (see tutorial #3 on the playlist linked above), I can keep track of what pieces of information need to be sourced, interviews scheduled, or leads that need to be tracked all in once space. So, that's why I asked about omitting tiddlers from the export, because I don't think my task list would be pertinent to the report. However, I am totally fine making a separate TW for note taking/task management purposes if need be.

And, finally from the desktop when I export my TW I go to the Tools tab on the right hand side and click "export all" giving me the options to choose between CSV file, JSON file, Static HTML, or ".tid" file.

I choose Static HTML and the file saves to my downloads folder. When I click on the file, it opens in my Firefox web browser as a new tab where my tiddlers are then out of order from how I structured them in my Contents tab.

So, I think the best way to condense my questions are:

1) What is the best way to export for my particular sharing needs?
2) Is there a tiddler hierarchy that I can designate to ensure the report reads in the structure I highlighted above?
3) If it can be done, how can I omit tiddlers inside the wiki from the final exported version?

I hope this provides a little more clarity! I apologize for being vague in my first post!

- Rachel

Rachel J. Kline

unread,
Jun 20, 2020, 1:00:08 AM6/20/20
to TiddlyWiki
Hi Tony!

Thank you so much for the advice! I am usually a stickler for concise and accurate communication, so I apologize for being all over the place with my first post!

I responded to Saq above with hopefully what is a clearer picture of what I'm looking to do. I will be looking into other export methods tonight to see if there is a solution to my needs within a particular export channel.

I have seen many comments about how awesome this community is and I appreciate the warm welcome and guidance!

- Rachel

Saq Imtiaz

unread,
Jun 20, 2020, 1:48:42 AM6/20/20
to tiddl...@googlegroups.com
@Rachel good news and bad news situation.

Bad news: The export method you are using, as the name suggests, exports ALL content. It is not in any way related to your Contents tiddler. Think of the Contents tiddler as a means of navigation within your TiddlyWiki. It does not do anything beyond that.

Good news: It is relatively easy to setup your own export method, that only exports what you want and in the format that you want. Either I or someone else should be able to help you with it.

What does the raw wikitext of your Contents tiddler look like? We can try to use that for determining what to export and in what order.

Cheers,

Saq

Rachel J. Kline

unread,
Jun 20, 2020, 7:40:48 AM6/20/20
to TiddlyWiki
Hi Saq!

Oh my gosh- first, thank you for your quick reply and for troubleshooting this with me.

I attached a screenshot of my Contents tiddler and the Contents tab. Would it be possible to only export tiddlers tagged with "Contents"? Now that I'm thinking of it, any tiddlers in the form of "journal entries," or supporting pieces of info in sub-tiddlers, would all be tagged and made accessible in on my Contents tab for me to reference.

If that is a possible option, and omitting the "Tasks/To Do/Completed" tiddlers is not, I could move those to a separate TW. Since my primary objective is exporting in the correct order, I could live without that function.

Thank you!

- Rachel
Screen Shot 2020-06-20 at 7.26.20 AM.png

Saq Imtiaz

unread,
Jun 20, 2020, 8:04:11 AM6/20/20
to TiddlyWiki
@Rachel there are several ways to do this and a lot depends on things like whether you expect to add more top level tiddlers under Contents (like a #6 after 1-5), and whether the hierarchy only goes one level deep or further.

Assuming the structure of the Contents tiddler is fixed and only goes down one level, the following filter will identify your tiddlers:

[[Summary]] [[Summary]tagging[]] [[Objectives]] [[Objectives]tagging[]] [[Findings]] [[Findings]tagging[]] [[Journal]] [tagging[Journal]] [[Conclusion]] [[Conclusion]tagging[]]



If you:
- go to $:/Advanced Search
- Filter tab
- Paste the above filter in
- Click the export button to the right of the input field, and choose Static HTML

you should get the tiddlers you want in the order you want. Confirm the order carefully please. If the order does not correspond to the Contents tab, please clarify if you have done any configuration for the ordering beyond what is shown in the screenshot.

Try that and report back if it works. If it does, it is possible to automate the process so you can export by just clicking a button, and even pickup any new top level items you might add under Contents.
Cheers,

Saq

Eric Shulman

unread,
Jun 20, 2020, 9:13:06 AM6/20/20
to tiddl...@googlegroups.com
On Saturday, June 20, 2020 at 5:04:11 AM UTC-7, Saq Imtiaz wrote:
@Rachel there are several ways to do this and a lot depends on things like whether you expect to add more top level tiddlers under Contents (like a #6 after 1-5), and whether the hierarchy only goes one level deep or further.
Assuming the structure of the Contents tiddler is fixed and only goes down one level, the following filter will identify your tiddlers:

Here's a little macro that will "walk" a TOC tree of any depth and return a flat list of tiddler titles, in the order they occur in the TOC:
\define toc-list(here,exclude,max,level:"1")
<$list filter="""[tag[$here$]] $exclude$ -[[$here$]]""">
   
<$text text="[["/><<currentTiddler>><$text text="]]"/><br>
   
<$reveal default="$level$" type="nomatch" text="$max$">
     
<$macrocall $name="toc-list" here=<<currentTiddler>> max="$max$" exclude="""$exclude$ -[[$here$]]""" level={{{ [[$level$]add[1]] }}}/>
   
</$reveal>
</
$list>
\end

To see the list, starting with a top-level of tiddlers tagged with "Contents", simply write:
<<toc-list here:"Contents">>
* The "exclude" param is automatically calculated internally to prevent infinite recursion if there are any circular references.  It can also be provided as an explicit input parameter in the macro call to prevent specific branches of the tree from being traversed.
* The "max" param is optional and limits the depth of traversal.  It works with the "level" param which is calculated internally to track how deep the traversal has gone.

Thus, if you want to get a list that excludes tiddler tagged as "Task", "ToDo" or "Done", you could write:
<<toc-list here:"Contents" exclude:"-[[Task]] -[[ToDo]] -[[Done]]">>

and if you want to limit the depth to 3, you could write:
<<toc-list here:"Contents" max:"3">>

Of course, this is only the first step in the process of exporting the tiddlers, but it does produce a list in the correct order.  The remaining task is to use this result as input to an export process.

For example, you could produce this list in a tiddler, and then -- as Saq has already suggested, simply copy/paste the result into the $:/AdvancedSearch Filter input field.  Then press the "export" button and choose "static HTML".

It should also be possible to automate those steps so you can just press a button and get the desired output with one click.  I'll fiddle about a bit and see if I can provide a simple bit of button/action syntax that does this.  Right now I'm not feeling very well, so it will have to wait a bit for me to get some rest.

-e


Saq Imtiaz

unread,
Jun 20, 2020, 9:35:51 AM6/20/20
to TiddlyWiki
Brilliant as always, Eric. :)

I wanted to wait and confirm that the order was correct before offering a recursive macro, since the TOC macro does allow customizing the sorting for different branches.

Given your code, a button could look something like this:

<$button>export report
<$wikify name="export-filter" text=<
<toc-list here:"Contents">> >
<$action-sendmessage $message="tm-download-file" $param="$:/core/templates/exporters/StaticRiver" exportFilter=<
<export-filter>> filename="report.html">>/>
</$wikify>
</$button>

Eric Shulman

unread,
Jun 20, 2020, 10:10:06 AM6/20/20
to TiddlyWiki
On Saturday, June 20, 2020 at 6:35:51 AM UTC-7, Saq Imtiaz wrote:
Brilliant as always, Eric. :)

aw shucks, thanks :)
 
I wanted to wait and confirm that the order was correct before offering a recursive macro, since the TOC macro does allow customizing the sorting for different branches.
Given your code, a button could look something like this:
<$button>export report
<$wikify name="export-filter" text=<
<toc-list here:"Contents">> >
<$action-sendmessage $message="tm-download-file" $param="$:/core/templates/exporters/StaticRiver" exportFilter=<
<export-filter>> filename="report.html">>/>
</$wikify>
</$button>
 
Thanks for providing this.  I was going to write something just like it later today, but you saved me the effort!

-e
Reply all
Reply to author
Forward
0 new messages