1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
---
format: Markdown
...
Using gitit
===========
Wiki links and formatting
-------------------------
For instructions on editing pages and creating links, see the "Help" page.
Gitit interprets links with empty URLs as wikilinks. Thus, in markdown
pages, `[Front Page]()` creates an internal wikilink to the page `Front
Page`. In reStructuredText pages, `` `Front Page <>`_ `` has the same
effect.
If you want to link to a directory listing for a subdirectory, use a
trailing slash: `[foo/bar/]()` creates a link to the directory for
`foo/bar`.
Page metadata
-------------
Pages may optionally begin with a metadata block. Here is an example:
---
format: latex+lhs
categories: haskell math
toc: no
title: Haskell and
Category Theory
...
\section{Why Category Theory?}
The metadata block consists of a list of key-value pairs, each on a
separate line. If needed, the value can be continued on one or more
additional line, which must begin with a space. (This is illustrated by
the "title" example above.) The metadata block must begin with a line
`---` and end with a line `...` optionally followed by one or more blank
lines. (The metadata block is a valid YAML document, though not all YAML
documents will be valid metadata blocks.)
Currently the following keys are supported:
format
: Overrides the default page type as specified in the configuration file.
Possible values are `markdown`, `rst`, `latex`, `html`, `markdown+lhs`,
`rst+lhs`, `latex+lhs`. (Capitalization is ignored, so you can also
use `LaTeX`, `HTML`, etc.) The `+lhs` variants indicate that the page
is to be interpreted as literate Haskell. If this field is missing,
the default page type will be used.
categories
: A space or comma separated list of categories to which the page belongs.
toc
: Overrides default setting for table-of-contents in the configuration file.
Values can be `yes`, `no`, `true`, or `false` (capitalization is ignored).
title
: By default the displayed page title is the page name. This metadata element
overrides that default.
Highlighted source code
-----------------------
If gitit was compiled against a version of pandoc that has highlighting
support (see above), you can get highlighted source code by using
[delimited code blocks]:
~~~ {.haskell .numberLines}
qsort [] = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
qsort (filter (>= x) xs)
~~~
To see what languages your pandoc was compiled to highlight:
pandoc -v
[delimited code blocks]: http://pandoc.org/README.html#delimited-code-blocks
Adding support for math
-----------------------
To write math on a markdown-formatted wiki page, just enclose it
in dollar signs, as in LaTeX:
Here is a formula: $\frac{1}{\sqrt{c^2}}$
You can write display math by enclosing it in double dollar signs:
$$\frac{1}{\sqrt{c^2}}$$
Gitit can display TeX math in three different ways, depending on the
setting of `math` in the configuration file:
1. `mathjax` (default): Math will be rendered using the [MathJax] javascript.
2. `mathml`: Math will be converted to MathML using
[texmath]. This method works with IE+mathplayer, Firefox, and
Opera, but not Safari.
3. `raw`: Math will be rendered as raw LaTeX codes.
[MathJax]: https://www.mathjax.org/
|