From 97feef89097c98d69b23978993c5255fd50a8591 Mon Sep 17 00:00:00 2001 From: Adrian Sampaleanu Date: Sun, 17 Nov 2013 17:54:12 -0500 Subject: [PATCH] Added Windows specific build scripts. Added equivalent scripts for all .sh files and modified appropriate tiddlers to generate updated readme.md for the GitHub site. --- 2bld.cmd | 32 +++++++ bld.cmd | 96 +++++++++++++++++++ bld.sh | 2 +- deploy.cmd | 17 ++++ editions/tw5.com/tiddlers/HelloThere.tid | 6 +- .../editions/TiddlyWiki5_Node_Edition.tid | 44 ++++----- editions/tw5.com/tiddlers/readme/ReadMe.tid | 2 +- ginsu.cmd | 15 +++ licenses/cla-individual.md | 3 + readme.md | 8 +- serve.cmd | 11 +++ test.cmd | 19 ++++ verbump.cmd | 13 +++ wbld.cmd | 29 ++++++ 14 files changed, 263 insertions(+), 34 deletions(-) create mode 100644 2bld.cmd create mode 100644 bld.cmd create mode 100644 deploy.cmd create mode 100644 ginsu.cmd create mode 100644 serve.cmd create mode 100644 test.cmd create mode 100644 verbump.cmd create mode 100644 wbld.cmd diff --git a/2bld.cmd b/2bld.cmd new file mode 100644 index 000000000..2abdf1f91 --- /dev/null +++ b/2bld.cmd @@ -0,0 +1,32 @@ +@echo off + +rem build TiddlyWiki 2.x + +rem create a temporary directory if it doesn't already exist +setlocal enableextensions +mkdir tmp\tw2 +setlocal disableextensions + +rem Delete any existing content + +del /q /s tmp\tw2 +echo. + +rem Prepare the readme file from the revelant content in the tw5.com wiki + +node .\tiddlywiki.js ^ + editions\tw5.com ^ + --verbose ^ + --rendertiddler TiddlyWiki2ReadMe editions\tw2\readme.md text/html ^ + || exit 1 + +rem cook the TiddlyWiki 2.x.x index file + +node .\tiddlywiki.js ^ + editions\tw2 ^ + --verbose ^ + --load editions\tw2\source\tiddlywiki.com\index.html.recipe ^ + --rendertiddler $:/core/templates/tiddlywiki2.template.html .\tmp\tw2\index.html text/plain ^ + || exit 1 + +fc tmp\tw2\index.html editions\tw2\target\prebuilt.html diff --git a/bld.cmd b/bld.cmd new file mode 100644 index 000000000..3511cd541 --- /dev/null +++ b/bld.cmd @@ -0,0 +1,96 @@ +@echo off + +rem build TiddlyWiki5 for five.tiddlywiki.com + +rem Set up the build output directory + +if "x%TW5_BUILD_OUTPUT%" == "x" (set TW5_BUILD_OUTPUT=..\jermolene.github.com) + +if not exist %TW5_BUILD_OUTPUT%\nul echo A valid TW5_BUILD_OUTPUT environment variable must be set + +echo Using TW5_BUILD_OUTPUT as %TW5_BUILD_OUTPUT% +echo. + +rem Create the `static` directory if necessary + +setlocal enableextensions +mkdir %TW5_BUILD_OUTPUT%\static +setlocal disableextensions + +rem Delete any existing content + +del /q /s %TW5_BUILD_OUTPUT%\static + +rem First, +rem readme.md: the readme file for GitHub +rem index.html: the main file, including content +rem static.html: the static version of the default tiddlers + +node .\tiddlywiki.js ^ + .\editions\tw5.com ^ + --verbose ^ + --rendertiddler ReadMe .\readme.md text/html ^ + --rendertiddler ContributingTemplate .\contributing.md text/html ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\index.html text/plain ^ + --rendertiddler $:/core/templates/static.template.html %TW5_BUILD_OUTPUT%\static.html text/plain ^ + --rendertiddler $:/core/templates/static.template.css %TW5_BUILD_OUTPUT%\static\static.css text/plain ^ + --rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html %TW5_BUILD_OUTPUT%\static text/plain ^ + || exit 1 + +rem Second, encrypted.html: a version of the main file encrypted with the password "password" + +node .\tiddlywiki.js ^ + .\editions\tw5.com ^ + --verbose ^ + --password password ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\encrypted.html text/plain ^ + || exit 1 + +rem Third, empty.html: empty wiki for reuse + +node .\tiddlywiki.js ^ + .\editions\empty ^ + --verbose ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\empty.html text/plain ^ + || exit 1 + +rem Fourth, tahoelafs.html: empty wiki with plugin for Tahoe-LAFS + +node .\tiddlywiki.js ^ + .\editions\tahoelafs ^ + --verbose ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\tahoelafs.html text/plain ^ + || exit 1 + +rem Fifth, d3demo.html: wiki to demo d3 plugin + +node .\tiddlywiki.js ^ + .\editions\d3demo ^ + --verbose ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\d3demo.html text/plain ^ + || exit 1 + +rem Sixth, codemirrordemo.html: wiki to demo codemirror plugin + +node .\tiddlywiki.js ^ + .\editions\codemirrordemo ^ + --verbose ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\codemirrordemo.html text/plain ^ + || exit 1 + +rem Seventh, codemirrordemo.html: wiki to demo codemirror plugin + +node .\tiddlywiki.js ^ + .\editions\markdowndemo ^ + --verbose ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\markdowndemo.html text/plain ^ + || exit 1 + + +rem Make the CNAME file that GitHub Pages requires + +echo five.tiddlywiki.com > %TW5_BUILD_OUTPUT%\CNAME + +rem Eighth, run the test edition to run the Node.js tests and to generate test.html for tests in the browser + +.\test.cmd diff --git a/bld.sh b/bld.sh index fb3333a0f..5e6555dd5 100755 --- a/bld.sh +++ b/bld.sh @@ -92,6 +92,6 @@ node ./tiddlywiki.js \ --rendertiddler $:/core/templates/tiddlywiki5.template.html $TW5_BUILD_OUTPUT/markdowndemo.html text/plain \ || exit 1 -# Eighth, run the test edition to run the node.js tests and to generate test.html for tests in the browser +# Eighth, run the test edition to run the Node.js tests and to generate test.html for tests in the browser ./test.sh diff --git a/deploy.cmd b/deploy.cmd new file mode 100644 index 000000000..3edfdd82b --- /dev/null +++ b/deploy.cmd @@ -0,0 +1,17 @@ +@echo + +rem Publish to NPM + +npm publish || exit 1 + +rem Deploy latest build to github + +pushd ..\mytiddlywiki.github.com + +git add --all || exit 1 + +git commit -m "Updates" || exit 1 + +git push origin || exit 1 + +popd diff --git a/editions/tw5.com/tiddlers/HelloThere.tid b/editions/tw5.com/tiddlers/HelloThere.tid index 3b764fb45..5a1ba40f9 100644 --- a/editions/tw5.com/tiddlers/HelloThere.tid +++ b/editions/tw5.com/tiddlers/HelloThere.tid @@ -1,12 +1,12 @@ created: 201308221702000 creator: JeremyRuston -modified: 201311091512009 -modifier: JeremyRuston +modified: 201311171740 +modifier: AdrianSampaleanu tags: introduction title: HelloThere type: text/vnd.tiddlywiki -Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the non-linear personal web notebook first released in 2004. It is a complete interactive wiki in JavaScript that can be run from a single HTML file in the browser or as a powerful [[node.js application|node.js]]. +Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the non-linear personal web notebook first released in 2004. It is a complete interactive wiki in JavaScript that can be run from a single HTML file in the browser or as a powerful [[Node.js application|node.js]]. This is TiddlyWiki5 version //<>//. It is drawing to the end of the alpha phase, meaning it is almost ready for everyday use. It is a great time to get involved and support its [[future development|RoadMap]]: diff --git a/editions/tw5.com/tiddlers/editions/TiddlyWiki5_Node_Edition.tid b/editions/tw5.com/tiddlers/editions/TiddlyWiki5_Node_Edition.tid index f1d8c7cc3..3e804bb02 100644 --- a/editions/tw5.com/tiddlers/editions/TiddlyWiki5_Node_Edition.tid +++ b/editions/tw5.com/tiddlers/editions/TiddlyWiki5_Node_Edition.tid @@ -1,7 +1,7 @@ created: 201308252145 creator: JeremyRuston -modified: 201308252145 -modifier: JeremyRuston +modified: 201311171740 +modifier: AdrianSampaleanu tags: edition title: TiddlyWiki5 Node Edition @@ -25,25 +25,25 @@ The commands and their individual arguments follow, each command being identifie node tiddlywiki.js [] [-- [[,]]] ``` -!! Batch Files +!! Script Files -For trying TiddlyWiki5 out under node.js, several batch files are provided: +For trying TiddlyWiki5 out under Node.js, several scripts are provided (.sh for *nix and .cmd for Windows): -!!! `bld.sh` builds tw5.com +!!! `bld`: builds tw5.com -This batch file builds several variants of TiddlyWiki5 for deployment on tiddlywiki.com. +This script builds several variants of TiddlyWiki5 for deployment on tiddlywiki.com. -By default, files are output to a folder called `jermolene.github.com` in the same directory as the main TiddlyWiki5 directory. You will need to create the directory before running the batch file. For example: +By default, files are output to a folder called `jermolene.github.com`, sibling to the to the TiddlyWiki5 source directory. For example: ``` -* /TiddlyWork/ - Directory for working with TiddlyWiki5 -* /TiddlyWork/TiddlyWiki5/ - Directory containing the TiddlyWiki5 repo from GitHub -* /TiddlyWork/jermolene.github.com/ - Directory for output files +/TiddlyWork/ - Directory for working with TiddlyWiki5 + /TiddlyWiki5/ - Directory containing the TiddlyWiki5 repo from GitHub + /jermolene.github.com/ - Directory for output files ``` -You can override the build output directory by defining the environment variable `TW5_BUILD_OUTPUT`. The easiest way to do this is to create a personal batch file to invoke TiddlyWiki5 that first sets the environment variable and then invokes `bld.sh`. +You can override the build output directory by defining the environment variable `TW5_BUILD_OUTPUT`. The easiest way to do this is to create a personal batch file to invoke TiddlyWiki5 that first sets the environment variable and then invokes `bld`. -The files output by `bld.sh` are: +The files output by `bld` are: * `readme.md` main readme file, output to the TiddlyWiki5 directory * `index.html` TiddlyWiki5 standalone HTML file with content from the `tw5.com` edition @@ -53,29 +53,23 @@ The files output by `bld.sh` are: * `static.html` static HTML version of the DefaultTiddlers of the `tw5.com` edition * `static/*.html` and `static/static.css` static HTML versions of individual tiddlers -`bld.sh` also runs the TiddlyWiki5 node.js-based test suite (see TestingMechanism) +`bld` also runs the TiddlyWiki5 Node.js-based test suite (see TestingMechanism) -!!! `serve.sh` serves tw5.com +!!! `serve.sh ` or `serve.cmd `: serves tw5.com -This batch file starts TiddlyWiki5 running as an HTTP server with the content from the `clientserver` edition. By default, the script serves on port 8080. - -``` -./server.sh UserName -``` - -The single parameter to the script is the username to use for signing edits. +This script starts TiddlyWiki5 running as an HTTP server with the content from the `clientserver` edition. By default, the Node.js serves on port 8080. If the optional `username` parameter is provided, it is used for signing edits. To experiment with this configuration, run the script and then visit `http://0.0.0.0:8080` in a browser. Changes made in the browser propagate to the server over HTTP (use the browser developer console to see these requests). The server then syncs changes to the file system (and logs each change to the screen). -!!! `wbld.sh` builds TiddlyWiki5 for TiddlyWeb +!!! `wbld`: builds TiddlyWiki5 for TiddlyWeb -This batch file builds and deploys the code for [[TiddlyWiki5 in the Sky for TiddlyWeb]]. If you want to experiment with your own builds of TiddlyWiki5 for TiddlyWeb you could use this batch file as a base. +This script builds and deploys the code for [[TiddlyWiki5 in the Sky for TiddlyWeb]]. If you want to experiment with your own builds of TiddlyWiki5 for TiddlyWeb you could use this batch file as a base. -!!! `2bld.sh` builds TiddlyWiki 2.6.5 +!!! `2bld`: builds TiddlyWiki 2.6.5 -This batch file builds TiddlyWiki 2.6.5 from the original source and then uses the `opendiff` program to display the differences between them. +This script builds TiddlyWiki 2.6.5 from the original source and then displays the differences between them (`diff` is used for *nix, `fc` for Windows). !!Commands diff --git a/editions/tw5.com/tiddlers/readme/ReadMe.tid b/editions/tw5.com/tiddlers/readme/ReadMe.tid index b906f614d..1cf0e8aa8 100644 --- a/editions/tw5.com/tiddlers/readme/ReadMe.tid +++ b/editions/tw5.com/tiddlers/readme/ReadMe.tid @@ -5,7 +5,7 @@ title: ReadMe {{HelloThere}} -! Getting started with TiddlyWiki under node.js +! Getting started with TiddlyWiki under Node.js {{TiddlyWiki5 Node Edition}} diff --git a/ginsu.cmd b/ginsu.cmd new file mode 100644 index 000000000..8ccfefcd9 --- /dev/null +++ b/ginsu.cmd @@ -0,0 +1,15 @@ +@echo + +rem Split the tiddlers out of a TiddlyWiki file + +setlocal enableextensions +mkdir tmp\ginsu +setlocal disableextensions + +node .\tiddlywiki.js ^ + .\editions\empty ^ + --verbose ^ + --load %1 ^ + --rendertiddler $:/core/templates/split-recipe tmp\ginsu\split.recipe text/plain ^ + --rendertiddlers [!is[system]] $:/core/templates/tid-tiddler tmp\ginsu text/plain .tid ^ + || exit 1 diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md index 6200ad6d4..2ca6de3f0 100644 --- a/licenses/cla-individual.md +++ b/licenses/cla-individual.md @@ -116,3 +116,6 @@ Tobias Beer, @tobibeer, 2013/09/21 Nate Cain, @natecain, 2013/09/30 Bob Robison, @grayeul, 2013/11/11 + +Adrian Sampaleanu, @asampal, 2013/11/17 + diff --git a/readme.md b/readme.md index 424076786..d77e7f85b 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,5 @@ -

