1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00

A quick sweep for missing or inaccurate code comments

This commit is contained in:
Jeremy Ruston 2012-05-19 18:23:14 +01:00
parent 6a7a5a2591
commit 34edb48784
26 changed files with 106 additions and 52 deletions

View File

@ -3,7 +3,7 @@ title: $:/core/modules/commands/dump.js
type: application/javascript
module-type: command
Dump command
Dump command for inspecting TiddlyWiki internals
\*/
(function(){

View File

@ -3,7 +3,7 @@ title: $:/core/modules/commands/load.js
type: application/javascript
module-type: command
Load tiddlers command
Command to load tiddlers from a file
\*/
(function(){

View File

@ -3,7 +3,7 @@ title: $:/core/modules/commands/savetiddler.js
type: application/javascript
module-type: command
Save tiddlers command
Command to save a tiddler to a file
\*/
(function(){

View File

@ -3,20 +3,7 @@ title: $:/core/modules/commands/server.js
type: application/javascript
module-type: command
Serve tiddlers over http. The server is very simple. At the root, it serves a rendering of a specified tiddler. Otherwise, it serves individual tiddlers encoded in JSON, and supports the basic HTTP operations for GET, PUT and DELETE.
For example:
--server 8080 $:/core/tiddlywiki5.template.html text/plain text/html
The parameters are:
--server <port> <roottiddler> <rendertype> <servetype>
* ''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")
Serve tiddlers over http
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/button.js
type: application/javascript
module-type: macro
Button macro
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/chooser.js
type: application/javascript
module-type: macro
Zooming chooser macro
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/download.js
type: application/javascript
module-type: macro
Download macro
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/echo.js
type: application/javascript
module-type: macro
Echo macro
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/edit/edit.js
type: application/javascript
module-type: macro
Edit macro for editting fields and tiddlers
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/edit/editors/bitmapeditor.js
type: application/javascript
module-type: editor
An editor plugin for editting bitmaps
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/edit/editors/texteditor.js
type: application/javascript
module-type: editor
An editor plugin for editting text
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/image.js
type: application/javascript
module-type: macro
Image macro for displaying images
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/include.js
type: application/javascript
module-type: macro
Include macro
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/list.js
type: application/javascript
module-type: macro
List macro
\*/
(function(){

View File

@ -3,7 +3,7 @@ title: $:/core/modules/macros/story/views/scroller.js
type: application/javascript
module-type: storyview
A storyview that shows a sequence of tiddlers and navigates by scrolling
A storyview that shows a sequence of tiddlers and navigates by smoothly scrolling
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/version.js
type: application/javascript
module-type: macro
Version macro
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/video.js
type: application/javascript
module-type: macro
Video macro
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/view.js
type: application/javascript
module-type: macro
View macro
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/macros/zoomer.js
type: application/javascript
module-type: macro
Zooming navigator macro
\*/
(function(){

View File

@ -3,7 +3,7 @@ title: $:/core/modules/parsers/javascriptparser/javascriptparser.js
type: application/javascript
module-type: parser
Parses a JSON object into a parse tree
Parses a JavaScript program into a parse tree
\*/
(function(){

View File

@ -3,7 +3,7 @@ title: $:/core/modules/parsers/plaintextparser.js
type: application/javascript
module-type: parser
Renders plain text tiddlers
Parses plain text tiddlers
\*/
(function(){

View File

@ -3,6 +3,8 @@ title: $:/core/modules/parsers/wikitextparser/rules/wikitextrules.js
type: application/javascript
module-type: wikitextrule
Rule modules for the wikitext parser
\*/
(function(){

View File

@ -5,8 +5,6 @@ module-type: utils
Various static utility functions.
This file is a bit of a dumping ground; the expectation is that most of these functions will be refactored.
\*/
(function(){

View File

@ -7,9 +7,6 @@ type: text/x-tiddlywiki-html
<meta name="application-name" content="TiddlyWiki" />
<meta name="generator" content="TiddlyWiki" />
<meta name="tiddlywiki-version" content="<<include "$:/core/version.txt" text/plain shadow:yes>>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="format-detection" content="telephone=no">
<meta name="copyright" content="
<<include "$:/core/copyright.txt" text/plain shadow:yes>>

File diff suppressed because one or more lines are too long

View File

@ -2,35 +2,75 @@ title: CommandLineInterface
modifier: JeremyRuston
TiddlyWiki5 can be used on the command line to perform an extensive set of operations based on RecipeFiles, TiddlerFiles and TiddlyWikiFiles.
!!Usage
`
node core/boot.js <options>
`
This boots the TiddlyWiki kernel and loads the core plugins. The wiki store is initially empty.
The command line options are processed sequentially from left to right. Processing pauses during long operations and then resumes with the next command line option in sequence.
The following options are available:
|`--load <filepath>` |Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files |
|`--savetiddler <title> <filename> [<type>]` |Save an individual tiddler as a specified MIME type, defaults to `text/html` |
|`--wikitest <dir> [save]` |Run wikification tests against the tiddlers in the given directory. Include the `save` flag to save the test result files as the new targets |
|`--dump tiddlers` |Dump the titles of the tiddlers in the wiki store |
|`--dump tiddler <title>` |Dump the fields of an individual tiddler |
|`--dump shadows` |Dump the titles of the shadow tiddlers in the wiki store |
|`--dump config` |Dump the current core configuration |
|`--verbose` |Triggers verbose output, useful for debugging |
!! Examples
This example loads the tiddlers from a TiddlyWiki HTML file and then saves one of them in HTML:
`
node tiddlywiki.js --verbose --load mywiki.html --savetiddler ReadMe ./readme.html
`
!! Notes
`--wikitest` looks for `*.tid` files in the specified folder. It then wikifies the tiddlers to both "text/plain" and "text/html" format and checks the results against the content of the `*.html` and `*.txt` files in the same directory.
!!Try it out
The easiest way to try out the code is to visit http://tiddlywiki.com/tiddlywiki5/
!!Usage
`
node core/boot.js [--<option> [<arg>[,<arg>]]]
`
Running `boot.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. The arguments are separated with spaces. The commands are identified by the prefix `--`.
For trying it out under `node.js`, two batch files are provided:
The commands are processed sequentially from left to right. Processing pauses during long operations and then resumes with the next command in sequence
!!Commands
The following commands are available.
!!! load
`--load <filepath>`
Load tiddlers from 2.x.x TiddlyWiki files (`.html`), `.tiddler`, `.tid`, `.json` or other files
!!! savetiddler
`--savetiddler <title> <filename> [<type>]`
Save an individual tiddler as a specified MIME type, defaults to `text/html`
!!! wikitest
`--wikitest <dir> [save]`
Run wikification tests against the tiddlers in the given directory. Include the `save` flag to save the test result files as the new targets.
`--wikitest` looks for `*.tid` files in the specified folder. It then wikifies the tiddlers to both "text/plain" and "text/html" format and checks the results against the content of the `*.html` and `*.txt` files in the same directory.
!!! server
`--server <port> <roottiddler> <rendertype> <servetype>`
The server is very simple. 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.
For example:
{{{
--server 8080 $:/core/tiddlywiki5.template.html text/plain text/html
}}}
The parameters are:
{{{
--server <port> <roottiddler> <rendertype> <servetype>
}}}
* ''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")
!!! dump
`--dump tiddlers`
Dump the titles of the tiddlers in the wiki store
!!! dump
`--dump tiddler <title>`
Dump the fields of an individual tiddler
!!! dump
`--dump shadows`
Dump the titles of the shadow tiddlers in the wiki store
!!! dump
`--dump config`
Dump the current core configuration
!!! verbose
`--verbose`
Triggers verbose output, useful for debugging
!!Trying it out
For trying TiddlyWiki5 out under `node.js`, two batch files are provided:
* `run.sh` boots the kernel and loads the core modules and then outputs the `$tw` global for inspection
* `bld.sh` builds the new TiddlyWiki 5 HTML file (placed in the `tmp/tw5/` directory by default)