Hi Gene,

For the specific use case that your video demonstrates, i.e. creating short 
new tiddlers rather than editing existing ones, have you considered the 
following workflow:

- don't write your newly created tiddler files to the wiki directory.
- instead have vim do a PUT request with cURL to the tiddlywiki to save the 
tiddler.

API: 
https://tiddlywiki.com/#WebServer%20API%3A%20Put%20Tiddler:%5B%5BWebServer%20API%3A%20Put%20Tiddler%5D%5D

Example:

curl -X PUT -i 'http://192.168.0.12:8080/recipes/default/tiddlers/
NewTiddlerTitle' --data '{
 "tags": "firstTag anotherTag",
 "creator": "gene",
 "modifier": "gene",
 "text": "The use of knowledge in society"
}' -H "X-Requested-With: TiddlyWiki"

I don't use VIM myself but as far as I know it can execute bash scripts so 
you could set one up to do the PUT with cURL. Alternatively there seem to 
be VIM plugins specifically for interacting with APIs.

Cheers,
Saq

On Tuesday, July 6, 2021 at 10:21:56 PM UTC+2 [email protected] 
wrote:

> Sorry for delay in response, my first attempt seemed not to get picked up 
> by Google Groups.
>
> Anyway, I appreciate the reply; your set up sounds a lot more 
> sophisticated.  I too will use the new version as a prompt to see if I can 
> refine how I'm doing this, nodemon is fine but definitely feels slightly 
> kludgy.
>
> NB - I've added a video to my original blog post, realised my description 
> of creating tiddlers from the command line is clearer when you can see it.
>
> Yours
> Gene
>
> On Sunday, July 4, 2021 at 6:41:32 PM UTC+1 [email protected] wrote:
>
>> That is a very interesting setup, thank you for taking the time to share 
>> it.
>>
>> My use case for notes also involves interacting with them via text 
>> editors and other tools as well as  having them in TiddlyWiki. What I set 
>> up a few years back was a combo of fswatch + cURL + the tiddlywiki server 
>> API. Watching for file system changes wasn't as reliable at the time so the 
>> setup was a bit finicky and tricky to get it right. So I've never fiddled 
>> with the config or even upgraded the wiki once I had it working.
>>
>> The next version of TW includes a server sent events feature with which 
>> tiddlers propagate from the server to client almost instantly, so that will 
>> be my queue to upgrade that wiki. I will need to consider if moving to 
>> nodemon might make sense as well, I use it for TW dev at the moment and it 
>> does seem to work well enough.
>>
>> Cheers,
>> Saq 
>>
>> On Sunday, July 4, 2021 at 3:27:35 PM UTC+2 [email protected] 
>> wrote:
>>
>>> I hesitate slightly in posting to this group as my use case covers such 
>>> a niche audience, I'm not sure how much utility there is in sharing it.  
>>> However in short I wanted to host a TiddlyWiki on a Raspberry Pi, create 
>>> tiddlers from the command line and edit them with vim.  Once I figured out 
>>> how to do that I thought I'd blog about it (mostly so I can retrace my 
>>> steps later on):
>>>
>>>
>>> https://www.preciouschicken.com/blog/posts/tiddlywiki5-raspberry-pi-guide/
>>>
>>> I'm not sure the nodemon hack will be required in future, I think I read 
>>> another thread suggesting that this form of updating functionality might be 
>>> built in (though I could have got that wrong)?
>>>
>>> Many thanks to the creator and the maintainers of TiddlyWiki.  Really 
>>> enjoy using and playing around with it.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/1a6d434d-a720-47a7-8ea1-d7de680953b7n%40googlegroups.com.

Reply via email to