[tw5] Re: Automatically generate static website in Node

2021-09-15 Thread TW Tones
Mark,

I would suggest a mechaisium could be built within the single file wiki to 
package only modified static tiddlers for upload to a host as well.

Also many tiddlywiki.html files are smaller than most images, thus a full 
upload not an issue.

I am not contradicting you only pointing out it is possible even if no one 
has done it yet. It is not a "hard limit".

Regards
Tones

On Thursday, 16 September 2021 at 01:56:49 UTC+10 Mark S. wrote:

> One of the advantages of node is that it only needs to write tiddlers that 
> have changed, rather than the entire TW file. If you "published" a TW 
> automatically, you would undermine this feature.
>
> You can create a standalone any time you want just by clicking on the save 
> button and picking the appropriate save option and location.
>
> If you want to do it the other way, push your tiddlers to GitHub and then 
> automatically publish a page to GH pages, then Saq has a clever technique 
> for you to use:
>
> https://github.com/saqimtiaz/TW5-github-actions-example
>
> On Tuesday, September 14, 2021 at 10:35:59 AM UTC-7 rikagol...@gmail.com 
> wrote:
>
>> Hi All!
>>
>> I am using NodeJS right now to auto save Tiddlers. I love it!
>>
>> I expected that a static website (index.html) would get built 
>> automatically on save, but that's not happening. What's an easy way to 
>> automatically build a static website on each autosave? (I'm thinking ahead 
>> to when I will host my site on Github). 
>>
>> Thanks!
>>
>>
>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/60c2a2a1-50e4-40b9-9cfe-5f03df7a4357n%40googlegroups.com.


[tw5] Re: Can a tiddler be setup to not allow being overwritten?

2021-09-15 Thread Charlie Veniot
Just thinking out loud...

Step 1 to safe-keep important tiddlers: add a little bit of custom code to 
$/core/ui/ImportListing

(Well, I am pondering over what kind of trouble I might get myself into...)

If a tiddler being imported already exists and the already existing one has 
a certain tag, or a certain field, or belongs in a particular list of 
tiddlers somewhere, then:

Disable the select checkbox, and make it unchecked.  Display with the 
tiddler title a message along the lines of "this is a critical tiddler, and 
can only be replaced ".

Something like that.

Step 2: upon press of the delete button on one of these important tiddlers, 
popup a message along the lines of "this is a critical tiddler, and can 
only be deleted ".

Step 3: upon creation of a new tiddler, if the name is edited and set to 
the same name as some already existing tiddler that is one of these 
important tiddlers, then disable the save button and show somewhere a 
message along the lines of "this tiddler already exists and is a critical 
tiddler, and can only be replaced ".

And if I'm thinking about all of this, it is to give time for this sponge 
of mine to conceive "TW integrity" constraints, like database constraints, 
particularly in mind: preventing the deletion of a parent tiddler when 
there are child tiddler dependencies on that parent tiddler.

Something like that.  The wheels are spinning ...





On Wednesday, September 8, 2021 at 7:18:31 AM UTC-3 jeremy...@gmail.com 
wrote:

