summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--docs/api/Makefile (renamed from docs/Makefile)0
-rw-r--r--docs/api/accounts.rst (renamed from docs/accounts.rst)0
-rw-r--r--docs/api/commands.rst (renamed from docs/commands.rst)0
-rw-r--r--docs/api/conf.py (renamed from docs/conf.py)0
-rw-r--r--docs/api/database.rst (renamed from docs/database.rst)0
-rw-r--r--docs/api/index.rst (renamed from docs/index.rst)0
-rw-r--r--docs/api/interface.rst (renamed from docs/interface.rst)0
-rw-r--r--docs/api/settings.rst (renamed from docs/settings.rst)0
-rw-r--r--docs/api/utils.rst (renamed from docs/utils.rst)0
-rw-r--r--docs/user/Makefile130
-rw-r--r--docs/user/source/_templates/layout.html7
-rw-r--r--docs/user/source/conf.py220
-rw-r--r--docs/user/source/configuration.rst428
-rw-r--r--docs/user/source/index.rst15
-rw-r--r--docs/user/source/usage.rst9
16 files changed, 810 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 3b5060ea..c1a2bb8e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@
/MANIFEST
.gdb_history
docs/_build/
+docs/user/build
/alot/VERSION
diff --git a/docs/Makefile b/docs/api/Makefile
index 741cc0f0..741cc0f0 100644
--- a/docs/Makefile
+++ b/docs/api/Makefile
diff --git a/docs/accounts.rst b/docs/api/accounts.rst
index c09b43fa..c09b43fa 100644
--- a/docs/accounts.rst
+++ b/docs/api/accounts.rst
diff --git a/docs/commands.rst b/docs/api/commands.rst
index f38ac04c..f38ac04c 100644
--- a/docs/commands.rst
+++ b/docs/api/commands.rst
diff --git a/docs/conf.py b/docs/api/conf.py
index 0c36a73f..0c36a73f 100644
--- a/docs/conf.py
+++ b/docs/api/conf.py
diff --git a/docs/database.rst b/docs/api/database.rst
index 00334a4b..00334a4b 100644
--- a/docs/database.rst
+++ b/docs/api/database.rst
diff --git a/docs/index.rst b/docs/api/index.rst
index feffd544..feffd544 100644
--- a/docs/index.rst
+++ b/docs/api/index.rst
diff --git a/docs/interface.rst b/docs/api/interface.rst
index 75b7d5c3..75b7d5c3 100644
--- a/docs/interface.rst
+++ b/docs/api/interface.rst
diff --git a/docs/settings.rst b/docs/api/settings.rst
index f7272756..f7272756 100644
--- a/docs/settings.rst
+++ b/docs/api/settings.rst
diff --git a/docs/utils.rst b/docs/api/utils.rst
index 8cfae2b7..8cfae2b7 100644
--- a/docs/utils.rst
+++ b/docs/api/utils.rst
diff --git a/docs/user/Makefile b/docs/user/Makefile
new file mode 100644
index 00000000..b4d9a3dd
--- /dev/null
+++ b/docs/user/Makefile
@@ -0,0 +1,130 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ -rm -rf $(BUILDDIR)/*
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/alot.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/alot.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/alot"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/alot"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ make -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
diff --git a/docs/user/source/_templates/layout.html b/docs/user/source/_templates/layout.html
new file mode 100644
index 00000000..b4384e43
--- /dev/null
+++ b/docs/user/source/_templates/layout.html
@@ -0,0 +1,7 @@
+{% extends "!layout.html" %}
+{% set script_files = [] %}
+
+{% block linktags %}{% endblock %}
+{% block relbar1 %}{% endblock %}
+{% block footer %}{% endblock %}
+{% block relbaritems %}{% endblock %}
diff --git a/docs/user/source/conf.py b/docs/user/source/conf.py
new file mode 100644
index 00000000..b9babda3
--- /dev/null
+++ b/docs/user/source/conf.py
@@ -0,0 +1,220 @@
+# -*- coding: utf-8 -*-
+#
+# alot documentation build configuration file, created by
+# sphinx-quickstart on Tue Jan 10 16:45:54 2012.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.intersphinx']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'alot'
+copyright = u'2012, Patrick Totzke'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.21'
+# The full version, including alpha/beta/rc tags.
+release = '0.21'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+html_theme_options = {'nosidebar': True}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+html_title = 'Alot User Manual'
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'alotdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'alot.tex', u'alot Documentation',
+ u'Patrick Totzke', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'alot', u'alot Documentation',
+ [u'Patrick Totzke'], 1)
+]
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {'http://docs.python.org/': None}
diff --git a/docs/user/source/configuration.rst b/docs/user/source/configuration.rst
new file mode 100644
index 00000000..a37a8f36
--- /dev/null
+++ b/docs/user/source/configuration.rst
@@ -0,0 +1,428 @@
+*************
+Configuration
+*************
+
+
+All configs are optional, but if you want to send mails you need to
+specify at least one account section.
+
+Alot reads a config file in the "INI" syntax:
+It consists of some sections whose names are given in square brackets, followed by
+key-value pairs that use "=" or ":" as separator, ';' and '#' are comment-prefixes.
+
+The default location for the config file is `~/.config/alot/config`.
+You can find a complete example config with the default values and their decriptions in
+`alot/defaults/alot.rc`.
+
+Note that since ":" is a separator for key-value pairs you need to use "colon" to bind
+commands to ":".
+
+Here is a key for the interpreted sections:
+
+[general]
+ global settings: set your editor etc
+[account X]
+ defines properties of account X: (see below)
+[X-maps]
+ defines keymaps for mode X. possible modes are:
+ envelope, search, thread, taglist, bufferlist and global.
+ global-maps are valid in all modes.
+[tag-translate]
+ defines a map from tagnames to strings that is used when
+ displaying tags. utf-8 symbols welcome.
+[Xc-theme]
+ define colour palette for colour mode. X is in {1, 16, 256}.
+
+
+Accounts
+========
+A sample gmail section looks like this (provided you have configured msmtp accordingly)::
+
+ [account gmail]
+ realname = Patrick Totzke
+ address = patricktotzke@gmail.com
+ aliases = patricktotzke@googlemail.com
+ sendmail_command = msmtp --account=gmail -t
+
+Here's a full list of the interpreted keywords in account sections::
+
+ # used to format the (proposed) From-header in outgoing mails
+ realname = your name
+ address = this accounts email address
+
+ # used to clear your addresses/ match account when formating replies
+ aliases = foobar@myuni.uk;f.bar@myuni.uk;f.b100@students.myuni.uk
+
+ # how to send mails
+ sendmail_command = command, defaults to 'sendmail'
+
+ # where to store outgoing mail
+ sent_box = maildir:///home/you/mail//Sent
+
+ # how to tag sent mails [default: sent]. seperate multiple tags with ','.
+ sent_tags = sent
+
+ # path to signature file
+ signature = ~/your_vcard_for_this_account.vcs
+
+ # attach signature file if set to True, append its content (mimetype text)
+ # to the body text if set to False. Defaults to False.
+ signature_as_attachment = False
+
+ # signature file's name as it appears in outgoing mails if
+ # signature_as_attachment is set to True
+ signature_filename = you.vcs
+
+ # command to lookup contacts
+ abook_command = abook --mutt-query
+ abook_regexp = regexp to match name & address in abook_commands output.
+
+.. warning::
+
+ Sending mails is only supported via sendmail for now. If you want
+ to use a sendmail command different from `sendmail`, specify it as `sendmail_command`.
+
+`send_box` specifies the mailbox where you want outgoing mails to be stored
+after successfully sending them. You can use mbox, maildir, mh, babyl and mmdf
+in the protocol part of the url.
+
+The file specified by `signature` is attached to all outgoing mails from this account, optionally
+renamed to `signature_filename`.
+
+If you specified `abook_command`, it will be used for tab completion in queries (to/from)
+and in message composition. The command will be called with your prefix as only argument
+and its output is searched for name-email pairs. The regular expression used here
+defaults to `(?P<email>.+?@.+?)\s+(?P<name>.+)`, which makes it work nicely with `abook --mutt-query`.
+You can tune this using the `abook_regexp` option (beware Commandparsers escaping semantic!).
+Have a look at the FAQ for other examples.
+
+
+Key Bindings
+============
+If you want to bind a commandline to a key you can do so by adding the pair to the
+`[MODE-maps]` config section, where MODE is the buffer mode you want the binding to hold.
+Consider the following lines, which allow you to send mails in envelope buffers using the
+combination `control` + `s`::
+
+ [envelope-maps]
+ ctrl s = send
+
+Possible MODE strings are:
+
+* envelope
+* search
+* thread
+* taglist
+* bufferlist
+* global
+
+Bindings defined in section `[global-maps]` are valid in all modes.
+
+Have a look at `the urwid User Input documentation <http://excess.org/urwid/wiki/UserInput>`_ on how key strings are formated.
+
+
+
+Hooks
+=====
+Hooks are python callables that live in a module specified by
+`hooksfile` in the `[global]` section of your config. Per default this points
+to `~/.config/alot/hooks.py`.
+For every command X, the callable 'pre_X' will be called before X and 'post_X' afterwards.
+
+When a hook gets called, it receives instances of
+
+ui
+ `alot.ui.UI`, the main user interface object that can prompt etc.
+dbm
+ `alot.db.DBManager`, the applications database manager
+aman
+ `alot.account.AccountManager`, can be used to look up account info
+config
+ `alot.settings.config`, a configparser to access the users config
+
+An autogenerated API doc for these can be found at http://alot.rtfd.org ,
+the sphinx sources live in the `docs` folder.
+As an example, consider this pre-hook for the exit command,
+that logs a personalized goodby message::
+
+ import logging
+ def pre_exit(aman=None, **rest):
+ accounts = aman.get_accounts()
+ if accounts:
+ logging.info('goodbye, %s!' % accounts[0].realname)
+ else:
+ logging.info('goodbye!')
+
+Apart from command pre and posthooks, the following hooks will be interpreted:
+
+`reply_prefix(realname, address, timestamp, **kwargs)`
+ Is used to reformat the first indented line in a reply message.
+ Should return a string and defaults to 'Quoting %s (%s)\n' % (realname, timestamp)
+`forward_prefix(realname, address, timestamp, **kwargs)`
+ Is used to reformat the first indented line in a inline forwarded message.
+ Returns a string and defaults to 'Forwarded message from %s (%s)\n' % (realname, timestamp)
+`pre_edit_translate(bodytext, **kwargs)`
+ can be used to manipulate a messages bodytext before the editor is called.
+ Receives and returns a string.
+`post_edit_translate(bodytext, **kwargs)`
+ can be used to manipulate a messages bodytext after the editor is called
+ Receives and returns a string.
+
+
+
+Widget Colours
+==============
+Alot can be run in 1, 16 or 256 colour mode.
+The requested mode is determined by the commandline parameter `-C` or read from
+option `colourmode` in section `[globals]` of your config file.
+The default is 256, which will be scaled down depending on how many colours
+your terminal supports.
+
+The interface will theme its widgets according to the palette defined in
+section `[MODEc-theme]` where `MODE` is the integer indicating the colour mode.
+Have a look at the default config (`alot/defaults/alot.rc`) for a complete list
+of interpreted widget settings; the keys in this section should be self-explanatory.
+
+Values can be colour names (`light red`, `dark green`..), RGB colour codes (e.g. `#868`),
+font attributes (`bold`, `underline`, `blink`, `standout`) or a comma separated combination of
+colour and font attributes.
+In sections `[16c-theme]` and `[256c-theme]` you can define Y_fg and
+Y_bg for the foreground and background of each widget keyword Y, whereas the monochromatic
+(`[1c-theme]`) palette can only interpret font attributes for key Y without the suffix.
+As an example, check the setting below that makes the footer line appear as
+underlined bold red text on a bright green background::
+
+ [256c-theme]
+ global_footer_bg = #8f6
+ global_footer_fg = light red, bold, underline
+
+See `urwids docs on Attributes <http://excess.org/urwid/reference.html#AttrSpec>`_ for more details
+on the interpreted values. Urwid provides a `neat colour picker script`_ that makes choosing
+colours easy.
+
+.. _neat colour picker script: http://excess.org/urwid/browser/palette_test.py
+
+
+Custom Tagstring Formatting
+===========================
+In theme sections you can use keys with prefix `tag_` to format specific tagstrings. For instance,
+the following will make alot display the "todo" tag in white on red when in 256c-mode. ::
+
+ [256c-theme]
+ tag_todo_bg = #d66
+ tag_todo_fg = white
+
+You can translate tag strings before displaying them using the `[tag-translate]` section. A
+key=value statement in this section is interpreted as:
+Always display the tag `key` as string `value`. Utf-8 symbols are welcome here, see e.g.
+http://panmental.de/symbols/info.htm for some fancy symbols. I personally display my maildir flags
+like this::
+
+ [tag-translate]
+ flagged = ⚑
+ unread = ✉
+ replied = ⇄
+
+Highlighting Search Results
+===========================
+Thread lines in the ``SearchBuffer`` can be highlighted by applying a theme different
+from their regular one if they match a `notmuch` query.
+
+The default config predefines highlighting for threads that carry the `unread`,
+the `flagged` or both of those tags.
+
+Thread lines consist of up to six components (not all of which are shown by
+default) that may be themed individually to provide highlighting. The components
+are
+
+ - `date`
+ - `mailcount`
+ - `tags`
+ - `authors`
+ - `subject`
+ - `content`
+
+Have a look at Alot's interface to see what they are.
+
+Customizing highlighting, you may define which components you want highlighted.
+Add a `highlighting` section to your config file and define a comma separated
+list of highlightable components: ::
+
+ [highlighting]
+ components = date, mailcount, tags, authors, subject
+
+Rules
+-----
+To specify which threads should be highlighted, you need to define highlighting
+rules. Rules map queries onto theme identifiers. Each thread that matches a given rule
+will use a theme identified by the ID the rule is mapped to.
+
+.. admonition:: Example
+
+ To highlight threads that are tagged as 'important', add the `rules`
+ key to your `highlighting` section and provide a dict in JSON syntax. Use an
+ appropriate `notmuch` query as a key and select a meaningful theme identifier as
+ its value:
+
+::
+
+ rules = { "tag:important":"isimportant" }
+
+.. note::
+ Please make sure the identifier isn't the name of an actual tag, since this
+ may introduce ambiguity when highlighting tags. More on that `later`_.
+
+If you want highlighting for other threads as well, just add more rules to the
+dict: ::
+
+ rules = { "tag:important":"isimportant",
+ "subject:alot":"concernsalot",
+ "from:mom@example.com":"frommom"}
+
+.. note::
+ The sequence of the list defines the search order. The first query that
+ matches selects the highlighting. So if you have queries that are harder to
+ satisfy, you should put them earlier in the dict than ones that match more
+ easily:
+
+::
+
+ rules = { "tag:unread":"isunread",
+ "tag:unread AND tag:important":"isunreadimportant"}
+
+This setup will never highlight any threads as `isunreadimportant`, since alle
+threads that would match that identifier's query will *also* have matched the
+`isunread` query earlier in the rules dict. So, again, make sure that rules that
+are hard to satisfy show up early in the dict: ::
+
+ rules = { "tag:unread AND tag:important":"isunreadimportant",
+ "tag:unread":"isunread"}
+
+This way only threads that didn't match `isunreadimportant` before end up
+highlighted as `isunread` only.
+
+.. _later: `ambiguous theme identifiers`_
+
+Theme Generic Components
+------------------------
+.. note::
+ The following schema will allow you to define highlighting themes for all
+ components *except* `tags`, which follow a different system and will be
+ explained in the `next section`_.
+
+To define a highlighting theme for a component, you need to add a key of the
+following format to your colour theme (please cf. `Widget Colours`_ for more information
+on theming): ::
+
+ search_thread_COMPONENT_ID_[focus_][fg|bg]
+
+where
+
+ - ``COMPONENT`` is the component this theme is meant to highlight,
+ - ``ID`` is the theme identifier that defines which query this option belongs
+ to,
+ - ``focus_`` is optional and if present defines that the theme should only be
+ used if the current thread is focussed and
+ - ``fg`` or ``bg`` is a selection that specifies which themable part of the
+ component this option refers to.
+
+.. admonition:: Example
+
+ The following option will highlight the `subject` of each thread that
+ matches the query mapping to `isimportant` if the current thread is
+ `focus`\sed by theming its `foreground` according to the values stated
+ below:
+
+::
+
+ search_thread_subject_isimportant_focus_fg = dark red, underline
+
+Following this pattern will allow you to set theming for the `background`, for
+the `subject` of threads tagged as `important` that are currently not focussed
+(by omitting the `focus_` part of the key string), for `subject`\s of threads
+matching a different query, and all other components except `tags`.
+
+.. _next section: `Theme Tags Component`_
+
+Theme `Tags` Component
+----------------------
+As described in `Custom Tagstring Formatting`_, tags may be themed individually.
+Highlighting expands this concept by allowing default themed tags as well as
+individual themed tags to provide highlighting variants.
+
+To specify highlighting themes for default themed tags, just add a key with the wanted
+theme identifier: ::
+
+ tag_ID_[focus_][fg|bg]
+
+where
+
+ - ``ID`` is the theme identifier that defines which query this option belongs
+ to,
+ - ``focus_`` is optional and if present defines that the theme should only be
+ used if the current thread is focussed and
+ - ``fg`` or ``bg`` is a selection that specifies which themable part of the
+ component this option refers to.
+
+To highlight custom themed tags, proceed accordingly. Specify ::
+
+ tag_TAG_ID_[focus_][fg|bg]
+
+where
+
+ - ``TAG`` is the name of the custom themed tag that is to be highlighted,
+ - ``ID`` is the theme identifier that defines which query this option belongs
+ to,
+ - ``focus_`` is optional and if present defines that the theme should only be
+ used if the current thread is focussed and
+ - ``fg`` or ``bg`` is a selection that specifies which themable part of the
+ component this option refers to.
+
+.. _ambiguous theme identifiers:
+.. caution::
+ As mentioned earlier, using tag names as theme identifiers may introduce
+ ambiguity and lead to unexpected theming results.
+
+Assuming one would replace the theme identifier `isimportant` with its intuitive
+alternative `important`, the tag theme ``tag_important_fg`` might either be a
+custom theme for the tag `important` of the form ``tag_TAG_fg`` or the highlight
+theme for default themed tags of threads that match the query that maps to the
+`important` identifier: ``tag_ID_fg``.
+
+Using above proper identifier would distinguish those options as
+``tag_important_fg`` for the custom theme and ``tag_isimportant_fg`` for the
+highlighting theme.
+
+
+Contacts Completion
+===================
+In each `account` section you can specify a `abook_command` that
+is considered the address book of that account and will be used
+for address completion where appropriate.
+
+This shell command will be called with the search prefix as only argument.
+Its output is searched for email-name pairs using the regular expression given as `abook_regexp`,
+which must include named groups "email" and "name" to match the email address and realname parts
+respectively. See below for an example that uses `abook <http://abook.sourceforge.net/>`_::
+
+ [account YOURACCOUNT]
+ realname = ...
+ address = ...
+ abook_command = abook --mutt-query
+ abook_regexp = (?P<email>.+?@.+?)\s+(?P<name>.+)
+
+See `here <http://notmuchmail.org/emacstips/#index11h2>`_ for alternative lookup commands. The few others I have tested so far are:
+
+`goobook <http://code.google.com/p/goobook/>`_
+ for cached google contacts lookups::
+
+ abook_command = goobook query
+ abook_regexp = (?P<email>.+?@.+?)\s\s+(?P<name>.+)\s\s+.+
+
+`nottoomuch-addresses <http://www.iki.fi/too/nottoomuch/nottoomuch-addresses/>`_
+ completes contacts found in the notmuch index::
+
+ abook_command = nottoomuch-addresses.sh
+ abook_regexp = \"(?P<name>.+)\"\s*<(?P<email>.*.+?@.+?)>
+
+Don't hesitate to send me your custom `abook_regexp` values to list them here.
diff --git a/docs/user/source/index.rst b/docs/user/source/index.rst
new file mode 100644
index 00000000..889b1496
--- /dev/null
+++ b/docs/user/source/index.rst
@@ -0,0 +1,15 @@
+.. alot documentation master file, created by
+ sphinx-quickstart on Tue Jan 10 16:45:54 2012.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+User Manual
+===========
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ usage
+ configuration
diff --git a/docs/user/source/usage.rst b/docs/user/source/usage.rst
new file mode 100644
index 00000000..cd55af36
--- /dev/null
+++ b/docs/user/source/usage.rst
@@ -0,0 +1,9 @@
+*****
+Usage
+*****
+
+In all views, arrows, page-up/down, `j`,`k` and `Space` can be used to move the focus.
+`Escape` cancels prompts and `Enter` selects. Hit `:` at any time and type in commands
+to the prompt.
+Usage information on any command can be listed by typing `help YOURCOMMAND` to the prompt;
+The key bindings for the current mode are listed upon pressing `?`.