I'm trying to understand how I should go about manipulating tiddlywiki
separate from a browser -- for example, through a command line script or
a cronjob. There doesn't seem an obvious/clean way to do it, so I was
hoping that there might be some advice. I can dream up a couple
approaches (such as using a web browser plugin which lets me trigger
reloads via a network request, or run TiddlyWiki's server with a process
manager that I can restart with a network request), but better to rely
on collective wisdom instead :)
From what you're saying, though, it sounds like I might be better off
rethinking how I'd build integrations into something that fits into
TiddlyWiki's plugin architecture a bit better?
On Tue, Apr 4, 2017, at 03:41, Douglas Counts wrote:
>
> >
> > Directly creating/editing files in the tiddlers directory requires a
> > restart of the nodejs server, followed by a refresh of the browser
> > window, for any changes to go through
> >
>
> You said that you are new to TiddlyWiki, so firstly TiddlyWiki runs as a
> SPA (Single Page Application) within the browser.
>
> The server merely constructs the application and sends it as a solitary
> HTML file to the browser. *All the tiddlers are included* within that
> solitary file. All your content is already contained there. So, the
> application will not see the changes you directly made to the server
> under
> normal circumstances. You would need to fully reload the page anew, thus
> forcing the server to create it anew. But some browsers will cache the
> page, so you may need to force the browser to do a full refresh. If a
> user
> saves the page to their local file system, they don't even need the
> server
> at all unless there are specific links to content there, such as images.
> Again, the entire app/website is contained within that single file that
> was
> served up to the browser.
>
> Lastly, the server and the App both cache things, so if you are using a
> text editor to directly edit the tiddlers externally on the server, then
> there is a good chance that some of these changes will not be visible to
> the server while it is running.
>
> Using the REST API (GET/PUT/DELETE) seems straight forward enough for
> > getting, editing, or creating text based tiddlers. However,
> > it's undocumented
> >
>
> This server.js
> <
https://github.com/Jermolene/TiddlyWiki5/blob/1530b3e2d8d76f39caed56024e7a0d1ecc260354/core/modules/commands/server.js>
> page
> and this libraryserver.js
> <
https://github.com/Jermolene/TiddlyWiki5/blob/ffc0899f52b45ba2b5a5a20fb909dcc587e80b3e/plugins/tiddlywiki/pluginlibrary/libraryserver.js>
> page
> should give you all the information you need if you wish to write your
> own
> mini-client for the server.
>
> Regarding the examples you provided discussing some of your ideas, if you
> know how to write JavaScript inside your browser to do what you want,
> then
> you can do the same within TiddlyWiki. You can either write a plugin, or
> simply save the JavaScript making sure you select the
> `application/javascript` content type when you save that tiddler. The
> JavaScript will then be executable within the browser.
>
> TiddlyWiki has its own Domain Specific Language comprised largely of what
> it calls Widgets, Macros, Actions, Buttons, Messages and more. You can
> find detailed information on the internals of TiddlyWiki by referencing
> the
> developer wiki here <
http://tiddlywiki.com/dev/>.