> Tthis is one of those reasonable sounding features that has a surprising 
> degree of inwardness when one looks into it. Implementing true read-only 
> tiddlers would have a substantial impact on the architecture of TiddlyWiki:
>
> * At the moment, write operations cannot fail, and so there is no error 
> handling in wikitext. If we introduce operations that can fail it seems 
> likely that we'd also have to incorporate error handling features, which 
> would considerably complicate even simple operations
> * Performing the access control lookups would have an impact on 
> performance. The core is architected so that lookup operations on the 
> tiddler store are as fast as possible (a single JS object lookup), and so 
> adding even a little bit more logic will end up multiplying the overall 
> execution time of the store component many times over
>
> So, it was an explicit early design decision that operations on the 
> tiddler store cannot fail. Note that client-server configurations have much 
> more scope to block tiddler modifications being synced in one direction or 
> the other.
>
> Best wishes
>
> Jeremy
>
> On Tuesday, September 7, 2021 at 1:09:01 AM UTC+1 cj.v...@gmail.com wrote:
>
>> Just to re-iterate, there are several ways an important tiddler can be 
>> unintentionally fricasseed.
>>
>> The most likely from a brain-fart moment, examples off the top o' me 
>> noggin':
>>
>>- delete button
>>- drag and drop a crap version that overwrites the good version
>>- bad set-field (or other action widget) that deletes a tiddler, or 
>>completely/partially overwrites the tiddler
>>
>> I'm sure there are other Darwin Award moments, like creating and saving a 
>> new tiddler with the name of an already existing tiddler, and being just 
>> plain old too numb-in-the-moment-deer-in-the-headlights to really clue into 
>> the pending "this is going to leave a scar" moment.
>>
>> Just when one thinks one can trust oneself to not pull an award-winning 
>> dumb move, the IQ-stealing fairy is waiting just around the corner for a 
>> clobbering.
>>
>>
>>
>> On Monday, September 6, 2021 at 8:50:16 PM UTC-3 TW Tones wrote:
>>
>>> On Talk.tiddlywiki.com I would mention Mario and Charlie here. 
>>>
>>> Mario I would like to support part of what Charlie seems to be concerned 
>>> with. I have a few wikis where I have delete inhibit on selected tiddlers, 
>>> typically the master tiddler that is a compound tiddler, meaning it has 
>>> many subtiddlers. Deleting that would result in loss. I have the real 
>>> delete button behind more, so I can get to it. I also have edit inhibit 
>>> because I rarely change the master tiddler but want to edit the 
>>> subtiddlers. A conditional edit button simply helps stop me clicking on the 
>>> wrong edit button. All this can be circumvented, but it helps improve the 
>>> user Interface by avoiding the display of buttons that are not relevant and 
>>> could initiate actions that cause a waste of time if not damage.
>>>
>>> Tones
>>>
>>>
>>> On Monday, 6 September 2021 at 19:07:42 UTC+10 PMario wrote:
>>>
 On Monday, September 6, 2021 at 3:01:25 AM UTC+2 cj.v...@gmail.com 
 wrote:

 No worries.  I'll train my thoughts on obfuscation, risk-mitigation 
> design/strategies, and automated monitoring/repairing processes.
>

 IMO obfuscation is wasting time, other than removing the buttons, that 
 are not needed. Which I would define as "modifying the UI according to the 

[tw5] Re: If possible, can GG continue to co-exist with TiddlyTalk?

2021-09-15 Thread Jean-Pierre Rivière
Thanks to this thread, I've just discovered that there was an other tw 
forum! It could be a regular announce here, for GG is a logical step to 
look out for tw user list, isn't it?

So I can't compare the two services yet.

Le lundi 13 septembre 2021 à 09:44:16 UTC+2, strikke...@gmail.com a écrit :

> Kosmo,
>
> Agreed, for all its faults, I find GG easier to use, and would like the 
>> group here to remain active. TT is just fussy and annoying.
>>
>
> I do not think it is just fussy and annoying. More material will be 
> collected in one place over time and be easier to find. Example the *How 
> to* and the *Showcase *categories - and more.
>
> It is worth testing Talk tiddlywiki out for some time - if at all 
> possible. Some of us have not used Discourse before and need some time to 
> find out how it really works.
>
> GG active or not  does not help much if most of the activity has moved. 
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/76836f46-4881-40d7-9d65-ccaecc2cf0bcn%40googlegroups.com.


Re: [tw5] Re: tw editions and docker questions

2021-09-15 Thread Jean-Pierre Rivière
Hi Xavier,

Thanks for your telling. I found only one occurence 
of default-tiddler-location and that's in $:/boot/boot.js 
 :

if ($tw.boot.wikiPath == wikiPath) { $tw.boot.wikiTiddlersPath = 
path.resolve($tw.boot.wikiPath,config["default-tiddler-location"] || 
$tw.config.wikiTiddlersSubDir); }

Well... so what? Where is the change I should made? Is that a modification 
within $:/core/modules/config.js ? I have not found any reference to fr-FR 
so I assume it was deducted from the name of the file/plugin.

Where are the sources for fr-FR and fr-FR-server?

I have found the same problem with es-ES-server and ko-KR-server which are 
the two only other translated server editions.

Regards,



Le mercredi 15 septembre 2021 à 15:20:35 UTC+2, xca...@immateriel.fr a 
écrit :

