Export to html while excluding some transclusions

119 views
Skip to first unread message

Louis Davout

unread,
May 3, 2021, 9:35:11 AM5/3/21
to TiddlyWiki

Hi,

I'm wondering if the following is possible either in the base wiki or with a plugin.

Say I have a tag 'Public'. I want to export all tiddlers and only those tiddlers with the tag 'Public'. Simple enough with filter [tag[Public]]. But say some of the 'Public' tiddlers have
transclusions of tiddlers that do not have the 'Public' tag. In my html output I don't want the content of the transclusions included unless transclused tiddler also has the 'Public' tag.

Thanks

Example
topic1 with tag Public
start

{{topic2}}

{{topic3}}

end

topic2 without tag Public
private

topic3 with tag Public
show me

the desired html output
start

show me

end

Jeremy Ruston

unread,
May 3, 2021, 12:55:10 PM5/3/21
to tiddl...@googlegroups.com
Hi Louis

If you're running under Node.js, you could setup two separate wiki folders, one "private" and one "public". Then the private wiki can use the "includeWiki" property to include the tiddlers from the public wiki. When exporting the public content, you'd reference the public wiki, thus excluding all the private content.

Best wishes

Jeremy

--
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/0ddc64cc-58f3-497c-a514-d4d39292b1b9n%40googlegroups.com.

Louis Davout

unread,
Jul 20, 2021, 10:12:28 AM7/20/21
to TiddlyWiki
Jeremy offered a solution that works as advertised - thank you Jeremy. Unfortunately there a 2 pain points with this method and was wondering if there are solutions for those.

1. Over time I want to make some private tiddlers public. Is there currently a means to easily move a tiddler from one wiki to another (in my case both run under node on same machine)? If not, could I create a plugin to do so? What is the basic algorithm or basic things to keep in mind? Is it simply a matter of moving the tiddler file from one directory to another?

2. In order to see any changes made in a tiddler in the public wiki it appears I need to restart the private wiki and refresh the browser if browser is viewing the private wiki. If this is the case, is there a way to at least remotely restart server? In my case, I interact via browser with my wikis from one machine while the wikis run on another machine. Both are behind a firewall and I don't expose either of my wikis to the public. So I'm not too concerned about someone externally restarting my wikis. I could remote desktop, but for reasons, if an alternative exists I'd like to know. I know first-world problems but if this ability already exists, I'd like to take advantage of it.

A completely different alternative solution occurred to me: create a custom command like render but one which doesn't transclude if tiddler to transclude is not public. But looking at the code, I'm not sure I want to go down that rabbit hole.

Thanks.

Soren Bjornstad

unread,
Jul 20, 2021, 5:15:26 PM7/20/21
to TiddlyWiki
For my Zettelkasten, I create a separate wiki every time I build, containing only the tiddlers that are currently public. Transcluding a tiddler that doesn't exist is invisible in the output in TW in most cases, so while you can see in the wikitext that something is referenced, the content is left out within the public wiki. My main build output is a single-file TiddlyWiki, but you could use this as the first step for a static site, too.
Reply all
Reply to author
Forward
0 new messages