[tw5] tw editions and docker questions

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 could be useful to serve several wikis from the same server.

But in fact, I need a localized edition. Alas, editions are not cumulative (but the server-external-js really should be an option and not a proper edition because that’s not an editorial difference at all and it could be useful for many editions).

By localized, I mean that I want the content in French, but without all the fuss of fr-FR editions which I would need to get rid of but for a few tiddlers (and this would be a burden to implement and maintain). As for the fr-FR-server, the interface has not been translated (I wonder what has been translated and where I could find this information?)

docker code used (without the volume and port stuff) on my tiddlywiki docker image tiddock:

docker run -d --rm tiddock wiki --init fr-FR-server
docker run -d --rm tiddock server host=0.0.0.0

(I used elasticdog Dockerfile and shells to see what was needed to do. Thanks elasticdog!)

Also, if I understand what is said here, I must not directly use tiddlywiki for a production wiki but use a proxy liki nginx can provide. I have no knowledge of nginx so far. Where could I find some useful docs or sources of a tiddlywiki with this kind of setup?

Thanks in advance for your help.

Hi,

It would be nice to have some links to the docker file and docs that you used. … Your docker start commands look super strange.

docker run -d --rm tiddock wiki --init fr-FR-server
docker run -d --rm tiddock server host=0.0.0.0

That’s not how it should be done. … the fr-FR-server is ONLY used for development, since it contains an includeWikis parameter, that includes the French wiki translatiions and it includes the english original wiki content as β€œread only”. … So that’s a complete m

The whole TW initialisation of your wiki folders should be done with the docker build commands.

The commands you posted won’t work at all. The complete volume info is missing. …

As I wrote, if you give a link to the docker build file it would be easier to help.

-mario

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

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:

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,

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,

Hi Jean-Pierre,

Per the tree of the TW5 source:

src/
└── TiddlyWiki5
(…)
β”œβ”€β”€ editions
β”‚ β”œβ”€β”€ fr-FR
β”‚ β”‚ β”œβ”€β”€ tiddlers
β”‚ β”‚ β”‚ β”œβ”€β”€ (a few translated tiddlers from tw5.com)
β”‚ β”‚ └── tiddlywiki.info
β”‚ β”œβ”€β”€ fr-FR-server
β”‚ β”‚ β”œβ”€β”€ tiddlers
β”‚ β”‚ β”‚ β”œβ”€β”€ config-Navigation-UpdateAddressBar.tid
β”‚ β”‚ β”‚ β”œβ”€β”€ config-more-button.tid
β”‚ β”‚ β”‚ └── system
β”‚ β”‚ β”‚ β”œβ”€β”€ favicon.ico
β”‚ β”‚ β”‚ └── favicon.ico.meta
β”‚ β”‚ └── tiddlywiki.info
β”‚ (…)
└── tiddlywiki.js

you may want to study the config parameter in the tiddlywiki.info files.

Cheers,

1 Like

thank you Xavier. got it.

As for fr-FR-server, I think it should only have these tiddlers for its tiddlers (no more, no less):

β”œβ”€β”€ $__Acknowledgements.tid
β”œβ”€β”€ $__ContributionBanner.tid
β”œβ”€β”€ $__core_ui_DefaultSearchResultList.tid
β”œβ”€β”€ $__core_ui_ListItemTemplate.tid
β”œβ”€β”€ $__core_ui_SideBar_Open.tid
β”œβ”€β”€ $__core_ui_TagTemplate.tid
β”œβ”€β”€ $__core_ui_ViewTemplate_title.tid
β”œβ”€β”€ $__CurvedText.tid
β”œβ”€β”€ $__DefaultTiddlers.tid
β”œβ”€β”€ $__editions_fr-FR_CSS stylesheets_latex.tid
β”œβ”€β”€ $__editions_fr-FR_CSS Stylesheets_mesStyles.tid
β”œβ”€β”€ $__editions_fr-FR_CSS Stylesheets_utils.tid
β”œβ”€β”€ $__editions_fr-FR_Macros_list.tid
β”œβ”€β”€ $__editions_fr-FR_Macros_timeline-title.tid
β”œβ”€β”€ $__editions_fr-FR_Macros_toc-caption.tid
β”œβ”€β”€ $__editions_fr-FR_Macros_wikitexte-exemple.tid
β”œβ”€β”€ $__editions_fr-FR_util-macros.tid
β”œβ”€β”€ $__SiteSubtitle.tid

