Hi Stephan > What I'd like to create is a means to save the static HTML of a tiddler. At the moment I did it by
1. Adding a new route to the SimpleServer by patching server.js 2. Adding a "Publish" button to the view toolbar Just to be clear, is your intended use case that one clicks "publish" on a tiddler in the browser and that triggers the server to save an HTML snapshot of that tiddler into a folder on the server? > Moreover the path where the static html is saved is, at the moment, hard coded in server.js. This is the part that confused me; server.js doesn't save static HTML files. And is your eventual goal to be able to edit a TW in the browser with the server automatically updating a folder of static HTML copies of certain tiddlers? Most of the pieces required to do this are now present, but not connected together. There is no mechanism at present to implement a "publish" button in the browser that triggers an action on the server. We'd probably need something like http://socket.io Right now, I have a manual version of your workflow for publishing to tiddlywiki.com: I make changes with ./serve.sh and then create a snapshot for publication with ./bld.sh, which then gets published with ./deploy.sh. If we were to make it an automated sync process I don't think we'd want to update the static snapshots on every tiddler update. We'd probably want to track invalid snapshots and then sync them to the file system periodically. Best wishes Jeremy. On Fri, Mar 21, 2014 at 7:20 PM, Stephan Hradek <[email protected]>wrote: > I already mentioned it in the other group, but I think, this is a better > place. > > What I'd like to create is a means to save the static HTML of a tiddler. > At the moment I did it by > > > 1. Adding a new route to the SimpleServer by patching server.js > 2. Adding a "Publish" button to the view toolbar > > But this is an awful hack, I think, as I had to change server.js as I did > not know the proper way to extend the servers routes from a plugin. Is > there any way? > > Additionally the user receives, as a result after clicking on the publish > button the static HTML and not a "success" or "failure" message as I could > not find out yet how to respond with a popup message ("Tiddler saved") or > something like that. So at the moment the user always sees some static HTML > but does not know whether saving worked. > > Moreover the path where the static html is saved is, at the moment, hard > coded in server.js. What would be a proper way to place such a > configuration value? > > But what I would like to be able to do is, to find a way to automatically > save the static HTML of a tiddler each time the tiddelr was edited. Not by > adding a button for "publishing". Maybe even filtered by tags, so just when > the tiddler has a certain tag, that HTML is saved. How would I add this > with a plugin? Where can I find "hooks" to use? > > Can anyone (I gues just Jeremy or Mario?) can give me guidance here, right? > > -- > 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 http://groups.google.com/group/tiddlywikidev. > For more options, visit https://groups.google.com/d/optout. > -- Jeremy Ruston mailto:[email protected] -- 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 http://groups.google.com/group/tiddlywikidev. For more options, visit https://groups.google.com/d/optout.