> Hi Jean-Pierre,
>
> Historically, the fr-FR and fr-FR-server editions were aimed at providing 
> a translated version of tw5.com. I had wanted to gather a team of 
> translators in order to achieve this, but I eventually gave up as the task 
> seemed too daunting. I focused instead on the fr-FR language plugin. 
>
> What you experience — tiddlers are saved in the fr-FR sub-directory 
> instead of the served wiki — is probably due to the 
> "default-tiddler-location": "../fr-FR/tiddlers" in the config of the 
> fr-FR-server edition. If you remove that before you --init a new wiki, you 
> will get a more natural behaviour. If you confirm that it solves the 
> problem, I'll propose a removal from the official edition.
>
> Cheers,
> -- Xavier Cazin.
>
> On Wed, Sep 15, 2021 at 12:43 PM Jean-Pierre Rivière <
> jn.pierr...@gmail.com> wrote:
>
>> Hi @PMario and mauloop!
>>
>> I(ve taken my time but I can now bring some valuable new input. But 
>> before that, let me thank you for your answers. I've dipped deeper in 
>> docker and nodejs tiddlywiki as a result. And I can tell you that I've 
>> finally come to a successful setup but some problems are still there. But I 
>> can create an OK docker image and use it to launch it a suceesfull 
>> tiddlywiki and load stuff inside before really launching it as a server (I 
>> have not yet seen how to use apache as a proxy).
>>
>> So for the sake of answering my question, here is my Dockerfile:
>> -
>> # Dockerfile pour lancer le tiddlywiki proteva
>> # copiée et adaptée du modèle elasticdog/tiddlywiki disponible sur le 
>> docker hub
>> from node:16.9.0-alpine3.11
>>
>> LABEL author="Jean-Pierre RIVIÈRE"
>> LABEL content="instance de nodejs avec le tiddliwki proteva"
>>
>> env TIDDLYWIKI_VERSION=5.1.23
>> env PROTEVA_FEED=proteva-data.json
>> env WORKDIR=/usr/share/tiddlywiki/proteva-wiki
>>
>> EXPOSE 8080
>>
>> WORKDIR $WORKDIR
>> VOLUME $WORKDIR
>>
>> run apk update && apk add --no-cache tini
>> run npm install -g tiddlywiki@$TIDDLYWIKI_VERSION && npm install clean 
>> --force
>>
>> #ENTRYPOINT ["tiddlywiki", "proteva"]
>> #CMD ["--listen", "host=0.0.0.0"]
>> ENTRYPOINT ["/sbin/tini", "--"]
>> CMD ["tiddlywiki", "proteva", "--listen", "host=0.0.0.0"]
>> --
>>
>> and here is my proteva.sh script that I use to manage the wiki with 
>> ./proteva.sh init  && ./proteva.sh start
>> 
>> #!/bin/sh
>> # shell pour initialiser ou lancer proteva via docker
>>
>> IMAGE=proteva
>> WIKI=$IMAGE
>> PROTEVA_FEED=proteva-data.json
>> PROTEVA_DIR=$PWD/proteva-data
>> WORKDIR=/usr/share/tiddlywiki/proteva-wiki
>> EDITION=rerver
>>
>> case $1 in
>>   init)
>> echo wiping $PROTEVA_DIR
>> [ -d $PROTEVA_DIR ] && sudo rm -rf $PROTEVA_DIR
>> mkdir $PROTEVA_DIR
>> echo building $IMAGE docker image
>> sudo docker build . -t $IMAGE
>> echo built
>> sudo docker run --rm -v $PROTEVA_DIR:$WORKDIR $IMAGE tiddlywiki $WIKI 
>> --init $EDITION
>> echo initialized
>> cp $PROTEVA_FEED $PROTEVA_DIR
>> sudo docker run --rm -v $PROTEVA_DIR:$WORKDIR $IMAGE tiddlywiki $WIKI 
>> --load $PROTEVA_FEED
>> rm $PROTEVA_DIR/$PROTEVA_FEED
>> echo import done
>> ;;
>>   start)
>> [ -d $PROTEVA_DIR ] || mkdir $PROTEVA_DIR
>> sudo docker run --rm -it -p 8080:8080 -v $PROTEVA_DIR:$WORKDIR --name 
>> $WIKI $IMAGE tiddlywiki $WIKI --listen host=0.0.0.0
>> ;;
>>   *) echo "usage : ${0##/} ORDER"
>>  echo '  where ORDER is either "init" or "start"'
>>  echo '  to initialize or launch proteva tiddlywiki nodejs via 
>> docker.'
>>  ;;
>> esac
>> 
>>
>> Now for the remaining problem: the fr-FR-server edition seems at fault. 
>> If I use iti instead of server (as value of the EDITION variable in the 
>> script)' the --init and --listen part is OK (launching the "proteva" wiki), 
>> the --load part is wrong for the data are copied in the fr-FR sub-directory 
>> (instead of the proteva sub-directory). Besides, I can't see any French 
>> with that edition.
>>
>> the real command I use is:
>>
>> sudo docker run --rm -v 
>> 

[tw5] Re: Automatically generate static website in Node

