1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-02 14:32:53 +00:00
TiddlyWiki5/tw5.com/tiddlers/TypedBlockTests.tid
Jeremy Ruston 5f6be2b5c7 Fixed docs to work with new wikitext parser
Which turns out to be entirely a matter of inserting additional blank
lines, which has the beneficial effect of making the wikitext a lot
more readable
2012-06-04 12:25:54 +01:00

65 lines
1.1 KiB
Plaintext

title: TypedBlockTests
tags: demo
WikiText can include blocks of text that are rendered with an explicit MIME type like this:
{{{
$$$application/javascript
//This is some JavaScript
var thing = 2 + "one";
$$$
}}}
This renders as:
$$$application/javascript
//This is some JavaScript
var thing = 2 + "one";
$$$
It is also possible to abbreviate the MIME type to a file extension. For example:
{{{
$$$.svg
<svg xmlns="http://www.w3.org/2000/svg" width="150" height="100">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
</svg>
$$$
}}}
This renders as:
$$$.svg
<svg xmlns="http://www.w3.org/2000/svg" width="150" height="100">
<circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
</svg>
$$$
And, finally, a JSON example:
{{{
$$$.json
{"teapot": "brown","inside":["milk","sugar",23]}
$$$
}}}
Which renders as:
$$$.json
{"teapot": "brown","inside":["milk","sugar",23]}
$$$
Unknown types render as plain text:
{{{
$$$text/unknown
Some plain text, which will not be //formatted//.
$$$
}}}
Which renders as:
$$$text/unknown
Some plain text, which will not be //formatted//.
$$$