1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 02:50:27 +00:00

Minor style tweaks

This commit is contained in:
Jeremy Ruston 2012-01-20 12:19:13 +00:00
parent e4a423153f
commit 693cb67c6b
5 changed files with 27 additions and 29 deletions

View File

@ -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,{

View File

@ -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 &lt;filepath&gt;</code></td><td align="left">Loads a specfied <code>.recipe</code> file</td></tr><tr class="oddRow"><td align="left"><code>--load &lt;filepath&gt;</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 &lt;dirpath&gt;</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 &lt;title&gt; &lt;filename&gt; [&lt;type&gt;]</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 &lt;outdir&gt;</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 &lt;port&gt;</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 &lt;port&gt;</code></td><td align="left">Serve individual tiddlers over HTTP at <code>/tiddlertitle</code></td></tr><tr class="oddRow"><td align="left"><code>--wikitest &lt;dir&gt;</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 &quot;text/plain&quot; and &quot;text/html&quot; 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 -&gt; link]]</code><br />8. Addition of multiline macros, e.g.<br /><pre>&lt;&lt;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 &quot;text/plain&quot; and &quot;text/html&quot; 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 -&gt; link]]</code></li><li> Addition of multiline macros, e.g.</li></ol><pre>&lt;&lt;myMacro
param1: Parameter value
param2: value
&quot;unnamed parameter&quot;

View File

@ -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;

View File

@ -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.
))
>>
}}}
}}}

View File

@ -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