I'm a tad confused about how to add images to the TW - what I'm doing is
making a TW by programmatically (outside the TW and in another programming 
language :-) creating all the necessary tiddlers.

(I'm using the node TW implementation)

I have discovered by trial and error and the help of Mr Google that if I 
have an image
called `joe.jpg` it suffices to drop this into the `tiddlers` sub-directory.
Then I create a file called `joe.jpg.meta` containing the text

```
    title: joe.jpg
    type: image/jpeg
```

When I restart the node TW server the image is available - and can be 
translated into tiddlers with the syntax
`{{joe.jpg}}`

This trick seems to work with PDF and various non-text files.

The available options in the tools menu (import and `new image`) seem to do 
something different. I was wondering if:

# I've made the right files
# this is documented somewhere

Have I stumbled over an undocumented feature that might vanish in the 
future?

Another problem - once my TW is ready I want to publish the result as a 
single file TW so I use the command:

```
$ tiddlywiki <dir> --build index
```

And this makes a single file TW in `<dir>/output/index.html`

Once made, I'd like to unpack the TW and get back the individual tiddlers - 
so I tried this:

```
$ tiddlywiki --load ./share/output/index.html 
  --output ./tmp  
  --render "[!is[system]]" 
  "[encodeuricomponent[]addsuffix[.tid]]" 
  "text/plain" 
  "$:/core/templates/tid-tiddler"
```

Which unpacks the tiddlers into the directory "./tmp" - but now the image 
meta file
`joe.jpg.meta` and `joe.jpg` have vanished a new file `joe.jpg.tid` has 
appeared
which appears to contain the base64 encoded version of the image (I might 
be wrong here)

   What I'd really like is to recover the original input.


   I'd basically like two commands

```
    pack <dir> <twname> and 
    unpack <twname> <dir>
```

That are exact inverses. Pack takes a directory of tiddlers and creates a 
single-file TW. Unpack takes a single-file TW and makes a directory of 
tiddlers *identical* to the original.

The reason for this is I want to write code like this

```
     $ unpack <twname> <dir>
     $ my own code  in my funnt programming langauge that manipulates the 
stuff in <dir>
     $ pack <dir> <twname>
```

I missed the advanced spells course at Hogwarts - so any advice on how to 
write `pack` and `unpack` would be welcome.

Cheers

/Joe
  

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywikidev/f0587fa5-e29b-4e40-823c-c2e08c6a2413%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to