Welcome to TiddlyWiki5

Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the non-linear personal web notebook first released in 2004. It is a complete interactive wiki in JavaScript that can be run from a single HTML file in the browser or as a powerful node.js application.

This is TiddlyWiki5 version 5.0.0-alpha.16-prerelease. It is drawing to the end of the alpha phase, meaning it is almost ready for everyday use. It is a great time to get involved and support its future development:

TiddlyWiki is a free, open source project that depends on your love and support for its survival -

Getting started with TiddlyWiki under node.js

TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on tiddlers, TiddlyWikiFolders, TiddlerFiles and TiddlyWikiFiles. For example, the following command loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:

node tiddlywiki.js --verbose --load mywiki.html --rendertiddler ReadMe ./readme.html

In order to use TiddlyWiki5 on the command line you must first install node.js from http://nodejs.org/

Usage

Running tiddlywiki.js from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.

The first argument is the optional path to the TiddlyWikiFolder to be loaded. If not present, then the current directory is used.

The commands and their individual arguments follow, each command being identified by the prefix --.

node tiddlywiki.js [<wikipath>] [--<command> [<arg>[,<arg>]]]

Batch Files

For trying TiddlyWiki5 out under node.js, several batch files are provided:

bld.sh builds tw5.com

This batch file builds several variants of TiddlyWiki5 for deployment on tiddlywiki.com.