2021-09-15 Thread 'Mark S.' via TiddlyWiki
One of the advantages of node is that it only needs to write tiddlers that 
have changed, rather than the entire TW file. If you "published" a TW 
automatically, you would undermine this feature.

You can create a standalone any time you want just by clicking on the save 
button and picking the appropriate save option and location.

If you want to do it the other way, push your tiddlers to GitHub and then 
automatically publish a page to GH pages, then Saq has a clever technique 
for you to use:

https://github.com/saqimtiaz/TW5-github-actions-example

On Tuesday, September 14, 2021 at 10:35:59 AM UTC-7 rikagol...@gmail.com 
wrote:

> Hi All!
>
> I am using NodeJS right now to auto save Tiddlers. I love it!
>
> I expected that a static website (index.html) would get built 
> automatically on save, but that's not happening. What's an easy way to 
> automatically build a static website on each autosave? (I'm thinking ahead 
> to when I will host my site on Github). 
>
> Thanks!
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/478a1bfe-8474-41c4-a279-2a2469273e0en%40googlegroups.com.


Re: [tw5] Re: tw editions and docker questions

2021-09-15 Thread Xavier Cazin
Hi Jean-Pierre,

Historically, the fr-FR and fr-FR-server editions were aimed at providing a
translated version of tw5.com. I had wanted to gather a team of translators
in order to achieve this, but I eventually gave up as the task seemed too
daunting. I focused instead on the fr-FR language plugin.

What you experience — tiddlers are saved in the fr-FR sub-directory instead
of the served wiki — is probably due to the "default-tiddler-location":
"../fr-FR/tiddlers" in the config of the fr-FR-server edition. If you
remove that before you --init a new wiki, you will get a more natural
behaviour. If you confirm that it solves the problem, I'll propose a
removal from the official edition.

Cheers,
-- Xavier Cazin.

On Wed, Sep 15, 2021 at 12:43 PM Jean-Pierre Rivière <
jn.pierre.rivi...@gmail.com> wrote:

> Hi @PMario and mauloop!
>
> I(ve taken my time but I can now bring some valuable new input. But before
> that, let me thank you for your answers. I've dipped deeper in docker and
> nodejs tiddlywiki as a result. And I can tell you that I've finally come to
> a successful setup but some problems are still there. But I can create an
> OK docker image and use it to launch it a suceesfull tiddlywiki and load
> stuff inside before really launching it as a server (I have not yet seen
> how to use apache as a proxy).
>
> So for the sake of answering my question, here is my Dockerfile:
> -
> # Dockerfile pour lancer le tiddlywiki proteva
> # copiée et adaptée du modèle elasticdog/tiddlywiki disponible sur le
> docker hub
> from node:16.9.0-alpine3.11
>
> LABEL author="Jean-Pierre RIVIÈRE"
> LABEL content="instance de nodejs avec le tiddliwki proteva"
>
> env TIDDLYWIKI_VERSION=5.1.23
> env PROTEVA_FEED=proteva-data.json
> env WORKDIR=/usr/share/tiddlywiki/proteva-wiki
>
> EXPOSE 8080
>
> WORKDIR $WORKDIR
> VOLUME $WORKDIR
>
> run apk update && apk add --no-cache tini
> run npm install -g tiddlywiki@$TIDDLYWIKI_VERSION && npm install clean
> --force
>
> #ENTRYPOINT ["tiddlywiki", "proteva"]
> #CMD ["--listen", "host=0.0.0.0"]
> ENTRYPOINT ["/sbin/tini", "--"]
> CMD ["tiddlywiki", "proteva", "--listen", "host=0.0.0.0"]
> --
>
> and here is my proteva.sh script that I use to manage the wiki with
> ./proteva.sh init  && ./proteva.sh start
> 
> #!/bin/sh
> # shell pour initialiser ou lancer proteva via docker
>
> IMAGE=proteva
> WIKI=$IMAGE
> PROTEVA_FEED=proteva-data.json
> PROTEVA_DIR=$PWD/proteva-data
> WORKDIR=/usr/share/tiddlywiki/proteva-wiki
> EDITION=rerver
>
> case $1 in
>   init)
> echo wiping $PROTEVA_DIR
> [ -d $PROTEVA_DIR ] && sudo rm -rf $PROTEVA_DIR
> mkdir $PROTEVA_DIR
> echo building $IMAGE docker image
> sudo docker build . -t $IMAGE
> echo built
> sudo docker run --rm -v $PROTEVA_DIR:$WORKDIR $IMAGE tiddlywiki $WIKI
> --init $EDITION
> echo initialized
> cp $PROTEVA_FEED $PROTEVA_DIR
> sudo docker run --rm -v $PROTEVA_DIR:$WORKDIR $IMAGE tiddlywiki $WIKI
> --load $PROTEVA_FEED
> rm $PROTEVA_DIR/$PROTEVA_FEED
> echo import done
> ;;
>   start)
> [ -d $PROTEVA_DIR ] || mkdir $PROTEVA_DIR
> sudo docker run --rm -it -p 8080:8080 -v $PROTEVA_DIR:$WORKDIR --name
> $WIKI $IMAGE tiddlywiki $WIKI --listen host=0.0.0.0
> ;;
>   *) echo "usage : ${0##/} ORDER"
>  echo '  where ORDER is either "init" or "start"'
>  echo '  to initialize or launch proteva tiddlywiki nodejs via docker.'
>  ;;
> esac
> 
>
> Now for the remaining problem: the fr-FR-server edition seems at fault. If
> I use iti instead of server (as value of the EDITION variable in the
> script)' the --init and --listen part is OK (launching the "proteva" wiki),
> the --load part is wrong for the data are copied in the fr-FR sub-directory
> (instead of the proteva sub-directory). Besides, I can't see any French
> with that edition.
>
> the real command I use is:
>
> sudo docker run --rm -v
> /home/jnpr/big/workspace/accessibilite/dockerized/proteva-data:/usr/share/tiddlywiki/proteva-wiki
> proteva tiddlywiki proteva --load proteva-data.json
>
> This commands create this strucure all of its own:
>
> proteva-data
> ├── fr-FR
> │   └── tiddlers
> │   ├── $__StoryList.tid
> │   └── TODO.tid
>
> (proteva-data is created previously along proteva-data/proteva by --init)
>
> Where can I get the fr-FR sources/fellows of this project to help sort out
> this mystery?
>
> Le dimanche 12 septembre 2021 à 00:59:09 UTC+2, mauloop a écrit :
>
>> I published on Github a little project to run Tiddlyserver with Docker.
>> You can find it at https://github.com/mauloop/tiddlyserver-docker.
>> It allows multiple wikis within a single server instance and custom
>> editions path.
>>
>> I made it for my own use,  so it does not provide very rich
>> documentation, but just a quick and dirty readme with minimum commands
>> needed to get started. However it could fit some of your requirements.
>>
>> Finally here is good example about how to set up Apache to 

