mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-28 02:50:27 +00:00
Minor style tweaks
This commit is contained in:
parent
e4a423153f
commit
693cb67c6b
@ -262,7 +262,7 @@ WikiTextParseTree.prototype.toString = function(type) {
|
||||
classNames: ["treeNodeTypeText"]
|
||||
}));
|
||||
output.push(utils.stitchElement("span",null,{
|
||||
content: utils.htmlEncode(node.value),
|
||||
content: utils.htmlEncode(node.value).replace(/\n/g,"<br>"),
|
||||
classNames: ["treeNodeFieldValue"]
|
||||
}));
|
||||
return true;
|
||||
@ -271,13 +271,9 @@ WikiTextParseTree.prototype.toString = function(type) {
|
||||
},
|
||||
function(output,type,node) { // Macro nodes
|
||||
if(node.type === "macro") {
|
||||
output.push(utils.stitchElement("span",null,{
|
||||
content: node.type,
|
||||
classNames: ["treeNodeTypeMacro"]
|
||||
}));
|
||||
output.push(utils.stitchElement("span",null,{
|
||||
content: utils.htmlEncode(node.name),
|
||||
classNames: ["treeNodeFieldValue"]
|
||||
classNames: ["treeNodeTypeMacro"]
|
||||
}));
|
||||
for(var f in node.params) {
|
||||
output.push(utils.stitchElement("span",null,{
|
||||
|
@ -2,7 +2,7 @@
|
||||
</pre>The command line options are processed sequentially from left to right. Processing pauses during long operations, like loading a <span data-tw-macro='link'><a href='RecipeFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>recipe file</a></span> and all the subrecipes and <span data-tw-macro='link'><a href='TiddlerFiles' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-resolves'>tiddlers</a></span> that it references. The following options are available:<br /><table class="twtable"><tbody><tr class="evenRow"><td align="left"><code>--recipe <filepath></code></td><td align="left">Loads a specfied <code>.recipe</code> file</td></tr><tr class="oddRow"><td align="left"><code>--load <filepath></code></td><td align="left">Load additional tiddlers from <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> files (<code>.html</code>), <code>.tiddler</code>, <code>.tid</code>, <code>.json</code> or other files</td></tr><tr class="evenRow"><td align="left"><code>--savewiki <dirpath></code></td><td align="left">Saves all the loaded tiddlers as a single file <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> called <code>index.html</code> and an RSS feed called <code>index.xml</code></td></tr><tr class="oddRow"><td align="left"><code>--savetiddler <title> <filename> [<type>]</code></td><td align="left">Save an individual tiddler as a specified MIME type, defaults to <code>text/html</code></td></tr><tr class="evenRow"><td align="left"><code>--savetiddlers <outdir></code></td><td align="left">Saves all the loaded tiddlers as <code>.tid</code> files in the specified directory</td></tr><tr class="oddRow"><td align="left"><code>--servewiki <port></code></td><td align="left">Serve the cooked <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> over HTTP at <code>/</code></td></tr><tr class="evenRow"><td align="left"><code>--servetiddlers <port></code></td><td align="left">Serve individual tiddlers over HTTP at <code>/tiddlertitle</code></td></tr><tr class="oddRow"><td align="left"><code>--wikitest <dir></code></td><td align="left">Run wikification tests against the tiddlers in the given directory</td></tr><tr class="evenRow"><td align="left"><code>--dumpstore</code></td><td align="left">Dump the <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> store in JSON format</td></tr><tr class="oddRow"><td align="left"><code>--dumprecipe</code></td><td align="left">Dump the current recipe in JSON format</td></tr><tr class="evenRow"><td align="left"><code>--verbose</code></td><td align="left">verbose output, useful for debugging</td></tr></tbody></table><h2> Examples</h2>This example loads the tiddlers from a <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> HTML file and makes them available over HTTP:<br /><pre>node tiddlywiki.js --load mywiki.html --servewiki 127.0.0.1:8000
|
||||
</pre>This example cooks a <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> from a recipe:<br /><pre>node tiddlywiki.js --recipe tiddlywiki.com/index.recipe --savewiki tmp/
|
||||
</pre>This example ginsus a <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> into its constituent tiddlers:<br /><pre>node tiddlywiki.js --load mywiki.html --savetiddlers tmp/tiddlers
|
||||
</pre><h2> Notes</h2><code>--servewiki</code> and <code>--servertiddlers</code> are for different purposes and should not be used together. The former is for <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> core developers who want to be able to edit the <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> source files in a text editor and view the results in the browser by clicking refresh; it is slow because it reloads all the <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> <span data-tw-macro='link'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> files each time the page is loaded. The latter is for experimenting with the new wikification engine.<br /><br /><code>--wikitest</code> looks for <code>*.tid</code> 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 <code>*.html</code> and <code>*.txt</code> files in the same directory.</div><br /><h1>Testing</h1><div data-tw-macro='tiddler'><code>test.sh</code> contains a simple test script that cooks the main tiddlywiki.com recipe and compares it with the results of the old build process (ie, running cook.rb and then opening the file in a browser and performing a 'save changes' operation). It also runs a series of wikifications tests that work off the data in <code>test/wikitests/</code>.</div><br /><h1>Planned <span data-tw-macro='link'><a href='WikiText' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiText</a></span> Features</h1><div data-tw-macro='tiddler'>It is proposed to extend the existing <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> wikitext syntax with the following extensions<br /><br />1. Addition of <code>**bold**</code> character formatting<br />2. Addition of <code>`backtick for code`</code> character formatting<br />4. Addition of <span data-tw-macro='link'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> forced line break, e.g. <code>force\\linebreak</code><br />3. Addition of <span data-tw-macro='link'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> headings, e.g. <code>==Heading</code><br />5. Addition of <span data-tw-macro='link'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> headings in tables, e.g. <code>|=|=table|=header|</code><br />6. Addition of white-listed HTML tags intermixed with wikitext<br />7. Addition of <span data-tw-macro='link'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> pretty links, e.g. <code>[[description -> link]]</code><br />8. Addition of multiline macros, e.g.<br /><pre><<myMacro
|
||||
</pre><h2> Notes</h2><code>--servewiki</code> and <code>--servertiddlers</code> are for different purposes and should not be used together. The former is for <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> core developers who want to be able to edit the <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> source files in a text editor and view the results in the browser by clicking refresh; it is slow because it reloads all the <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> <span data-tw-macro='link'><a href='JavaScript' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>JavaScript</a></span> files each time the page is loaded. The latter is for experimenting with the new wikification engine.<br /><br /><code>--wikitest</code> looks for <code>*.tid</code> 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 <code>*.html</code> and <code>*.txt</code> files in the same directory.</div><br /><h1>Testing</h1><div data-tw-macro='tiddler'><code>test.sh</code> contains a simple test script that cooks the main tiddlywiki.com recipe and compares it with the results of the old build process (ie, running cook.rb and then opening the file in a browser and performing a 'save changes' operation). It also runs a series of wikifications tests that work off the data in <code>test/wikitests/</code>.</div><br /><h1>Planned <span data-tw-macro='link'><a href='WikiText' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiText</a></span> Features</h1><div data-tw-macro='tiddler'>It is proposed to extend the existing <span data-tw-macro='link'><a href='TiddlyWiki' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>TiddlyWiki</a></span> wikitext syntax with the following extensions<br /><br /><ol><li> Addition of <code>**bold**</code> character formatting</li><li> Addition of <code>`backtick for code`</code> character formatting</li><li> Addition of <span data-tw-macro='link'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> forced line break, e.g. <code>force\\linebreak</code></li><li> Addition of <span data-tw-macro='link'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> headings, e.g. <code>==Heading</code></li><li> Addition of <span data-tw-macro='link'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> headings in tables, e.g. <code>|=|=table|=header|</code></li><li> Addition of white-listed HTML tags intermixed with wikitext</li><li> Addition of <span data-tw-macro='link'><a href='WikiCreole-style' class='tw-tiddlylink tw-tiddlylink-internal tw-tiddlylink-missing'>WikiCreole-style</a></span> pretty links, e.g. <code>[[description -> link]]</code></li><li> Addition of multiline macros, e.g.</li></ol><pre><<myMacro
|
||||
param1: Parameter value
|
||||
param2: value
|
||||
"unnamed parameter"
|
||||
|
@ -106,56 +106,59 @@ a.tw-tiddlylink-missing {
|
||||
}
|
||||
|
||||
.treeNodeType {
|
||||
text-transform: uppercase;
|
||||
padding: 3px 5px 3px;
|
||||
background-color: #46A546;
|
||||
color: #fff;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
font-size: 10.5px;
|
||||
font-size: 9.5px;
|
||||
font-weight: bold;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.treeNodeTypeText {
|
||||
text-transform: uppercase;
|
||||
padding: 3px 5px 3px;
|
||||
background-color: #62CFFC;
|
||||
background-color: #4646a5;
|
||||
color: #fff;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
font-size: 10.5px;
|
||||
font-size: 9.5px;
|
||||
font-weight: bold;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.treeNodeTypeMacro {
|
||||
text-transform: uppercase;
|
||||
padding: 3px 5px 3px;
|
||||
margin-right: 3px;
|
||||
background-color: #46A546;
|
||||
color: #fff;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
font-size: 10.5px;
|
||||
border-radius: 3px;
|
||||
font-size: 9.5px;
|
||||
font-weight: bold;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.treeNodeTypeParam {
|
||||
padding: 3px 5px 3px;
|
||||
background-color: #4646a5;
|
||||
background-color: #62CFFC;
|
||||
color: #fff;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
font-size: 10.5px;
|
||||
font-size: 9.5px;
|
||||
font-weight: bold;
|
||||
list-style-type: none;
|
||||
}
|
||||
|
||||
.treeNodeTypeHtml {
|
||||
text-transform: uppercase;
|
||||
padding: 3px 5px 3px;
|
||||
background-color: #F89406;
|
||||
color: #fff;
|
||||
border-top-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
font-size: 10.5px;
|
||||
border-radius: 3px;
|
||||
font-size: 9.5px;
|
||||
font-weight: bold;
|
||||
list-style-type: none;
|
||||
}
|
||||
@ -177,6 +180,7 @@ a.tw-tiddlylink-missing {
|
||||
|
||||
.treeNodeFieldValue {
|
||||
margin-left: 0;
|
||||
margin-right: 3px;
|
||||
padding: 3px 5px 3px 3px;
|
||||
background-color: #eee;
|
||||
color: #000;
|
||||
|
@ -3,14 +3,14 @@ modifier: JeremyRuston
|
||||
|
||||
It is proposed to extend the existing TiddlyWiki wikitext syntax with the following extensions
|
||||
|
||||
1. Addition of {{{**bold**}}} character formatting
|
||||
2. Addition of {{{`backtick for code`}}} character formatting
|
||||
4. Addition of WikiCreole-style forced line break, e.g. {{{force\\linebreak}}}
|
||||
3. Addition of WikiCreole-style headings, e.g. {{{==Heading}}}
|
||||
5. Addition of WikiCreole-style headings in tables, e.g. {{{|=|=table|=header|}}}
|
||||
6. Addition of white-listed HTML tags intermixed with wikitext
|
||||
7. Addition of WikiCreole-style pretty links, e.g. {{{[[description -> link]]}}}
|
||||
8. Addition of multiline macros, e.g.
|
||||
# Addition of {{{**bold**}}} character formatting
|
||||
# Addition of {{{`backtick for code`}}} character formatting
|
||||
# Addition of WikiCreole-style forced line break, e.g. {{{force\\linebreak}}}
|
||||
# Addition of WikiCreole-style headings, e.g. {{{==Heading}}}
|
||||
# Addition of WikiCreole-style headings in tables, e.g. {{{|=|=table|=header|}}}
|
||||
# Addition of white-listed HTML tags intermixed with wikitext
|
||||
# Addition of WikiCreole-style pretty links, e.g. {{{[[description -> link]]}}}
|
||||
# Addition of multiline macros, e.g.
|
||||
{{{
|
||||
<<myMacro
|
||||
param1: Parameter value
|
||||
@ -21,4 +21,4 @@ A multiline parameter that can go on for as long as it likes
|
||||
and contain linebreaks.
|
||||
))
|
||||
>>
|
||||
}}}
|
||||
}}}
|
||||
|
@ -45,8 +45,6 @@ Each WikiStore is connected to another shadow store that is used to provide defa
|
||||
|
||||
Clients can register event handlers with the WikiStore object. Event handlers can be registered to be triggered for modifications to any tiddler in the store, or with a filter to only be invoked when a particular tiddler or set of tiddlers changes.
|
||||
|
||||
|
||||
|
||||
Whenever a change is made to a tiddler, the wikistore registers a nexttick handler (if it hasn't already done so). The nexttick handler looks back at all the tiddler changes, and dispatches matching event handlers.
|
||||
|
||||
!! Parsing
|
||||
|
Loading…
Reference in New Issue
Block a user