summaryrefslogtreecommitdiff
path: root/README.md
blob: 7f6b2118754f66c3921951b683e8ab6af81a0781 (plain)
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
LEAP DOCUMENTATION
=================================

Files in the directory "docs" show up automatically at https://leap.se/docs when this repository is pushed.


Directory structure
---------------------------------

Every directory corresponds to a single web page. Within each directory, there are source files for different languages.

For example:

    docs/
      client/
        en.haml    -- used for https://leap.se/en/docs/client
        es.haml    -- used for https://leap.se/es/docs/client

If you don't care about translating a page, and it has no children, you can omit the directory:

    docs/
      client.haml  -- user for https://leap.se/*/docs/client

Menu
---------------------------------

A page does not show up in the navigation unless it appears in menu.txt.

The order in menu.txt determines the order in the navigation.


Localization
---------------------------------

The strings for (default) titles and navigation menu are loaded from locales/*.yaml files. If you want, you can safely ignore this and just use the properties @title and @nav_title instead (see below).


Supported syntaxes
---------------------------------

Depending the the file extension, the file with be parsed like so:

    .haml       -- HAML
    .md         -- Markdown
    .markdown   -- Markdown
    .txt        -- Textile
    .textile    -- Textile
    .rst        -- ReStructuredText
    .latex      -- LaTeX
    .pandoc     -- Pandoc

The flavor of Markdown used is slightly non-standard. See http://manpages.ubuntu.com/manpages/precise/man5/pandoc_markdown.5.html


Setting page properties
---------------------------------

HAML files are rendered as templates, but the other lightweight markup files are treated as static files.

The one exception is that every file can have a "properties header". It looks like this:

    @title = "A fine page"
    @toc = false

    continue on here with body text.

The properties start with '@' and are stripped out of the source file before it is rendered. Property header lines are evaluated as ruby. All properties are optional and they are inherited, including `@title`.

Available properties:

* `@title` -- The title for the page, appearing as in an H1 on the top of the page and as the HTML title. Also used for navigation title if `@nav_title` is not set. The inline H1 title does not appear unless `@title` is explicitly set for this page (i.e. the inherited value of `@title` does not trigger the automatic H1).
* `@nav_title` -- The title for the navigation to this page, as well as the HTML title if @title is not set.
* `@toc` -- If set to `false`, don't include a table of contents when rendering the file. This only applies to .rst and .md files.
* `@layout` -- Manually set the layout template to use for rendering this page.
* `@author` -- The author credit for the page.