instiki-cli is a tiny tool to edit Instiki wikis using a local editor. Use it like this:
$ export INSTIKI_AUTHOR="Emmy Noether" $ instiki-cli https://golem.ph.utexas.edu/wiki/instiki/show/Sandbox * Changes will be signed as "Emmy Noether". * Fetching https://golem.ph.utexas.edu/wiki/instiki/show/Sandbox... done. * Waiting for changes, go edit file "Sandbox" or abort with ^C...
--- /dev/stdin 2016-03-26 17:41:12.383587226 +0100 +++ Sandbox 2016-03-26 17:41:12.195587230 +0100 @@ -1005,4 +1005,4 @@ * item2 * item3 * item4 -* item70000 +* item5 * Accept (y/n)? y * Saving changes... done.
…the cycle continues…
* Fetching https://golem.ph.utexas.edu/wiki/instiki/show/Sandbox... done. * Waiting for changes, go edit file "Sandbox" or abort with ^C...
I wrote the tool specifically to be able to edit the nLab more comfortably, but instiki-cli should work with any Instiki installation. It's for editing single entries only and cannot be used to mirror a wiki (or even keep it synchronized).
- Pushing to the wiki is triggered by saving the file.
- instiki-cli shows a diff of the local changes and asks for confirmation before pushing. That way unintended changes like accidental truncations of the file don't find their way to the wiki.
- Before pushing changes, instiki-cli checks whether the entry on the wiki has changed in the meantime and aborts if that's the case.
- Perl 5 and some Perl modules. On Debian-based distributions, these can be
apt-get install libfile-slurp-perl libhtml-parser-perl libhttp-cookies-perl libhttp-message-perl libwww-perl.
apt-get install nodejson Debian-based distributions and ensure that
- The standard Unix tool
[Check exactly how similar using It's All Text! in combination with emacsclient is.]
Working with terminal multiplexers like screen
The following simple-minded script starts instiki-cli in the current screen window and opens the editor in a new window as soon as the entry has been downloaded.
#!/bin/bash wikidir=~/wiki # change to your needs screen bash -c ' file="`basename "$1"`" echo "* Waiting for \"$file\" to become available..." cd "$0" while :; do sleep 0.1 [ -e "$file" ] && break done vim -c "set tw=0" "$file" ' "$wikidir" "$1" cd "$wikidir" instiki-cli "$1"
- instiki-cli creates (or overwrites) a file in the current directory. Therefore you shouldn't run instiki-cli on untrusted input.
instiki-cli was written for my personal use. It is not polished in any way.
You can (and are invited to) use, redistribute and modify instiki-cli under the terms of the GNU General Public License (GPL), version 3 or (at your option) any later version published by the Free Software Foundation.