[tw5] Re: How to get the title of a tiddler in js?

2021-09-15 Thread Charlie Veniot
That will require a change to the plugin's javascript, I think, which will 
be quite ugly.

Alternatively, you could create a single-click button in the tiddler 
toolbar which copies the tiddler title to the clipboard.  I think that 
would be a much more trivial affair.

On Wednesday, September 15, 2021 at 7:15:29 AM UTC-3 imleg...@gmail.com 
wrote:

> Do you know how to disable the plugin when I double click the title?  Some 
> time I just want to copy the title not edit the whole tiddler, I double 
> click the title to select it. But now will trigger the edit command 
>
> On Tuesday, September 14, 2021 at 10:12:38 PM UTC+8 cj.v...@gmail.com 
> wrote:
>
>> Oh good.  Big sigh of relief over here.  *(I may have had "look, see, it 
>> works" moments while people politely nod in agreement while awkwardly 
>> hoping somebody else lifts a hand and breaks the news...)*
>>
>> On Tuesday, September 14, 2021 at 11:03:13 AM UTC-3 strikke...@gmail.com 
>> wrote:
>>
>>> cj.v,
>>> Thank you. I does work for me too now. It was of course an error on my 
>>> part - not identifying my own typo. It seems no matter how many times we 
>>> look our writing through- eyes popping out, errors are often not found. I 
>>> call it TW eye fatigue.
>>>
>>> Thank you,
>>> Birthe
>>>
>>> On Tuesday, September 14, 2021 at 2:58:26 PM UTC+2 cj.v...@gmail.com 
>>> wrote:
>>>
 Just to answer your first question, you want to modify the 
 ViewTemplate  in your TiddlyWiki that has the plugin.  (screenshot below)

 Also, after you've edited the plugin, you have to make sure to save and 
 reload the TiddlyWiki for the change to take effect.

 I just tested this again, and it all works A-1.  Double-clicking on any 
 tiddler just opens that one tiddler for edit.  Double-clicking on either a 
 shadow or a system tiddler does nothing.

 Just as a sanity check, download an empty TiddlyWiki, install the 
 plugin in that TiddlyWiki, and see if things work correctly there.

 I suspect you made a change to the plugin's javascript and also made 
 this edit I suggest to the ViewTemplate.

 If you did change the javascript, you should probably remove the plugin 
 and reinstall.

 [image: Screenshot 2021-09-14 9.51.20 AM.png]

 On Tuesday, September 14, 2021 at 6:38:26 AM UTC-3 strikke...@gmail.com 
 wrote:

