summaryrefslogtreecommitdiff
path: root/doc/source
diff options
context:
space:
mode:
Diffstat (limited to 'doc/source')
-rw-r--r--doc/source/conf.py249
-rw-r--r--doc/source/dev/common.rst8
-rw-r--r--doc/source/dev/events.rst142
-rw-r--r--doc/source/dev/index.rst19
-rw-r--r--doc/source/dev/plugin.rst41
-rw-r--r--doc/source/dev/sleek.rst16
-rw-r--r--doc/source/dev/timed_events.rst17
-rw-r--r--doc/source/index.rst35
-rw-r--r--doc/source/install.rst129
-rw-r--r--doc/source/themes.rst108
10 files changed, 764 insertions, 0 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
new file mode 100644
index 00000000..c0badf1d
--- /dev/null
+++ b/doc/source/conf.py
@@ -0,0 +1,249 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# Poezio Plugin development documentation build configuration file, created by
+# sphinx-quickstart on Mon Mar 4 23:39:07 2013.
+#
+# 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
+sys.path.insert(0, os.path.abspath('../stub'))
+sys.path.append(os.path.abspath('../../src/'))
+
+# 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.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode']
+
+# 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 = 'Poezio Plugin development'
+copyright = '2013, Mathieu Pasquet - Florent Le Coz'
+
+# 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.1'
+# The full version, including alpha/beta/rc tags.
+release = '0.1'
+
+# 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 = {}
+
+# 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 = None
+
+# 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 = 'PoezioPlugindevelopmentdoc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+ ('index', 'PoezioPlugindevelopment.tex', 'Poezio Plugin development Documentation',
+ 'Mathieu Pasquet - Florent Le Coz', '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
+
+# 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', 'poezioplugindevelopment', 'Poezio Plugin development Documentation',
+ ['Mathieu Pasquet - Florent Le Coz'], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output ------------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ ('index', 'PoezioPlugindevelopment', 'Poezio Plugin development Documentation',
+ 'Mathieu Pasquet - Florent Le Coz', 'PoezioPlugindevelopment', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+intersphinx_mapping = {'http://docs.python.org/': None}
diff --git a/doc/source/dev/common.rst b/doc/source/dev/common.rst
new file mode 100644
index 00000000..f9ee7c77
--- /dev/null
+++ b/doc/source/dev/common.rst
@@ -0,0 +1,8 @@
+Common operations documentation
+===============================
+
+.. automodule:: common
+ :members:
+ :undoc-members:
+
+
diff --git a/doc/source/dev/events.rst b/doc/source/dev/events.rst
new file mode 100644
index 00000000..c2aa4036
--- /dev/null
+++ b/doc/source/dev/events.rst
@@ -0,0 +1,142 @@
+Event Index
+===========
+
+The following events are poezio-only events, for SleekXMPP events, check out
+`their index <http://sleekxmpp.com/event_index.html>`_.
+
+.. glossary::
+ :sorted:
+
+ muc_say
+ - **message:** :py:class:`~sleekxmpp.Message` that will be sent
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Triggered whenever the user sends a message to a :py:class:`~tabs.MucTab`.
+
+ muc_say_after
+ - **message:** :py:class:`~sleekxmpp.Message` that will be sent
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Same thing than :term:`muc_say`, but after XHTML generation of the body, if needed.
+ This means you must not insert any colors in the body in the handler, since
+ it may lead to send invalid XML. This hook is less safe than ``muc_say`` and
+ you should probably not need it.
+
+ private_say
+ - **message:** :py:class:`~sleekxmpp.Message` that will be sent
+ - **tab:** :py:class:`~tabs.PrivateTab` source
+
+ Triggered whenever the user sends a message to a :py:class:`~tabs.PrivateTab`.
+
+ private_say_after
+ - **message:** :py:class:`~sleekxmpp.Message` that will be sent
+ - **tab:** :py:class:`~tabs.PrivateTab` source
+
+ Same thing than :term:`private_say`, but after XHTML generation of the body, if needed.
+ This means you must not insert any colors in the body in the handler, since
+ it may lead to send invalid XML. This hook is less safe than :term:`private_say` and
+ you should probably not need it.
+
+ conversation_say
+ - **message:** :py:class:`~sleekxmpp.Message` that will be sent
+ - **tab:** :py:class:`~tabs.ConversationTab` source
+
+ Triggered whenever the user sends a message to a :py:class:`~tabs.ConversationTab`.
+
+ conversation_say_after:
+ - **message:** :py:class:`~sleekxmpp.Message` that will be sent
+ - **tab:** :py:class:`~tabs.ConversationTab` source
+
+ Same thing than :term:`conversation_say`, but after XHTML generation of the body, if needed.
+ This means you must not insert any colors in the body in the handler, since
+ it may lead to send invalid XML. This hook is less safe than :term:`conversation_say` and
+ you should probably not need it.
+
+ muc_msg
+ - **message:** :py:class:`~sleekxmpp.Message` received
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Triggered when a message is received in a :py:class:`~tabs.MucTab`.
+
+ private_msg
+ - **message:** :py:class:`~sleekxmpp.Message` received
+ - **tab:** :py:class:`~tabs.PrivateTab` source
+
+ Triggered when a message is received in a :py:class:`~tabs.PrivateTab`.
+
+ conversation_msg
+ - **message:** :py:class:`~sleekxmpp.Message` received
+ - **tab:** :py:class:`~tabs.ConversationTab` source
+
+ Triggered when a message is received in a :py:class:`~tabs.ConversationTab`.
+
+ conversation_chatstate
+ - **message:** :py:class:`~sleekxmpp.Message` received
+ - **tab:** :py:class:`~tabs.ConversationTab` source
+
+ Triggered when a chatstate is received in a :py:class:`~tabs.ConversationTab`.
+
+ muc_chatstate
+ - **message:** :py:class:`~sleekxmpp.Message` received
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Triggered when a chatstate is received in a :py:class:`~tabs.MucTab`.
+
+ private_chatstate
+ - **message:** :py:class:`~sleekxmpp.Message` received
+ - **tab:** :py:class:`PrivateTab <tabs.PrivateTab>` source
+
+ Triggered when a chatstate is received in a :py:class:`~tabs.PrivateTab`.
+
+ normal_presence
+ - **presence:** :py:class:`~sleekxmpp.Presence` received
+ - **resource:** :py:class:`Resource <str>` that emitted the :py:class:`~sleekxmpp.Presence`
+
+ Triggered when a presence is received from a contact.
+
+ muc_presence
+ - **presence:** :py:class:`~sleekxmpp.Presence` received
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Triggered when a presence is received from someone in a :py:class:`~tabs.MucTab`.
+
+ send_normal_presence
+ - **presence:** :py:class:`~sleekxmpp.Presence` sent
+
+ Triggered when before poezio sends a new :py:class:`~sleekxmpp.Presence` stanza.
+
+ muc_join
+ - **presence:** :py:class:`~sleekxmpp.Presence` received
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Triggered when an user joins a :py:class:`~tabs.MucTab`
+
+ muc_ban
+ - **presence:** :py:class:`~sleekxmpp.Presence` received
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Triggered when an user from a :py:class:`~tabs.MucTab`
+ gets banned.
+
+ muc_kicked
+ - **presence:** :py:class:`~sleekxmpp.Presence` received
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Triggered when an user from a :py:class:`~tabs.MucTab`
+ gets kicked.
+
+ muc_nickchange
+ - **presence:** :py:class:`~sleekxmpp.Presence` received
+ - **tab:** :py:class:`~tabs.MucTab` source
+
+ Triggered when an user in a :py:class:`~tabs.MucTab` changes
+ his nickname.
+
+ ignored_private
+ - **message**:py:class:`~sleekxmpp.Message` received
+ - **tab:** :py:class:`~tabs.PrivateTab` source
+
+ Triggered when a private message (that goes in a :py:class:`~tabs.PrivateTab`)
+ is ignored automatically by poezio.
+
+ **tab** is always ``None``, except when a tab has already been opened.
diff --git a/doc/source/dev/index.rst b/doc/source/dev/index.rst
new file mode 100644
index 00000000..7498e0e8
--- /dev/null
+++ b/doc/source/dev/index.rst
@@ -0,0 +1,19 @@
+.. Poezio Plugin development documentation master file, created by
+ sphinx-quickstart on Mon Mar 4 23:39:07 2013.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Development documentation
+=========================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ plugin
+ events
+ timed_events
+ common
+ sleek
+
diff --git a/doc/source/dev/plugin.rst b/doc/source/dev/plugin.rst
new file mode 100644
index 00000000..7978a5e9
--- /dev/null
+++ b/doc/source/dev/plugin.rst
@@ -0,0 +1,41 @@
+Plugin API documentation
+========================
+
+.. module:: plugin
+
+.. autoclass:: BasePlugin
+ :members: init, cleanup, api, core
+
+ .. method:: init(self)
+
+ Method called at the creation of the plugin.
+
+ Do not override __init__ and use this instead.
+
+ .. method:: cleanup(self)
+
+ Method called before the destruction of the plugin.
+
+ Use it to erase or save things before the plugin is disabled.
+
+ .. attribute:: core
+
+ The Poezio :py:class:`~Core` object. Use it carefully.
+
+ .. attribute:: api
+
+ The :py:class:`~PluginAPI` instance for this plugin.
+
+
+Each plugin inheriting :py:class:`~BasePlugin` has an ``api`` member variable, which refers
+to a :py:class:`~PluginAPI` object.
+
+The :py:class:`~PluginAPI` object is an a interface through which the :py:class:`~BasePlugin`
+(and inheritors) *should* go to interact with poezio. If it is not sufficient, then the ``core``
+member can be used.
+
+.. autoclass:: PluginAPI
+ :members:
+ :undoc-members:
+
+
diff --git a/doc/source/dev/sleek.rst b/doc/source/dev/sleek.rst
new file mode 100644
index 00000000..7baf5b29
--- /dev/null
+++ b/doc/source/dev/sleek.rst
@@ -0,0 +1,16 @@
+SleekXMPP classes
+=================
+
+.. module:: sleekxmpp
+
+.. autoclass:: Message
+ :members:
+
+.. autoclass:: Presence
+ :members:
+
+.. autoclass:: Iq
+ :members:
+
+
+
diff --git a/doc/source/dev/timed_events.rst b/doc/source/dev/timed_events.rst
new file mode 100644
index 00000000..a2c96912
--- /dev/null
+++ b/doc/source/dev/timed_events.rst
@@ -0,0 +1,17 @@
+Timed events documentation
+==========================
+
+.. automodule:: timed_events
+
+.. autoclass:: TimedEvent
+
+ .. automethod:: __init__
+ .. automethod:: has_timed_out
+ .. automethod:: change_date
+ .. automethod:: add_delay
+
+
+.. autoclass:: DelayedEvent
+
+ .. automethod:: __init__
+
diff --git a/doc/source/index.rst b/doc/source/index.rst
new file mode 100644
index 00000000..1b621e5a
--- /dev/null
+++ b/doc/source/index.rst
@@ -0,0 +1,35 @@
+.. Poezio Plugin development documentation master file, created by
+ sphinx-quickstart on Mon Mar 4 23:39:07 2013.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Poezio documentation
+====================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 1
+
+ install
+ themes
+ dev/index
+
+..
+ configure
+ ssl
+ usage
+ themes
+ keys
+ plugins
+ misc
+ xep
+ dev
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/doc/source/install.rst b/doc/source/install.rst
new file mode 100644
index 00000000..45330dc6
--- /dev/null
+++ b/doc/source/install.rst
@@ -0,0 +1,129 @@
+Installing Poezio
+=================
+
+
+.. important:: Python 3.2 or better is highly recommended, as we do not
+ officially support python 3.1 (although we do try to keep things running).
+
+Poezio in the GNU/Linux distributions
+-------------------------------------
+
+As far as I know, Poezio is available in the following distributions, you just
+have to install it by using the package manager of the distribution, if you're
+using one of these.
+
+- *Archlinux*: A poezio and poezio-git packages are in AUR (use your favourite
+ AUR wrapper to install them)
+- *Gentoo*: `Sekh’s overlay`_ contains everything required to build poezio
+ (sleekxmpp, dnspython, and poezio)
+- *Debian*: Use an other distro. (or make a package, we can provide help :) )
+
+(If an other distribution provides a poezio package, please tell us and we will
+ add it to the list)
+
+Install poezio from the sources
+-------------------------------
+
+You can download poezio's `stable sources`_, or fetch the development
+version (trunk), using git:
+
+.. code-block:: bash
+
+ git clone https://git.louiz.org/poezio
+
+.. note:: To clone the repo, which uses a self-signed certificated, you can
+ prefix the clone command with GIT_SSL_NO_VERIFY=1.
+
+In order for poezio to correctly work, you need the libs SleekXMPP and
+ dnspython. You can install them by downloading it from the `SleekXMPP`_
+ page and the `dnspython`_ page , but you'll need the development
+ version of SleekXMPP. Alternatively, you can download poezio's sources
+ including SleekXMPP and dnspython, that's the easier way.
+
+""""""""""""
+Dependencies
+""""""""""""
+
+.. note:: If your python3 version is too old because of debian (e.g. < 3.2), you
+ should install the python3-argparse package if it exists, or use
+ pip3/virtualenvs to install it.
+
+If you want to install SleekXMPP and dnspython by yourself, use the following
+instructions. Else, go to the :ref:`next section <poezio-install-label>` (recommended).
+
+
+Download SleekXMPP
+
+.. code-block:: bash
+
+ git clone git://github.com/fritzy/SleekXMPP.git
+
+Make sure you're using the develop branch by typing
+
+.. code-block:: bash
+
+ cd SleekXMPP
+ git checkout develop
+
+Install SleekXMPP with
+
+.. code-block:: bash
+
+ python3 setup.py build
+ su -c "python3 setup.py install"
+
+Install the dnspython3 package on your distribution or install it manually:
+
+.. code-block:: bash
+
+ wget -O dnspython.tgz http://www.dnspython.org/kits3/1.10.0/dnspython3-1.10.0.tar.gz
+ tar xvf dnspython.tgz
+ cd dnspython3-1.10.0
+
+And do the same again:
+
+.. code-block:: bash
+
+ python3 setup.py build
+ su -c "python3 setup.py install"
+
+.. _poezio-install-label:
+
+"""""""""""""""""""
+Poezio installation
+"""""""""""""""""""
+
+If you skipped the installation of the dependencies and you only want to test
+poezio without a system-wide install, do, in the *poezio* directory:
+
+.. code-block:: bash
+
+ ./update.sh
+
+If you have git installed, it will download and update locally the
+ libraries for you. (and if you don’t have git installed, install it)
+
+
+If you don't want to install poezio but just test it (or keep a development
+ version), do:
+
+.. code-block:: bash
+
+ ./launch.sh
+
+To install poezio, do, as root (or sudo with ubuntu or whatever):
+
+.. code-block:: bash
+
+ make install
+
+And then start it with:
+
+.. code-block:: bash
+
+ poezio
+
+.. _Sekh’s overlay: https://github.com/sekh/sekh_overlay
+.. _stable sources: https://dev.louiz.org/project/poezio/download
+.. _SleekXMPP: https://github.com/fritzy/SleekXMPP/
+.. _dnspython: http://www.dnspython.org/
diff --git a/doc/source/themes.rst b/doc/source/themes.rst
new file mode 100644
index 00000000..98b5f13e
--- /dev/null
+++ b/doc/source/themes.rst
@@ -0,0 +1,108 @@
+Themes
+======
+
+This page describes how themes work in poezio and how to create or
+modify one.
+
+A theme contains color attributes and character definitions. Poezio can display
+up to **256** colors if your terminal supports it. Most of the time,
+if it doesn’t work, that’s because the **$TERM** environnment variable is
+wrong. For example with tmux or screen, set it to **screen-256color**, in
+**xterm**, set it to **xterm-256color**, etc.
+
+If your terminal doesn’t have 256 colors, only 8 colors will be available,
+and poezio will replace the colors by one of the 8 values available.
+Thus, some theme files may not work properly if you only have 8 colors,
+for example light gray on dark gray may be converted to black on black, making
+the text impossible to read).
+
+.. note:: The default theme should work properly in any case. If not, that’s a bug.
+
+A theme file is a python file (with the .py extension) containing a
+class, inheriting the *theming.Theme* class defined into the *theming*
+poezio module.
+
+To check how may colors your current terminal/$TERM supports, do:
+
+.. code-block:: bash
+
+ tput colors
+
+
+Create a theme
+--------------
+
+To create a theme named foo, create a file named foo.py into the theme
+directory (by default it’s _~/.local/share/poezio/themes/_) and insert
+into it:
+
+.. code-block:: python
+
+ import theming
+
+ class FooTheme(theming.Theme):
+ # Define here colors for that theme
+ theme = FooTheme()
+
+To define a *color pair* and assign it to the *COLOR_NAME* option, just do
+
+.. code-block:: python
+
+ class FooTheme(theming.Theme):
+ COLOR_NAME = (fg_color, bg_color, opt_attr)
+
+You do not have to define all the :ref:`available options`,
+you can decide that your theme will only change some options, the other
+one will just have the default value (from the default theme).
+
+Colors and attributes
+~~~~~~~~~~~~~~~~~~~~~
+A color pair defines how the text will be displayed on the screen. It
+has a *foreground color* (fg_color), a *background color* (bg_color)
+and an **optional** *attribute* (opt_attr).
+
+Colors
+^^^^^^
+A color is a number between -1 and 255. If it -1, this is the default
+color defined by your terminal (for example if your terminal displays
+text white on black by default, a fg_color of -1 is white, and a bg_color
+of -1 is black). If it’s between 0 and 256 it represents one of the colors
+on the image:
+
+.. figure:: ../images/theme_256_colors.png
+ :alt: The list of all 256 colors
+
+ The list of all 256 colors
+
+Attributes
+^^^^^^^^^^
+An attribute is a python string (so, it has to be surrounded by
+*" "* or *' '*). It can be one of the following:
+
+- *'b'*: bold text
+- *'u'*: underlined text
+
+Use a theme
+-----------
+To use a theme, just define the **theme** option into the
+*configuration file* to the name of the theme you want
+to use. If that theme is not found, the default theme will be used instead.
+Note that the default theme is defined directly into poezio’s source code,
+and not in a theme file.
+
+Change the theme directory
+--------------------------
+To change the default theme directory (**~/.local/share/poezio/themes/** by
+default), you have to change the *themes_dir* option in the
+*configuration file* to the directory that contains your
+theme files.
+
+.. _available-options:
+
+Available options
+-----------------
+
+.. warning:: This section is not complete.
+
+All available options can be found into the default theme, which is into the
+_theming.py_ file from the poezio’s source code.