mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-26 17:06:51 +00:00
Get TiddlyWiki5 in the Sky for TiddlyWeb working again
This commit is contained in:
parent
06c5308c4b
commit
4f711efa5d
@ -0,0 +1,23 @@
|
|||||||
|
title: TiddlyWiki5 in the Sky for TiddlyWeb
|
||||||
|
modifier: JeremyRuston
|
||||||
|
tags: edition docs
|
||||||
|
|
||||||
|
The TiddlyWiki5 in the Sky for TiddlyWeb allows content to be synchronised between TiddlyWiki5 running in the browser and a TiddlyWeb (or TiddlySpace) server. Features include:
|
||||||
|
|
||||||
|
* Lazy loading
|
||||||
|
* Two way synchronisation between the browser and the server
|
||||||
|
** Synchronising from the server is accomplished by polling (currently every 60 seconds)
|
||||||
|
* Throttling so that rapidly changing tiddlers don't overwhelm the server
|
||||||
|
|
||||||
|
The implementation is somewhat experimental, and includes these limitations:
|
||||||
|
|
||||||
|
* Only works with tiddlers written in TiddlyWiki5 WikiText. Tiddlers in the old syntax will be parsed as TiddlyWiki5 syntax
|
||||||
|
* New tiddlers are not saved to the server
|
||||||
|
* No way to delete tiddlers
|
||||||
|
|
||||||
|
To try out TiddlyWiki5 in the Sky for TiddlyWeb:
|
||||||
|
|
||||||
|
# If necessary, create an account at http://tiddlyspace.com/
|
||||||
|
# Create a new space, eg `myspace`
|
||||||
|
# Include the space `tw5tiddlyweb`
|
||||||
|
# Visit `http://myspace.tiddlyspace.com/tw5`
|
@ -1,3 +1,3 @@
|
|||||||
title: TiddlerListTemplate
|
title: TiddlerListTemplate
|
||||||
|
|
||||||
<<view title link>> <small><<view type>></small>
|
<$view field="title" format="link"/> <small><$view field="type"/></small>
|
||||||
|
@ -20,19 +20,17 @@ Current [[login status|$:/plugins/tiddlyweb/IsLoggedIn]]: {{$:/plugins/tiddlyweb
|
|||||||
|
|
||||||
Current [[username|$:/plugins/tiddlyweb/UserName]]: {{$:/plugins/tiddlyweb/UserName}}
|
Current [[username|$:/plugins/tiddlyweb/UserName]]: {{$:/plugins/tiddlyweb/UserName}}
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
<<reveal state:[[$:/plugins/tiddlyweb/IsLoggedIn]] type:nomatch text:yes><
|
<$reveal state="$:/plugins/tiddlyweb/IsLoggedIn" type="nomatch" text="yes">
|
||||||
Log in to ~TiddlyWeb: <<button message:login class:"btn btn-info"><Login>>
|
Log in to ~TiddlyWeb: <$button message="tw-login" class="btn btn-info">Login</$button>
|
||||||
>>
|
</$reveal>
|
||||||
<<reveal state:[[$:/plugins/tiddlyweb/IsLoggedIn]] type:match text:yes><
|
<$reveal state="$:/plugins/tiddlyweb/IsLoggedIn" type="match" text="yes">
|
||||||
Log out of ~TiddlyWeb: <<button message:logout class:"btn btn-warning"><Logout>>
|
Log out of ~TiddlyWeb: <$button message="tw-logout" class="btn btn-warning">Logout</$button>
|
||||||
>>
|
</$reveal>
|
||||||
|
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
All tiddlers:
|
All tiddlers:
|
||||||
|
|
||||||
<<list all template:TiddlerListTemplate>>
|
<$list type="all" template="TiddlerListTemplate"/>
|
||||||
|
33
wbld.sh
33
wbld.sh
@ -1,24 +1,29 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# build the TiddlyWeb edition of TiddlyWiki5 and upload to TiddlySpace
|
# build the TiddlyWeb edition of TiddlyWiki5 and upload it to TiddlySpace. Requires the TiddlySpace credentials
|
||||||
|
# of a member of the tw5tiddlyweb space
|
||||||
|
|
||||||
# usage:
|
# usage:
|
||||||
# ./wbld.sh <tiddlyspace username> <tiddlyspace password>
|
# ./wbld.sh <tiddlyspace username> <tiddlyspace password>
|
||||||
|
|
||||||
pushd editions/tw5tiddlyweb > /dev/null
|
# Create the tmp directory if needed
|
||||||
|
|
||||||
node ../../tiddlywiki.js \
|
|
||||||
--verbose \
|
|
||||||
--savetiddler $:/core/templates/tiddlywiki5.template.html ../../../jermolene.github.com/tiddlyweb.html text/plain \
|
|
||||||
|| exit 1
|
|
||||||
|
|
||||||
popd > /dev/null
|
|
||||||
|
|
||||||
mkdir -p tmp
|
mkdir -p tmp
|
||||||
echo "type: text/html" > tmp/tmp.txt
|
|
||||||
echo "" >> tmp/tmp.txt
|
|
||||||
cat ../jermolene.github.com/tiddlyweb.html >> tmp/tmp.txt
|
|
||||||
|
|
||||||
curl -u $1:$2 -X PUT -H "content-type: text/plain" http://tw5tiddlyweb.tiddlyspace.com/bags/tw5tiddlyweb_public/tiddlers/tw5 --data-binary @tmp/tmp.txt
|
# Open the tw5tiddlyweb edition in TW5 and save the template for the main HTML file
|
||||||
|
|
||||||
rm tmp/tmp.txt
|
node ./tiddlywiki.js \
|
||||||
|
editions/tw5tiddlyweb \
|
||||||
|
--verbose \
|
||||||
|
--savetiddler $:/core/templates/tiddlywiki5.template.html tmp/tiddlyweb.html text/plain \
|
||||||
|
|| exit 1
|
||||||
|
|
||||||
|
# Prepend the type information that TiddlyWeb needs to turn the .html file into a .tid file
|
||||||
|
|
||||||
|
echo "type: text/html" > tmp/tiddlerforupload.txt
|
||||||
|
echo "" >> tmp/tiddlerforupload.txt
|
||||||
|
cat tmp/tiddlyweb.html >> tmp/tiddlerforupload.txt
|
||||||
|
|
||||||
|
# Upload the tiddler file
|
||||||
|
|
||||||
|
curl -u $1:$2 -X PUT -H "content-type: text/plain" http://tw5tiddlyweb.tiddlyspace.com/bags/tw5tiddlyweb_public/tiddlers/tw5 --data-binary @tmp/tiddlerforupload.txt
|
||||||
|
Loading…
Reference in New Issue
Block a user