1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-18 07:44:51 +00:00
TiddlyWiki5/tw5.com/tiddlers/concepts/WikiText.tid

291 lines
5.8 KiB
Plaintext
Raw Normal View History

title: WikiText
2012-06-05 13:41:43 +00:00
type: text/x-tiddlywiki
tags: docs concepts
2012-06-22 14:12:42 +00:00
WikiText is a concise, expressive way of typing a wide range of text formatting, hypertext and interactive features. It allows you to focus on writing without a complex user interface getting in the way. It is somewhat similar to [[MarkDown|http://daringfireball.net/projects/markdown/]], but with more of a focus on linking and the interactive features.
2012-06-22 14:12:42 +00:00
! Linking in WikiText
2012-06-19 07:56:45 +00:00
2012-06-22 14:12:42 +00:00
A key capability of WikiText is the ability to make links to other tiddlers or to external websites. There are several ways of doing this:
2012-06-21 14:38:01 +00:00
2012-06-22 14:12:42 +00:00
* To link to a tiddler by title: `[[Tiddler Title]]`
* To link to a tiddler and specify the text of the link: `[[Tiddler Title|Displayed Link Title]]`
* For tiddler titles that match the CamelCase rules, just typing the title will automatically create a link
* To link to an external website, type the full URL of the site: `http://five.tiddlywiki.com/`
2012-06-22 14:12:42 +00:00
You can suppress a link from being recognised by preceding it with `~`. For example:
2012-06-22 14:12:42 +00:00
{{{
* ~HelloThere is not a link
* ~http://google.com/ is not a link
}}}
Renders as:
* ~HelloThere is not a link
* ~http://google.com/ is not a link
! Paragraphs
To mark the end of a paragraph in TiddlyWiki you need to type `enter` twice to create a double line break:
{{{
This is the first paragraph.
And this is the second paragraph.
}}}
Single line breaks are ignored within paragraphs. For example:
{{{
This is a
paragraph made
up of
short lines
}}}
Renders as:
This is a
paragraph made
up of
short lines
! Formatting
Available character formatting includes:
2012-07-18 10:44:45 +00:00
* {{{`backticks`}}} for `code`
2012-06-22 14:12:42 +00:00
* `''bold''` for ''bold text''
* `//italic//` for //italic text//
* `__underscore__` for __underscored text__
* `^^superscript^^` for ^^superscript^^ text
* `~~subscript~~` for ~~subscripted~~ text
* `--strikethrough--` for --strikethrough-- text
You can also use `{{{` to mark code blocks:
{{{
{{{
This will be monospaced
}}}
}}}
! Transclusion
You can incorporate the content of one tiddler within another using the transclusion notation:
* `((JeremyRuston))` transcludes a single tiddler
* `((( [tag[docs]] )))`, with triple parenthesis, transcludes all the tiddlers that match a [[TiddlerFilter|TiddlerFilters]]
A template can also be specified, in which case the tiddler(s) are rendered through that [[TiddlerTemplate|TiddlerTemplates]]. Templates can either be specified directly or instead a tiddler can be specified from which the template is extracted.
* `((MyTiddler) <<view title>> by <<view modified>>)` renders the tiddler `MyTiddler` through a template that will yield `MyTiddler by JeremyRuston`, if the `modified` field is set to "JeremyRuston"
* `((MyTiddler)(MyTemplate))` renders the tiddler `MyTiddler` through the template `MyTemplate`
! Lists
2012-06-22 14:12:42 +00:00
You can create unordered lists with `*` characters:
2012-06-22 14:12:42 +00:00
{{{
* First list item
* Second list item
** A subitem
* Third list item
}}}
Renders as:
* First list item
* Second list item
** A subitem
* Third list item
2012-06-22 14:12:42 +00:00
Ordered lists use `#` instead of `*`:
2012-06-05 15:33:35 +00:00
2012-06-22 14:12:42 +00:00
# First item
# Second item
# Third item
You can also mix ordered and unordered list items:
{{{
2012-06-22 14:12:42 +00:00
* To do today
*# Eat
* To get someone else to do
*# This
*# That
*## And the other
}}}
2012-06-22 14:12:42 +00:00
Renders as:
2012-06-02 08:41:21 +00:00
2012-06-22 14:12:42 +00:00
* To do today
*# Eat
* To get someone else to do
*# This
*# That
*## And the other
2012-06-05 13:41:43 +00:00
2012-06-22 14:12:42 +00:00
You can also create HTML definition lists:
2012-06-05 13:41:43 +00:00
2012-06-22 14:12:42 +00:00
{{{
; Term being defined
: Definition of that term
; Another term
: Another definition
}}}
2012-06-22 14:12:42 +00:00
Renders as:
2012-06-22 14:12:42 +00:00
; Term being defined
: Definition of that term
; Another term
: Another definition
2012-06-22 14:12:42 +00:00
! Cascading Stylesheets
2012-06-22 14:12:42 +00:00
You can use this construction to cause the wrapped content to be assigned a specified CSS class:
2012-06-22 14:12:42 +00:00
{{{
{{myStyle{
* List One
* List Two
}}}
}}}
2012-06-22 14:12:42 +00:00
The resulting HTML looks like this:
2012-06-22 14:12:42 +00:00
{{{
<ul class="myStyle">
<li>List One</li>
<li>List Two</li>
</ul>
}}}
2012-06-22 14:12:42 +00:00
You can also assign a CSS class to an individual member of a list with this notation:
2012-06-22 14:12:42 +00:00
{{{
* List One
*{{MyClass}} List Two
* List Three
}}}
2012-06-22 14:12:42 +00:00
The resulting HTML looks like this:
2012-06-22 14:12:42 +00:00
{{{
<ul>
<li>List One</li>
<li class="MyClass">List Two</li>
<li> List Three</li>
</ul>
}}}
2012-06-22 14:12:42 +00:00
The same syntax can be used with headings:
2012-06-22 14:12:42 +00:00
{{{
!{{myStyle}} This heading has the class `myStyle`
}}}
2012-06-22 14:12:42 +00:00
! Typographic Features
2012-06-22 14:12:42 +00:00
You can create an n-dash with a double hyphen `--` and an m-dash with a triple hyphen `---`. For example -- this is an example --- and so is this
You can include a horizontal rule with three or more dashes on their own on a line:
{{{
---
}}}
Renders as:
---
2012-06-22 14:45:32 +00:00
! Images
To display an image stored in a tiddler:
{{{
[img[Motovun Jack.jpg]]
}}}
Displays as:
[img[Motovun Jack.jpg]]
See ImageWikiText for more details.
2012-06-22 14:12:42 +00:00
! HTML in WikiText
2012-08-02 21:16:02 +00:00
HTML tags and comments can be used directly in WikiText. For example:
2012-06-22 14:12:42 +00:00
{{{
<article class="hello">
This is my nice and simple block of text. HelloThere
2012-08-02 21:16:02 +00:00
<!-- This comment will not appear in the wikified output -->
</article>
2012-06-22 14:12:42 +00:00
}}}
2012-06-22 14:12:42 +00:00
! Macros
2012-06-22 14:12:42 +00:00
Macros provide rich functionality within WikiText. For example, the `<<video>>` macro can be used to embed videos from YouTube, Vimeo or the Internet Archive:
2012-06-22 14:12:42 +00:00
{{{
<<video src:32001208 type:vimeo>>
}}}
2012-06-22 14:12:42 +00:00
For full details of the available macros, see the [[Docs]].
2012-06-22 14:12:42 +00:00
! Headings
2012-06-22 14:12:42 +00:00
Headings are specified with one or more leading `!` characters:
{{{
! This is a level 1 heading
!! This is a level 2 heading
!!! This is a level 3 heading
}}}
2012-06-22 14:45:32 +00:00
! Other WikiText features
!! Typed Blocks
You can incorporate text of a different type within blocks of WikiText. For example:
{{{
$$$.js
return 2 + "string";
$$$
}}}
Renders as:
$$$.js
return 2 + "string";
$$$
See TypedBlockWikiText for more details
!! Style Blocks
You can apply HTML attributes to blocks of content with this syntax:
{{{
@@color:#f00;
@@text-decoration:underline;
This is in red!
@@
}}}
Generates the results:
@@color:#f00;
@@text-decoration:underline;
This is in red!
@@
See StyleBlockWikiText for more details.