Wiki Cheatsheet |
The Libretto library com/teacode/wiki
is based on the Markdown syntax.
First paragraph
Second paragraph
Hey Jude, don't make it bad Take a sad song and make it better Remember to let her into your heart Then you can start to make it better
Hey Jude, don't make it bad
Take a sad song and make it better
Remember to let her into your heart
Then you can start to make it better
Setext style:
# Heading 1 ## Heading 2 ######* Heading 6The asterisk
*
immediately after '#'
s in the last example means that the specified header should not be enumerated and included in
the table of contents.
Atx style:
Heading 1 ========= Heading 2 ----
Emphasis: *example* or _example_ Importance: **example** or __example__ Emphasis + Importance __*example*__ or **_example_**Emphasis: example or example
1. Ordered list item 2. Ordered list item 5. Ordered list item
The list starts with its first number:
5. Ordered list item 1. Ordered list item 1. Ordered list item
* Bulleted list item + Bulleted list item - Bulleted list item
* First level * Second level
First level
1. First level * Second level 1. Third level
First level
Second level
A blockquote starts with '>'
at the first position of the line:
> This is a blockquote
This is a blockquote
<http://teacode.com>
[TeaCode link](http://teacode.com)
TeaCode link
Reference link
[TeaCode link][teacode]
[teacode]: http://teacode.com
![Alt text](http://hd.wallpaperswide.com/thumbs/boat_at_sea-t2.jpg)
![Fig1. Beautiful forest][forest] ![forest]:https://i1.pickpik.com/photos/115/130/413/colorado-fall-autumn-colorful-preview.jpg width=500px
You can include an optional label to a header for automated handling internal links in your document.
For instance, you can have
## Internal Cross-References #[crossref]and then use
[cross-references](#crossref)
to organize the link. This is what you obtain:
cross-references
Inline code is marked by a single or double tick `
:
This is the code: `def Int add1: Int! = this + 1`
This is the code: def Int add1: Int! = this + 1
``` libretto def helloWorld = this.hello + this.world def hello = "Hello, " def world = "World" + this ```
Three or more asterisks (*), hyphens (-) or underscores (_) optionally separated by spaces
** ** ** **
The rule must be preceded by the empty line. Here is the result:
\\ \` \* \_ \[ \] \{ \} \( \) \# \+ \- \. \! \|
This is an HTML insertion: <span style="color: purple; font-size:200%">Hello, World!</span>
This is an HTML insertion: Hello, World!
Here are some math symbols: ∇ ∅ ∉ ≈
Here are some math symbols: ∇ ∅ ∉ ≈
Numeric character references also can be used: Θ Σ Ω
Numeric character references also can be used: Θ Σ Ω.
Multimarkdown is an extention of Markdown, which allows you to create tables, bibliography lists, footnotes etc. In Libretto Wiki a number of features of Multimarkdown are implemented – plus some additional tools (like Blocks)
This is the first reference ~[p.300][ref1] and this is the second one ~[][ref2]. ~[ref1]: Malykh, A., Mantsivoda. A Query Language for Logic Architectures. Lecture Notes in Computer Science 5947, 2010, pp.294–305. ~[ref2]: Doe, J. Another paper. Some journal.This is the first reference [1, p.300] and this is the second one [2].
Section Bibliography Lists explains how to insert a bibliography list into the document.
To create a footnote, use the following pattern:
Here is a text with a footnote.^[][somefootnote]
Here is a text with a footnote.[1]
The pattern of a footnote itself:
^[somefootnote]: Here is the text of the footnote itself.
To show the footnotes in the document we should insert the footnote list. In section Footnote list it is shown how to insert footnote lists in the document.
A table with two header rows and several multispan cells
[Table 1. Important data] | | Grouping || First Header | Second Header | Third Header ------------ | :-----------: | -----------: | Content | *Long Cell* || Content | **Cell** | Cell New section | More | Data | And more | With an escaped '\|' ||
is represented as
Grouping | ||
---|---|---|
First Header | Second Header | Third Header |
Content | Long Cell | |
Content | Cell | Cell |
New section | More | Data |
And more | With an escaped '|' | |
Local links allow you to handle links between wiki documents within some resource, e.g. a site. There are two syntax patterns for local links – on-spot links and reference links.
On-spot links:
*[local link text](local link)Reference links:
*[local link text][linkID] .... *[linkID]: local link description
This is the example of a reference link:
*[tryit]: /1439809207551/1439809207551!pic/1439811645092!textThis is how the link itself organized:
*[try it!][tryit]
It is converted into:
Here /1439809207551/1439809207551!pic/1439811645092!text
is a local local link.
The technique of local links allows you to establish internal connections within the collection of independent wiki documents. The Libretto library com/teacode/wiki
supports special tools for this.
In LibrettoWiki you can insert a locally accessible document into another document.
This is an on-spot insertion:
+[comment](local Link)
This is a reference insertion:
+[comment][insId] +[InsId]: local link description
For instance:
+[Math symbols in LaTeX](1432401322703)The text in square brackets is a comment.
Inline math formulas in the TeX format:
\\(\int_0^\infty e^{-x^2} dx=\frac{\sqrt{\pi}}{2}\\)
\(\int_0^\infty e^{-x^2} dx=\frac{\sqrt{\pi}}{2}\)
The block formulas:
\\[\begin{eqnarray} y & = & x^4 + 4 \\ & = & (x^2+2)^2 -4x^2 \\ & \le & (x^2+2)^2 \end{eqnarray}\\]
\[\begin{eqnarray} y &=& x^4 + 4 \\ &=& (x^2+2)^2 -4x^2 \\ &\le&(x^2+2)^2 \end{eqnarray}\]
In Libretto Wiki you can insert invisible comments starting with the triple %%%
%%% This is a comment
Special comments are used for defining metadata in the key/value form, e.g.
%%%> age: 15Metadata are recognized by
'>'
typed immediately after '%'
s.
Note that keys are case-insensitive, so
%%%> name: Andreiand
%%%> NaMe: Andreiare not distinguishable.
You can define arbitrary metadata, but some can be used by the methods. E.g. the following keys are used for generating the document title (see section Insertions):
title
is the title of the whole document. This key is also used to determine the title of the generated HTML document.
author
is the document's author
affiliation
specifies the affiliation of the author
address
defines the address
date
sets the date of the document
email
sets the relevant email address.
Multiple entries of the keys are legal, e.g.
%%%> author: Andrei Mantsivoda %%%> author: Olga Romanova %%%> affiliation: Irkutsk state university %%%> affiliation: Libretto Labs
css
specifies a CSS stylesheets for wiki-text rendering:
%%%> css: /wikipaper.cssMultiple entries of
css
are also possible. All CSS stylesheets will be included in the HTML document
in the order they are specified in the metadata.
In case of multiple entries of the same key you can handle the order, in which the components appear in the title. For instance, the following insertion
%%%! TTL title author affiliation author affiliationfirst prints the title, then the first author with the first affiliation, and finally the second author with the second affiliation. Note that here we use singulars instead of plural words.
Type this to include the table of contents:
%%%! TOCIf you do not want to include all levels of headers, just impose the restriction:
%%%! TOC 3Here only headers from
h1
to h3
will be included in the table.
Use
%%%! BIBto insert the bibliography list. It will comprise all references in order they are included in the document. This is the bibliography list of our cheat sheet:
[1] Malykh, A., Mantsivoda. A Query Language for Logic Architectures. Lecture Notes in Computer Science 5947, 2010, pp.294–305.
[2] Doe, J. Another paper. Some journal.
(these references were declared in section Bibliography).
Use
%%%! FTNto insert the list of footnotes. If we insert this to our documentation, we'll have:
[1] Here is the text of the footnote itself.
This list consists of one footnote specified in section Footnotes:
***
Blocks are used to create visually emphasized text blocks – like theorems, examples, remarks etc. This function is similar to that of the LaTeX's 'theorem' environment. For instance,
&[Remark] The Wirth's law is > "Software is getting slower more rapidly than hardware becomes faster."To specify a block use
[@blockname]
at the first position of the line. The result is:
Remark 1. The Wirth's law is
"Software is getting slower more rapidly than hardware becomes faster."
The layout of blocks is regulated by CSS. For instance, they can look exactly like theorems in LaTeX:
&[Theorem] The following logic formulas are valid: * \\(P \supset Q \equiv (\neg Q) \supset (\neg P).\\) * \\(P \supset Q \not \equiv Q \supset P.\\)
Theorem 2. The following logic formulas are valid:
The 'Remark' and 'Theorem' blocks differ only by their CSS declarations.
All blocks belong to the CSS class markdownthm
, and their headers belong to
the class markdownthm-header
. Appending block names to the names of these classes allows you to handle specific blocks. For instance,
the block 'Theorem'
has the following CSS description:
.markdownthm-Theorem { background: white; padding: 0px 0px 0px 0px; margin: 20px 0px 20px 0px; font-family: Times; font-style: italic; border: 0; }
By default Libretto Wiki provides the sequential numbering
of blocks. You can use '*'
to supress numbering:
&[Remark]* Cats are hard to hurdle.
Remark. Cats are hard to hurdle.
Use a single space as a block's name to create 'anonymous' blocks:
&[ ]* A fool thinks himself to be wise, but a wise man knows himself to be a fool. **William Shakespeare**
Now,
A fool thinks himself to be wise, but a wise man knows himself to be a fool.
William Shakespeare