> Charlie - editing the viewtemplate lead to another problem - 2 click 
> on one tiddler open all standard tiddlers for edit. 
> On Tuesday, September 14, 2021 at 11:29:20 AM UTC+2 
> strikke...@gmail.com wrote:
>
>> You find the viewtemplate in .Danielos 2click2edit plugin 
>> 
>>
>> On Tuesday, September 14, 2021 at 10:36:23 AM UTC+2 
>> imleg...@gmail.com wrote:
>>
>>> thank you. Can you give me a link about the viewtemplate, cuz I 
>>> can't find it on google. 
>>>
>>> And why we put a "<$click>" here
>>>
>>> On Monday, September 13, 2021 at 12:50:49 AM UTC+8 cj.v...@gmail.com 
>>> wrote:
>>>
 Hi,

 Instead of altering the javascript, give what's in the screenshot 
 below a try.

 Do note: for the change to take effect, you do have to save and 
 reload your TiddlyWiki.

 [image: Screenshot 2021-09-12 1.48.30 PM.png]

 On Sunday, September 12, 2021 at 12:34:03 PM UTC-3 
 imleg...@gmail.com wrote:

> I installed the tiddler 2click2edit. I want to change it a little 
> that when a tiddler start with the "$", don't trigger the edit 
> command. 
>
> I already found the related code. Which 
> is $:/plugins/danielo515/2click2edit/ClickListener.js
>
> I think I need to change the code 
>
> ```
> ClickListener.prototype.editTiddler = function(event) { 
> //alert(this.getVariable("currentTiddler").getTitle()); 
>   this.dispatchEvent({type: "tm-edit-tiddler", param: 
> this.getVariable("currentTiddler")}); 
> }; 
> ```
>
> But this.getVariable("currentTiddler").getTitle() seems not right, 
> how to fix it. 
>
> And is there a manual for program for tw? 
>


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9eae212c-1d95-4a11-ad75-3b8a834e0486n%40googlegroups.com.


[tw5] Re: Automatically generate static website in Node

2021-09-15 Thread Jean-Pierre Rivière
Hi! Just go to tiddlywiki.com and look out for the "Generating Static Sites 
with TiddlyWiki" tiddler for full explanation.

in very short: use the --rendertiddlers command of tiddlywiki with the list 
of all wanted tiddlers as subsequent arguments of the command line. The 
problem is, this is done in an other process than the one serving as a web 
server currently run.

Now, if you had the control of the server, you could launch a daemon to 
just do that on each new or updated file within the tiddlers directory. As 
for deleted and renamed tiddlers, it would require a simple rm command also 
launched by a similar mechanism. But of course, this is not possible for 
any hosting service like github. You would need an other server on your 
control that would just do that on a copy of the tiddlers files it would 
keep in sync. I would think that manually launching the update of the 
static site would be wiser and less energy-hungry.

Regards,

Le mardi 14 septembre 2021 à 19:35:59 UTC+2, rikagol...@gmail.com a écrit :

> Hi All!
>
> I am using NodeJS right now to auto save Tiddlers. I love it!
>
> I expected that a static website (index.html) would get built 
> automatically on save, but that's not happening. What's an easy way to 
> automatically build a static website on each autosave? (I'm thinking ahead 
> to when I will host my site on Github). 
>
> Thanks!
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/a22e777a-93e9-43ca-9c26-0132be9a407an%40googlegroups.com.


[tw5] Re: tw editions and docker questions

2021-09-15 Thread Jean-Pierre Rivière
Hi @PMario and mauloop!

