# The Web interface¶

This section describes the Web interface of Lethe. It is the primary user interface designed to support most features of the package.

Todo

add screenshots after the interface is stable

## Running¶

Make a new wiki in the wiki directory:

lethe -d git -s wiki init
cd wiki

The -d parameter specifies the DVCS backend to use, currently git is the only practical one. -s specifies the directory where the wiki data is stored, by default the current directory.

Start the server:

lethe -d git serve

It will output an URI, open it in the browser to access the wiki. Run lethe serve -h to see all options.

On its main page, Lethe displays all nodes of the wiki (or the main node if one is configured). Use the navigation bar on top for accessing this list and search.

A single node is accessed by adding its UUID or slug to the main URL. If you add a word that isn’t already recognized as other URL, a short search is done to find a node that it might refer to (using e.g. title, title aliases and tags of the node). Use the search box for full search which can find nodes by words in their text or attachment.

## Editing¶

Use the new node link in the navigation bar to add a new node. Press any of the Edit links to edit an existing node.

The edit form has many tabs, the last of them contains the button used to save the node.

Multiple text formats are supported, Markdown is used by default.

Both external and internal links use the same markup as the text format normally does. For example, Markdown represents links as [text](http://example.org/uri).

To make an internal link use an URI in the lethe://UUID/TEXT syntax, where UUID is the target node UUID and TEXT is any text that isn’t used by Lethe (it is intended as a comment when reading the node text source).

The node editing form can add link URLs via its search box below the node text field.

### Attachments¶

Use the ‘Binary attachment’ tab of the edit form to attach a binary file to the node.

If Lethe can find text in the file (e.g. when it’s HTML or PDF), this text will be used for full-text search of the node. Title and other metadata from the attachment can be used when adding a node.

If the file is recognized as an image, it will be displayed inline on the node page.

### Sequences¶

Nodes can be linked in sequences. Use the ‘Sequence’ tab to specify the previous, parent and next node in the sequence. (‘Parent’ or ‘up’ node is used to represent trees, like ones in books with chapters and subsections.)

This feature is intended for managing complex documents like ebooks with chapters with a separate node for each chapter.

Currently a node can be included in only one sequence. There is no single view of the whole sequence. Properties for a node are not inferred from other nodes: adding a next-previous relation needs editing both nodes. Future versions will implement these missing parts and provide export of complete sequences to files (probably using PDF or EPUB format).

Todo

implement the above features

## Customization¶

Todo

when it’s implemented: site props, templates, static (mention templates and CSS licensing)

The main page is a list of all nodes, or a main node with the UUID specified in the main_node site property.

## Deployment¶

Todo

when it’s implemented, document FastCGI and WSGI serving

Todo

write it

## Math formulas¶

Lethe uses MathJax to render math formulas.

MathJax is not bundled with the package. To enable it, you need to pass the --mathjax-url option to lethe serve. For example:

lethe -d git serve --mathjax-url \
http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML

Formulas are formatted as in LaTeX, inside formula delimiters. Displayed formulas are written in $$…$$ or $…$ delimiters, while $$…$$ is used for in-line mathematics. In text formatted with Markdown backslashes needs escaping.