Now, the question I need to ask: how would I proceed to build tw from my own modified tw repository in order to check if that is the case or not that modifying of tiddlywiki.info is doing what we want to achieve?

I’m sorry Xavier, but I’ve been unable to create any edition to see what you suggest would do. I haven’t understood how to do it. Could you help me please?

cheers,

Hi Jean-Pierre,

Embarrassingly, I’m not sure I still grasp the whole thing anymore. The confusing thing is that the fr-FR server edition is not meant as an fr-FR localisation of the server edition (nor any xx-YY-server editions by the way). As far as I know, they are mostly useful when one wants to edit the source of their xx-XX edition counterpart in-place (typically in a dedicated git branch).

With the help of https://tiddlywiki.com/prerelease/#tiddlywiki.info%20Files, it must be possible to combine these editions in order to create a NodeJS wiki that is bootstrapped with the payload tiddlers contained in these editions, but I didn’t succeed to write down a straightforward description of the process. Maybe @pmario has a better understanding of these mechanisms?

Thank you Xavier.

I’m closing this topic and will start another one on Talk about having localized server edition for the sake of it and not that of translating another edition.

Embarrassingly, I’m not sure I still grasp the whole thing anymore. The confusing thing is that the fr-FR server edition is not meant as an fr-FR localisation of the server edition (nor any xx-YY-server editions by the way). As far as I know, they are mostly useful when one wants to edit the source of their xx-XX edition counterpart in-place (typically in a dedicated git branch).

That’s right. It’s there for users, who want to translate the content of tiddlywiki.com to the French language.

fr-FR-server includes the fr-FR wiki content, which is the translated content
fr-FR includes …/tw5.com as readOnly … As I wrote. This is for development only!

With the help of https://tiddlywiki.com/prerelease/#tiddlywiki.info%20Files, it must be possible to combine these editions in order to create a NodeJS wiki that is bootstrapped with the payload tiddlers contained in these editions, but I didn’t succeed to write down a straightforward description of the process. Maybe @pmario has a better understanding of these mechanisms?

If you want to β€œspawn” a french server you have to do this:

tiddlywiki myWiki --init server

add this to your tiddlywiki.info file the was created in myWiki folder

"languages": [
  "fr-FR"
],

So the whole file will look like this:

{
"description": "Basic client-server edition",
  "plugins": [
    "tiddlywiki/tiddlyweb",
    "tiddlywiki/filesystem",
    "tiddlywiki/highlight"
  ],
  "themes": [
    "tiddlywiki/vanilla",
    "tiddlywiki/snowwhite"
  ],
  "languages": [
    "fr-FR"
  ],
  "build": {
    "index": [
      "--rendertiddler","$:/plugins/tiddlywiki/tiddlyweb/save/offline","index.html","text/plain"
    ],
  "static": [
    "--rendertiddler","$:/core/templates/static.template.html","static.html","text/plain",
    "--rendertiddler","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
    "--rendertiddlers","[!is[system]]","$:/core/templates/static.tiddler.html","static","text/plain",
    "--rendertiddler","$:/core/templates/static.template.css","static/static.css","text/plain"
    ]
  }
}

Start your server:

tiddlywiki sWiki --listen

-mario

After the server is started, you need to switch the language setting to French manually

-m

Thank you PMario, this is hugely appreciated.

As for manually selecting French, it can be automated as

tiddlywiki --load french.json

where french.json is