I(ve taken my time but I can now bring some valuable new input. But before 
that, let me thank you for your answers. I've dipped deeper in docker and 
nodejs tiddlywiki as a result. And I can tell you that I've finally come to 
a successful setup but some problems are still there. But I can create an 
OK docker image and use it to launch it a suceesfull tiddlywiki and load 
stuff inside before really launching it as a server (I have not yet seen 
how to use apache as a proxy).

So for the sake of answering my question, here is my Dockerfile:
-
# Dockerfile pour lancer le tiddlywiki proteva
# copiée et adaptée du modèle elasticdog/tiddlywiki disponible sur le 
docker hub
from node:16.9.0-alpine3.11

LABEL author="Jean-Pierre RIVIÈRE"
LABEL content="instance de nodejs avec le tiddliwki proteva"

env TIDDLYWIKI_VERSION=5.1.23
env PROTEVA_FEED=proteva-data.json
env WORKDIR=/usr/share/tiddlywiki/proteva-wiki

EXPOSE 8080

WORKDIR $WORKDIR
VOLUME $WORKDIR

run apk update && apk add --no-cache tini
run npm install -g tiddlywiki@$TIDDLYWIKI_VERSION && npm install clean 
--force

#ENTRYPOINT ["tiddlywiki", "proteva"]
#CMD ["--listen", "host=0.0.0.0"]
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["tiddlywiki", "proteva", "--listen", "host=0.0.0.0"]
--

and here is my proteva.sh script that I use to manage the wiki with 
./proteva.sh init  && ./proteva.sh start

#!/bin/sh
# shell pour initialiser ou lancer proteva via docker

IMAGE=proteva
WIKI=$IMAGE
PROTEVA_FEED=proteva-data.json
PROTEVA_DIR=$PWD/proteva-data
WORKDIR=/usr/share/tiddlywiki/proteva-wiki
EDITION=rerver

case $1 in
  init)
echo wiping $PROTEVA_DIR
[ -d $PROTEVA_DIR ] && sudo rm -rf $PROTEVA_DIR
mkdir $PROTEVA_DIR
echo building $IMAGE docker image
sudo docker build . -t $IMAGE
echo built
sudo docker run --rm -v $PROTEVA_DIR:$WORKDIR $IMAGE tiddlywiki $WIKI 
--init $EDITION
echo initialized
cp $PROTEVA_FEED $PROTEVA_DIR
sudo docker run --rm -v $PROTEVA_DIR:$WORKDIR $IMAGE tiddlywiki $WIKI 
--load $PROTEVA_FEED
rm $PROTEVA_DIR/$PROTEVA_FEED
echo import done
;;
  start)
[ -d $PROTEVA_DIR ] || mkdir $PROTEVA_DIR
sudo docker run --rm -it -p 8080:8080 -v $PROTEVA_DIR:$WORKDIR --name 
$WIKI $IMAGE tiddlywiki $WIKI --listen host=0.0.0.0
;;
  *) echo "usage : ${0##/} ORDER"
 echo '  where ORDER is either "init" or "start"'
 echo '  to initialize or launch proteva tiddlywiki nodejs via docker.'
 ;;
esac


Now for the remaining problem: the fr-FR-server edition seems at fault. If 
I use iti instead of server (as value of the EDITION variable in the 
script)' the --init and --listen part is OK (launching the "proteva" wiki), 
the --load part is wrong for the data are copied in the fr-FR sub-directory 
(instead of the proteva sub-directory). Besides, I can't see any French 
with that edition.

the real command I use is:

sudo docker run --rm -v 
/home/jnpr/big/workspace/accessibilite/dockerized/proteva-data:/usr/share/tiddlywiki/proteva-wiki
 
proteva tiddlywiki proteva --load proteva-data.json

This commands create this strucure all of its own:

proteva-data
├── fr-FR
│   └── tiddlers
│   ├── $__StoryList.tid
│   └── TODO.tid

(proteva-data is created previously along proteva-data/proteva by --init)

Where can I get the fr-FR sources/fellows of this project to help sort out 
this mystery?

Le dimanche 12 septembre 2021 à 00:59:09 UTC+2, mauloop a écrit :

