If you are wanting to manipulate TiddlyWiki from the command line, that should be possible as there are a number of commands built into TiddlyWiki.
Those run to completion and then exit. For example, the command to build a single html file, builds the file, and then exits. The commands available inside a browser's developer tools console are much more interactive. You can create tiddlers there and do just about anything else you would ever want to. There are also a number of headless browsers available for Node development, that is the direction that I would recommend. Most of those are included as part of a node testing strategy: - Zombie <http://zombie.js.org/> - PhantomJS <http://phantomjs.org/> - Selenium <http://www.seleniumhq.org/> - CasperJS <http://casperjs.org/> There are many other headless browsers out there that even use other languages like python or C#. Anything that you would want to do through a browser, you can do with one of these instead. You simply have to pick one that meets your needs the best among the many that are out there. I have used PhantomJS and Selenium in several projects and they work great. Their websites have examples on their use, you can find YouTube videos on their use, and if you search GitHub, you will find that many projects use them in various ways. -Doug On Tuesday, April 4, 2017 at 6:18:26 PM UTC-5, Dan L. wrote: > > 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/>. > > > > Best regards, > > > > Doug > > > > > > On Sunday, April 2, 2017 at 5:29:14 PM UTC-5, Dan L. wrote: > > > > > > My goal is to use TidyWiki as a repository for personal notes and > > > journals (i.e. Evernote). I'm new to using TiddlyWiki, but comfortable > > > with scripting and development. I'd like to get some input from more > > > experienced users on how they approach creating and editing tiddler > > > content (or integrating in general) outside of manually creating > > > tiddlers. > > > > > > The two approaches I could find were editing files directly, and using > > > the REST API. > > > > > > * 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. > > > * Using the REST API (GET/PUT/DELETE) seems straight forward enough > for > > > getting, editing, or creating text based tiddlers. However, it's > > > undocumented so I'm not sure if there's steps I might be missing > > > (updating indexes, etc.) and I'd have to check into how to handle any > > > new content such as images. Also, it seems a browser refresh is also > > > necessary to render any changes. > > > > > > Some examples of things I'd like to do: > > > > > > * Append entries to a day specific tiddler, either automatically (i.e. > I > > > have a simple script to connect/disconnect from my work VPN and open > > > related applications, it could also add lines that have the time and > > > connection/disconnection for time tracking) or manually through the > > > command line. > > > * Poll my Pinboard account for new bookmarks, then create > corresponding > > > Tiddlers in TiddlyWiki, which I may later use for annotations/notes on > > > resources. > > > * Have a daemon watching a directory so if I put a photo in Dropbox > from > > > my phone, it will import it. > > > > -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywikidev. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/9e0c7b35-ef07-4553-b1cc-cec206d5c90a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
