ExternalizeImages - having trouble

77 views
Skip to first unread message

Ed Heil

unread,
Mar 3, 2020, 11:14:52 PM3/3/20
to TiddlyWiki
Hey, new to tiddlywikis, moderatley obsessed.

I have a wiki with some images in it which I'd like to externalize, so I'm looking at the instructions here --


and I'm not getting them to work.  What I've done --

create a wikifolder to work in.

tiddlywiki --load mywiki.html --savewikifolder folder


I wrote a shell script to run the commands, like this:

#!/bin/bash


tiddlywiki --savetiddlers '[is[image]]' images

tiddlywiki --setfield '[is[image]]' _canonical_uri '$:/core/templates/canonical-uri-external-image' text/plain

tiddlywiki --setfield '[is[image]]' text "" text/plain

tiddlywiki --rendertiddler '$:/core/save/all' externalimages.html text/plain


Figuring I'd need to quote some of those arguments so the shell wouldn't do anything funny with them.

I run it, and it does indeed create a folder named images/ full of images, but it does *not* set the _canonical_uri field of the images, and it does *not* erase the text field of those images (neither in the tiddlers directory, nor the output/externalimages.html file).  

Is there an issue with the way I'm doing it?  It's a pretty vanilla tiddlywiki. The fact that the first part worked fine (save the images) but the rest of it (convert to canonical_uri) didn't work at all confuses me.

(This is on OS X).

Thanks for any help!

Ed Heil

unread,
Mar 3, 2020, 11:33:39 PM3/3/20
to TiddlyWiki
Oh, I thought maybe I should try this with a build target instead of a shell script.

So I looked in the tiddlywiki.com docs for an example of build targets.....  and couldn't find one.

The build *command* is described here -- https://tiddlywiki.com/#BuildCommand  -- but it doesn't talk about how to define build targets....

It refers you to "tiddlywiki folders" here -- https://tiddlywiki.com/#TiddlyWikiFolders "for details of defining build targets."  But there are no details about defining build targets there; build targets are never mentioned.

Under the heading "tiddlywiki.info  Files"  here -- https://tiddlywiki.com/#tiddlywiki.info%20Files  we have the following info:

build - a hashmap of named build targets, each defined by an array of command tokens (see BuildCommand)

Of course, Buildcommand doesn't tell you anything about arrays of command tokens.

I assume from that description, since I know what JSON is and what hashmaps and arrays are, that we're looking for is something like:

{
    "themes": [
        "tiddlywiki/snowwhite",
        "tiddlywiki/vanilla"
    ],
    "build": {
      "externalimages": [
        
      ]
    }
}

where what's in "externalimages" are a list of "command tokens" but "command tokens" are not mentioned anywhere else.

The documentation is pretty unhelpful here.

Ed Heil

unread,
Mar 3, 2020, 11:44:34 PM3/3/20
to TiddlyWiki
Welp, of course, as soon as you ask for help in public, you figure it out yourself.

I was reading this, hoping for info on build targets -- https://www.didaxy.com/exporting-static-sites-from-tiddlywiki-part-2

and I saw that there they were using commands like:

tiddlywiki --rendertiddlers [!is[system]tag[Live]] $:/core/templates/static.tiddler.html static text/plain --rendertiddler $:/core/templates/static.template.css static/static.css text/plain

where you throw a bunch of ---commandline --options onto a single invocation of the "tiddlywiki" command.

That was the problem, of course, and once I got rid of the multiple tiddlywiki commands and combined them all into one it worked!


Message has been deleted

Donald Coates

unread,
Mar 3, 2020, 11:59:48 PM3/3/20
to TiddlyWiki
Just discovered that site myself and it's awesome.  Also check out 'the book' I am finding it very informative even as a wip.  Welcome to the obsession!  External Images were always a bit of a conundrum for me as well.

Ed Heil

unread,
Mar 4, 2020, 12:42:56 AM3/4/20
to tiddl...@googlegroups.com
Oh wow thank you!  Putting that at the top of my reading list!

On Mar 4, 2020, at 12:00 AM, Donald Coates <digit...@gmail.com> wrote:


Just discovered that site myself and it's awesome.  Also check out 'the book' I am finding it very informative even as a wip.  Welcome to the obsession!  External Images were always a bit of a conundrum for me as well.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/wf0bbRZ9vig/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/0288b8a0-79f8-463d-8e50-cc503df41827%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages