Upload Tiddlers to Tiddlywiki Directly from Vim with Vimscript

60 views
Skip to first unread message

leeand00

unread,
Jun 1, 2017, 5:33:20 PM6/1/17
to TiddlyWiki
Dear Tiddlywiki Community,

I got tired of scrolling up, and scrolling down, adding a parent tag and adding the attributes caption, and order so that I could put tiddlers in a parent tiddler in the tab macro in order;  I also tried writing json imports, and I got tired of dragging and dropping them to import them, so I decided it would be best to just use my buffer in vim and a mapped function in vimscript to import them directly.  (Oh, and ssh), you can find it here in my .vimrc file: https://github.com/leeand00/dotfiles/blob/master/dotfiles/.vimrc the function is named TW5GenNUpload(txtFile, user, host, wikipath)
    
Below are my notes for using it, enjoy!

    Inputs wiki text for multiple tiddlers from vim
    directly into specified Tiddlywiki 5 node.js installation.
    
    Advantages:
    - NO MORE dragging and dropping json files to your wiki.
    - NO MORE scrolling up and down to add captions, order, and tags to
              your tiddlers for the the tab macro.
    
    Dependencies: jq must be installed and available on your path in bash.
    
    Best Practices:
    - Use an ssh-agent and an ssh public/private key to avoid typing your
      password everytime.
     (see attached sample upload document for how to set that up)
    - Map the function call for the document you are working on (local
      machine) and host (remote server) to a function key in .vimrc.
    
    More Detail:
    1. jq reads the contents of the specified text file into a json file
       of tiddlers stored in a local temp file.
    
    2. The temp json file is then uploaded to the Tiddlywiki5 host in
       the same temp directory as was created on the local host.
    
    3. The Tiddlywiki 5 node executable is then called on the remote server
       and the json temp file tiddlers are loaded into Tiddlywiki 5.
    
    4. Restart the specified Tiddlywiki 5 instance and load it up in your


Thank you,
Reply all
Reply to author
Forward
0 new messages