> I published on Github a little project to run Tiddlyserver with Docker. 
> You can find it at https://github.com/mauloop/tiddlyserver-docker.
> It allows multiple wikis within a single server instance and custom 
> editions path.
>
> I made it for my own use,  so it does not provide very rich documentation, 
> but just a quick and dirty readme with minimum commands needed to get 
> started. However it could fit some of your requirements.
>
> Finally here is good example about how to set up Apache to proxy a Nodejs 
> TW5 . I think it 
> could work with TiddlyServer too with very little changes, but I never 
> experienced this.
>
> Hope this could help. Have fun, )+(auloop
>
> Il giorno giovedì 9 settembre 2021 alle 23:23:54 UTC+2 
> jn.pierr...@gmail.com ha scritto:
>
>> Hi everybody!
>>
>> I need to have some of my tiddlywiki being onto nodejs to gain some 
>> functionality. For this, I have selected docker to have iti as easy as I 
>> can. Besides docker, I need some shell script to setup the wiki (docker 
>> images) ready to launch (listen command). Good point: this was an occasion 
>> for me to invest into docker.
>>
>> But there remains a problem, which is that of the tiddlywiki edition. the 
>> "editions" command list the available options with a quick summary. But 
>> some options would gain a little more explanations, like the 
>> server-external-js which seems to mean that the js is not mangled inside 
>> the js. That 

[tw5] Re: How to get the title of a tiddler in js?

2021-09-15 Thread imleg...@gmail.com
Do you know how to disable the plugin when I double click the title?  Some 
time I just want to copy the title not edit the whole tiddler, I double 
click the title to select it. But now will trigger the edit command 

On Tuesday, September 14, 2021 at 10:12:38 PM UTC+8 cj.v...@gmail.com wrote:

> Oh good.  Big sigh of relief over here.  *(I may have had "look, see, it 
> works" moments while people politely nod in agreement while awkwardly 
> hoping somebody else lifts a hand and breaks the news...)*
>
> On Tuesday, September 14, 2021 at 11:03:13 AM UTC-3 strikke...@gmail.com 
> wrote:
>
>> cj.v,
>> Thank you. I does work for me too now. It was of course an error on my 
>> part - not identifying my own typo. It seems no matter how many times we 
>> look our writing through- eyes popping out, errors are often not found. I 
>> call it TW eye fatigue.
>>
>> Thank you,
>> Birthe
>>
>> On Tuesday, September 14, 2021 at 2:58:26 PM UTC+2 cj.v...@gmail.com 
>> wrote:
>>
>>> Just to answer your first question, you want to modify the ViewTemplate  
>>> in your TiddlyWiki that has the plugin.  (screenshot below)
>>>
>>> Also, after you've edited the plugin, you have to make sure to save and 
>>> reload the TiddlyWiki for the change to take effect.
>>>
>>> I just tested this again, and it all works A-1.  Double-clicking on any 
>>> tiddler just opens that one tiddler for edit.  Double-clicking on either a 
>>> shadow or a system tiddler does nothing.
>>>
>>> Just as a sanity check, download an empty TiddlyWiki, install the plugin 
>>> in that TiddlyWiki, and see if things work correctly there.
>>>
>>> I suspect you made a change to the plugin's javascript and also made 
>>> this edit I suggest to the ViewTemplate.
>>>
>>> If you did change the javascript, you should probably remove the plugin 
>>> and reinstall.
>>>
>>> [image: Screenshot 2021-09-14 9.51.20 AM.png]
>>>
>>> On Tuesday, September 14, 2021 at 6:38:26 AM UTC-3 strikke...@gmail.com 
>>> wrote:
>>>
 Charlie - editing the viewtemplate lead to another problem - 2 click on 
 one tiddler open all standard tiddlers for edit. 
 On Tuesday, September 14, 2021 at 11:29:20 AM UTC+2 
 strikke...@gmail.com wrote:

> You find the viewtemplate in .Danielos 2click2edit plugin 
> 
>
> On Tuesday, September 14, 2021 at 10:36:23 AM UTC+2 imleg...@gmail.com 
> wrote:
>
>> thank you. Can you give me a link about the viewtemplate, cuz I can't 
>> find it on google. 
>>
>> And why we put a "<$click>" here
>>
>> On Monday, September 13, 2021 at 12:50:49 AM UTC+8 cj.v...@gmail.com 
>> wrote:
>>
>>> Hi,
>>>
>>> Instead of altering the javascript, give what's in the screenshot 
>>> below a try.
>>>
>>> Do note: for the change to take effect, you do have to save and 
>>> reload your TiddlyWiki.
>>>
>>> [image: Screenshot 2021-09-12 1.48.30 PM.png]
>>>
>>> On Sunday, September 12, 2021 at 12:34:03 PM UTC-3 
>>> imleg...@gmail.com wrote:
>>>
 I installed the tiddler 2click2edit. I want to change it a little 
 that when a tiddler start with the "$", don't trigger the edit 
 command. 

 I already found the related code. Which 
 is $:/plugins/danielo515/2click2edit/ClickListener.js

 I think I need to change the code 

 ```
 ClickListener.prototype.editTiddler = function(event) { 
 //alert(this.getVariable("currentTiddler").getTitle()); 
   this.dispatchEvent({type: "tm-edit-tiddler", param: 
 this.getVariable("currentTiddler")}); 
 }; 
 ```

 But this.getVariable("currentTiddler").getTitle() seems not right, 
 how to fix it. 

 And is there a manual for program for tw? 

>>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8fd8a11f-84b6-4f61-bebc-4d180008b0f2n%40googlegroups.com.