By default, files are output to a folder called jermolene.github.com in the same directory as the main TiddlyWiki5 directory. You will need to create the directory before running the batch file. For example:

* /TiddlyWork/ - Directory for working with TiddlyWiki5
-* /TiddlyWork/TiddlyWiki5/ - Directory containing the TiddlyWiki5 repo from GitHub
-* /TiddlyWork/jermolene.github.com/ - Directory for output files

You can override the build output directory by defining the environment variable TW5_BUILD_OUTPUT. The easiest way to do this is to create a personal batch file to invoke TiddlyWiki5 that first sets the environment variable and then invokes bld.sh.

The files output by bld.sh are:

  • readme.md main readme file, output to the TiddlyWiki5 directory
  • index.html TiddlyWiki5 standalone HTML file with content from the tw5.com edition
  • empty.html TiddlyWiki5 standalone HTML file with no content
  • encrypted.html TiddlyWiki5 standalone HTML file encrypted with the password password
  • test.html TiddlyWiki5 browser-based test suite (see TestingMechanism)
  • static.html static HTML version of the DefaultTiddlers of the tw5.com edition
  • static/*.html and static/static.css static HTML versions of individual tiddlers

bld.sh also runs the TiddlyWiki5 node.js-based test suite (see TestingMechanism)

serve.sh serves tw5.com

This batch file starts TiddlyWiki5 running as an HTTP server with the content from the clientserver edition. By default, the script serves on port 8080.

./server.sh UserName

The single parameter to the script is the username to use for signing edits.

To experiment with this configuration, run the script and then visit http://0.0.0.0:8080 in a browser.

Changes made in the browser propagate to the server over HTTP (use the browser developer console to see these requests). The server then syncs changes to the file system (and logs each change to the screen).

wbld.sh builds TiddlyWiki5 for TiddlyWeb

This batch file builds and deploys the code for TiddlyWiki5 in the Sky for TiddlyWeb. If you want to experiment with your own builds of TiddlyWiki5 for TiddlyWeb you could use this batch file as a base.

2bld.sh builds TiddlyWiki 2.6.5

This batch file builds TiddlyWiki 2.6.5 from the original source and then uses the opendiff program to display the differences between them.

Commands

The following commands are available:

LoadCommand

Load tiddlers from 2.x.x TiddlyWiki files (.html), .tiddler, .tid, .json or other files

--load <filepath>

PasswordCommand

Set a password for subsequent crypto operations

--password <password>

PrintCommand

The print command outputs specified information.

print tiddlers

Output the titles of the tiddlers in the wiki store

--print tiddlers

print tiddler

Print the fields of an individual tiddler

--print tiddler <title>

print system

Print the titles of the system tiddlers in the wiki store

--print system

print config

Print the current core configuration

--print config

RenderTiddlerCommand

Render an individual tiddler as a specified ContentType, defaults to text/html and save it to the specified filename

--rendertiddler <title> <filename> [<type>]

RenderTiddlersCommand

Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to text/html) and extension (defaults to .html).

--rendertiddlers <filter> <template> <pathname> [<type>] [<extension>]

For example:

--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain

ServerCommand

The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage - in particular, TiddlyWiki5 is an old-school wiki in the sense that it offers no authentication.

At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for GET, PUT and DELETE.

--server <port> <roottiddler> <rendertype> <servetype> <username>

The parameters are:

  • port - port number to serve from (defaults to "8080")
  • roottiddler - the tiddler to serve at the root (defaults to "$:/core/tiddlywiki5.template.html")
  • rendertype - the content type to which the root tiddler should be rendered (defaults to "text/plain")
  • servetype - the content type with which the root tiddler should be served (defaults to "text/html")
  • username - the default username for signing edits

For example:

--server 8080 $:/core/tiddlywiki5.template.html text/plain text/html MyUserName

VerboseCommand

Triggers verbose output, useful for debugging

--verbose

VersionCommand

Displays the version number of TiddlyWiki.

--version

This readme file was automatically generated by TiddlyWiki5 +

Welcome to TiddlyWiki5

Welcome to TiddlyWiki5, a reboot of TiddlyWiki, the non-linear personal web notebook first released in 2004. It is a complete interactive wiki in JavaScript that can be run from a single HTML file in the browser or as a powerful Node.js application.

This is TiddlyWiki5 version 5.0.0-alpha.16-prerelease. It is drawing to the end of the alpha phase, meaning it is almost ready for everyday use. It is a great time to get involved and support its future development:

TiddlyWiki is a free, open source project that depends on your love and support for its survival +

Getting started with TiddlyWiki under Node.js

TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on tiddlers, TiddlyWikiFolders, TiddlerFiles and TiddlyWikiFiles. For example, the following command loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:

node tiddlywiki.js --verbose --load mywiki.html --rendertiddler ReadMe ./readme.html

In order to use TiddlyWiki5 on the command line you must first install node.js from http://nodejs.org/

Usage

Running tiddlywiki.js from the command line boots the TiddlyWiki kernel, loads the core plugins and establishes an empty wiki store. It then sequentially processes the command line arguments from left to right. The arguments are separated with spaces.

The first argument is the optional path to the TiddlyWikiFolder to be loaded. If not present, then the current directory is used.

The commands and their individual arguments follow, each command being identified by the prefix --.

node tiddlywiki.js [<wikipath>] [--<command> [<arg>[,<arg>]]]

Script Files

For trying TiddlyWiki5 out under Node.js, several scripts are provided (.sh for *nix and .cmd for Windows):

bld: builds tw5.com

This script builds several variants of TiddlyWiki5 for deployment on tiddlywiki.com.

By default, files are output to a folder called tiddlywiki5.github.com, sibling to the to the TiddlyWiki5 source directory. For example:

/TiddlyWork/ - Directory for working with TiddlyWiki5
+	/TiddlyWiki5/ - Directory containing the TiddlyWiki5 repo from GitHub
+	/tiddlywiki5.github.com/ - Directory for output files

You can override the build output directory by defining the environment variable TW5_BUILD_OUTPUT. The easiest way to do this is to create a personal batch file to invoke TiddlyWiki5 that first sets the environment variable and then invokes bld.

The files output by bld are:

  • readme.md main readme file, output to the TiddlyWiki5 directory
  • index.html TiddlyWiki5 standalone HTML file with content from the tw5.com edition
  • empty.html TiddlyWiki5 standalone HTML file with no content
  • encrypted.html TiddlyWiki5 standalone HTML file encrypted with the password password
  • test.html TiddlyWiki5 browser-based test suite (see TestingMechanism)
  • static.html static HTML version of the DefaultTiddlers of the tw5.com edition
  • static/*.html and static/static.css static HTML versions of individual tiddlers

bld also runs the TiddlyWiki5 Node.js-based test suite (see TestingMechanism)

serve.sh <username> or serve.cmd <username>: serves tw5.com

This script starts TiddlyWiki5 running as an HTTP server with the content from the clientserver edition. By default, the Node.js serves on port 8080. If the optional username parameter is provided, it is used for signing edits.

To experiment with this configuration, run the script and then visit http://0.0.0.0:8080 in a browser.

Changes made in the browser propagate to the server over HTTP (use the browser developer console to see these requests). The server then syncs changes to the file system (and logs each change to the screen).

wbld: builds TiddlyWiki5 for TiddlyWeb

This script builds and deploys the code for TiddlyWiki5 in the Sky for TiddlyWeb. If you want to experiment with your own builds of TiddlyWiki5 for TiddlyWeb you could use this batch file as a base.

2bld: builds TiddlyWiki 2.6.5

This script builds TiddlyWiki 2.6.5 from the original source and then displays the differences between them (diff is used for *nix, fc for Windows).

Commands

The following commands are available:

LoadCommand

Load tiddlers from 2.x.x TiddlyWiki files (.html), .tiddler, .tid, .json or other files

--load <filepath>

PasswordCommand

Set a password for subsequent crypto operations

--password <password>

PrintCommand

The print command outputs specified information.

print tiddlers

Output the titles of the tiddlers in the wiki store

--print tiddlers

print tiddler

Print the fields of an individual tiddler

--print tiddler <title>

print system

Print the titles of the system tiddlers in the wiki store

--print system

print config

Print the current core configuration

--print config

RenderTiddlerCommand

Render an individual tiddler as a specified ContentType, defaults to text/html and save it to the specified filename

--rendertiddler <title> <filename> [<type>]

RenderTiddlersCommand

Render a set of tiddlers matching a filter to separate files of a specified ContentType (defaults to text/html) and extension (defaults to .html).

--rendertiddlers <filter> <template> <pathname> [<type>] [<extension>]

For example:

--rendertiddlers [!is[system]] $:/core/templates/static.tiddler.html ./static text/plain

ServerCommand

The server built in to TiddlyWiki5 is very simple. Although compatible with TiddlyWeb it doesn't support many of the features needed for robust Internet-facing usage - in particular, TiddlyWiki5 is an old-school wiki in the sense that it offers no authentication.

At the root, it serves a rendering of a specified tiddler. Away from the root, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for GET, PUT and DELETE.

--server <port> <roottiddler> <rendertype> <servetype> <username>

The parameters are:

  • port - port number to serve from (defaults to "8080")
  • roottiddler - the tiddler to serve at the root (defaults to "$:/core/tiddlywiki5.template.html")
  • rendertype - the content type to which the root tiddler should be rendered (defaults to "text/plain")
  • servetype - the content type with which the root tiddler should be served (defaults to "text/html")
  • username - the default username for signing edits

For example:

--server 8080 $:/core/tiddlywiki5.template.html text/plain text/html MyUserName

VerboseCommand

Triggers verbose output, useful for debugging

--verbose

VersionCommand

Displays the version number of TiddlyWiki.

--version

This readme file was automatically generated by TiddlyWiki5

\ No newline at end of file diff --git a/serve.cmd b/serve.cmd new file mode 100644 index 000000000..e50320e61 --- /dev/null +++ b/serve.cmd @@ -0,0 +1,11 @@ +@echo off + +rem serve TiddlyWiki5 over HTTP + +rem Optional parameter is the username for signing edits + +node .\tiddlywiki.js ^ + editions\clientserver ^ + --verbose ^ + --server 8080 $:/core/templates/tiddlywiki5.template.html text/plain text/html %1^ + || exit 1 diff --git a/test.cmd b/test.cmd new file mode 100644 index 000000000..8954d182a --- /dev/null +++ b/test.cmd @@ -0,0 +1,19 @@ +@echo off + +rem test TiddlyWiki5 for five.tiddlywiki.com + +rem Set up the build output directory + +if "x%TW5_BUILD_OUTPUT%" == "x" (set TW5_BUILD_OUTPUT=%TMP%\mytiddlywiki.github.com) + +if not exist %TW5_BUILD_OUTPUT%\nul echo A valid TW5_BUILD_OUTPUT environment variable must be set + +echo Using TW5_BUILD_OUTPUT as %TW5_BUILD_OUTPUT% + +rem Run the test edition to run the node.js tests and to generate test.html for tests in the browser + +node .\tiddlywiki.js ^ + .\editions\test ^ + --verbose ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html %TW5_BUILD_OUTPUT%\test.html text/plain ^ + || exit 1 diff --git a/verbump.cmd b/verbump.cmd new file mode 100644 index 000000000..8457419ea --- /dev/null +++ b/verbump.cmd @@ -0,0 +1,13 @@ +@echo + +rem Bump to a new version number + +if "x%1" == "x" echo "Missing version (eg '5.0.0-alpha.99')" && exit 1 + +rem Set the new version number (will also commit and tag the release) + +npm version %1 -m "Version update" || exit 1 + +rem Make sure our tags are pushed to the origin server + +git push origin --tags || exit 1 diff --git a/wbld.cmd b/wbld.cmd new file mode 100644 index 000000000..26dead28d --- /dev/null +++ b/wbld.cmd @@ -0,0 +1,29 @@ +@echo + +rem build the TiddlyWeb edition of TiddlyWiki5 and upload it to TiddlySpace. Requires the TiddlySpace credentials +rem of a member of the tw5tiddlyweb space + +rem usage: +rem .\wbld.cmd + +rem Create the tmp directory if needed + +mkdir tmp + +rem Open the tw5tiddlyweb edition in TW5 and save the template for the main HTML file + +node .\tiddlywiki.js ^ + editions\tw5tiddlyweb ^ + --verbose ^ + --rendertiddler $:/core/templates/tiddlywiki5.template.html tmp\tiddlyweb.html text/plain ^ + || exit 1 + +rem 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 +type tmp\tiddlyweb.html >> tmp\tiddlerforupload.txt + +rem 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