New to Tiddlywiki and I need help (.html ??)

100 views
Skip to first unread message

mohamed messai

unread,
Jan 26, 2021, 4:10:48 PM1/26/21
to TiddlyWiki
So i started Working with my professor on Tiddlywiki and i found it quite interesting. Now i m working on an automatic generated Tiddlywiki project from  a Java project . So all the informations i need to build my Tiddlywiki is in the Java File and my professor told me he wants all those informations to be generated automatically in a Tiddlywiki at first i just make .tid files for each tiddler and i thought i was done but he wanted me to write on an Empty tiddlywiki file (Empty.html) that way when the java program is executed it writes on the the File Empty.html  (as if it is a .txt file )but it didn't work and i only write at the end of the html code .i can't find anything to help me out or where exactly should i write or how to write it  other than that i have no knowledge of html or js which made this one near impossible task  , please guys i need your help i'm already running late and i have no idea what to do .

TW Tones

unread,
Jan 26, 2021, 6:42:19 PM1/26/21
to TiddlyWiki
Hi,

I am not totally clear on the objective of the task, but tiddlywiki itself uses a process to save an empty file. If you follow how this works on Tiddlywiki.com starting with the download empty button you can see it uses a template and within that a filter determines which tiddlers to download and their format, any tiddlywiki can generate an empty.html file. This can also be done via commands in NodeJS. One feature exports the Javascript separately rather than a single file. This template effectively encodes the way to save a whole wiki, thus arguably contains all the logic needed. 

It is best to use tiddlywiki itself to load tiddlers into it, be it the node or single file wikis importing tiddlers.  If you take the completely manual approach to edit the html you need to understand precisely the tiddler format (that's trivial)  and where entries are to be stored in the html file. You will also see in the html file the tiddlers are stored in one place but they are often referenced by name in other parts only detail knowledge of the tiddlywiki structure can answer how and if you need to do more to add tiddlers directly.

I hope others can provide more info, but I hope this helps somewhat.

Tones

Álvaro

unread,
Jan 26, 2021, 6:56:02 PM1/26/21
to TiddlyWiki
Hi,

This type of information is usually in tiddlywiki.com/dev/

I think that you need this-> https://tiddlywiki.com/dev/#Data-Storage

Joshua Fontany

unread,
Jan 26, 2021, 7:00:33 PM1/26/21
to TiddlyWiki
You need to structure the directory correctly so that the tiddlywiki node.js process understands your commands.

Write all your tiddlers & a "tiddlywiki.info" file (json format) as below:
```
./WikiDirectory/
|--tiddlers/
|----All_your_tids.tid
```
and make sure your "tiddlywiki.info" file as a "Build Target":
```
{
plugins: [],
"build": { "index": [ "--rendertiddler","$:/core/save/all","index.html","text/plain"] }
}
```

Once your program has created that file structure, you need to call the tiddlywiki process as below:
`tiddlywiki "C/path/to/the/WikiDirectory" --build index`

This will generate a new folder in your wiki directory called "output" with a new "index.html" file as your built-wiki.

Further reading: https://tiddlywiki.com/#BuildCommand:BuildCommand%20%5B%5Btiddlywiki.info%20Files%5D%5D%20HelloThere%20GettingStarted%20Community

Best,
Joshua Fontany

Mat

unread,
Jan 27, 2021, 1:03:13 AM1/27/21
to TiddlyWiki
As someone noted, this is really a dev question because it goes beyond the immediate concerns of TW, so it should be taken here.


(the old dev group is deprecated AFAIC)

Anyway, your description sounds as if you're not using the node.js version of TW. It does seem the node version is what should be used for this case. But IF you insist on using the single file version I'd think tiddlers can be added "in the middle" by copying the whole empty tw code to get two copies and then do someting to crop them so you get a "upper half" and a "lower half"... and then merge "upper half"+"your tiddlers"+"lower half". If you just take an empty TW and create a few dummy tiddlers and then peek at the code you'll see where they are positionend.

I am not a coder so the described approach is just a guess.

<:-) 

Reply all
Reply to author
Forward
0 new messages