node.js noob questions

105 views
Skip to first unread message

David Gifford

unread,
May 27, 2020, 10:22:30 AM5/27/20
to TiddlyWiki
Hi all

I looked on tiddlywiki.com but didn't see answers to these questions. And digging into the node.js guides would bog me down in irrelevant technical info that probably is not relevant to TiddlyWiki. So I am asking here:

1) Is it possible to have multiple TiddlyWikis open at the same time in node.js? Like maybe one running in 127.0.0.1:8080/ and another running in a separate tab with some other string of numbers than 127.0.0.1:8080/?

2) What would you guys say is the most efficient way to organize uploads of the html files I generate with node.js so that I am not uploading the whole folder of hundreds of tiddler htmls every single time I make changes to a few tiddlers on a daily basis?

Thanks and blessings.

Scott Sauyet

unread,
May 27, 2020, 10:31:00 AM5/27/20
to tiddl...@googlegroups.com
David Gifford wrote: 

> Is it possible to have multiple TiddlyWikis open at the same time in node.js? Like maybe one running in 127.0.0.1:8080/ and another running in a separate tab with some other string of numbers than 127.0.0.1:8080/?

Yes, it's straightforward.

tiddlywiki Folder1 --listen port=8080
tiddlywiki Folder2 --listen port=8081


Then you can open the wiki in Folder1 via http://127.0.0.1:8080 and the one in Folder2 via http://127.0.0.1:8081

(I usually use http://localhost:8080 and http://localhost:8081 instead.  They're most often equivalent.)

  -- Scott

Scott Sauyet

unread,
May 27, 2020, 10:35:42 AM5/27/20
to TiddlyWiki
David Gifford wrote:

> What would you guys say is the most efficient way to organize uploads of the html files I generate with node.js so that I am not uploading the whole folder of hundreds of tiddler htmls every single time I make changes to a few tiddlers on a daily basis?

Are you generating a static site, something with pages like https://tiddlywiki.com/static/WikiText.html?  Or are you generating a whole single-page wiki like https://tiddlywiki.com/ ?

  -- Scott

David Gifford

unread,
May 27, 2020, 10:59:51 AM5/27/20
to tiddl...@googlegroups.com
A static site with individual html pages for each tidder. And thank you for your answer to the other question!




--
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/U2Eif4C077k/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/8c04f646-5fc3-48fb-9d51-c4bec2847af1%40googlegroups.com.

Scott Sauyet

unread,
May 27, 2020, 11:26:17 AM5/27/20
to TiddlyWiki
David Gifford wrote:

> Scott Sauyet wrote:
>> David Gifford wrote:

>>> What would you guys say is the most efficient way to organize uploads of the html files I generate with node.js so that I am not uploading the whole folder of hundreds of tiddler htmls every single time I make changes to a few tiddlers on a daily basis?

>> Are you generating a static site, something with pages like https://tiddlywiki.com/static/WikiText.html?  Or are you generating a whole single-page wiki like https://tiddlywiki.com/ ?

>>> What would you guys say is the most efficient way to organize uploads of the html files I generate with node.js so that I am not uploading the whole folder of hundreds of tiddler htmls every single time I make changes to a few tiddlers on a daily basis?

>> Are you generating a static site, something with pages like https://tiddlywiki.com/static/WikiText.html?  Or are you generating a whole single-page wiki like https://tiddlywiki.com/ ?

A static site with individual html pages for each tidder.

Then it would depend upon how you're uploading them, and also if they all get regenerated every time. If only some of them are generated on a change, then it would depend on details of your upload process.

Most FTP clients have some sort of synchronization setting to allow you to upload only items with a later local timestamp than server one.

If you're using git, it's pretty well built into the workflow.  For instance, things hosted on GitHub Pages, can generally be updated by 

git add .
git commit -m "my explanation for the change"
git push

If it's some manual process, you might be able to sort by recent modification date and compare to the most recent server modification time and simply select the newer ones from your local for uploading.

Sorry I can't be more specific, but it really does depend upon your setup.


And thank you for your answer to the other question!

You're quite welcome.

Cheers,

  -- Scott

David Gifford

unread,
May 27, 2020, 11:35:52 AM5/27/20
to tiddl...@googlegroups.com
Thanks Scott

My current set up is:

1) After editing, ctrl c and y for yes, and enter
2) Hit tiddlywiki --rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain --rendertiddler $:/core/templates/static.template.css static/static.css text/plain and enter
3) Select all the files from the output > html folder and drag them to the proper folder in Filezilla. Overwrite. But my largest file is almost 800 tiddlers.




--
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/U2Eif4C077k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Scott Sauyet

unread,
May 27, 2020, 8:32:26 PM5/27/20
to TiddlyWiki
David Gifford wrote:

>  My current set up is:
> 1) After editing, ctrl c and y for yes, and enter
> 2) Hit tiddlywiki --rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html static text/plain --rendertiddler $:/core/templates/static.template.css static/static.css text/plain and enter
> 3) Select all the files from the output > html folder and drag them to the proper folder in Filezilla. Overwrite. But my largest file is almost 800 tiddlers.

Yes, that will definitely regenerate all the tiddlers.  There is probably some filter you can use to extend the `[!is[system]]` one to only use ones changed after a certain date, but where to store and record that date, I don't know, nor do I know enough about using the TW command line to offer more help.

I'm guessing that this can be done -- perhaps somehow storing the date last run in a tiddler -- but you're getting far beyond my limited TW knowledge, I'm afrais.

Best of luck,

  -- Scott

Scott Kingery

unread,
May 28, 2020, 2:13:29 AM5/28/20
to TiddlyWiki
One thing you might want to try, David, is making a small addition to the tiddlywiki.info in the folder of the wiki you are exporting as static. If you open it in a text editor you can then copy the whole Static section then add a comma to the end of the static section after the ] and paste all the text in right below it. Then, call that section Last2Days or whatever and change the filter. It would look like this:

"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"],
"last2days": [
"--rendertiddler","$:/core/templates/static.template.html","static.html","text/plain",
"--rendertiddler","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
"--rendertiddlers","[!is[system]days[-2]]","$:/core/templates/static.tiddler.html","static","text/plain",
"--rendertiddler","$:/core/templates/static.template.css","static/static.css","text/plain"]

Now, the first time you build your static files you use: 
--build static
which as you know builds all 800 files. Use Filezilla as you do now.

From then on you use 
--build last2days
Now you just use Filezilla to push the much fewer files up to your FTP server.

You could adjust the filter for more or less days and if you do it daily you will of course get the same ones you got the day before but in the end it is still less then refreshing all 800 every time.

Hope it helps,
Scott

David Gifford

unread,
May 28, 2020, 9:30:30 AM5/28/20
to tiddl...@googlegroups.com
Thanks Scott! Will definitely give it a try.




--
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/U2Eif4C077k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages