Documentation: Fix theming docs, the module is namespaced in poezio.
Thanks Hund for finding this issue!
This commit is contained in:
parent
8947caae2e
commit
69f28e97f3
1 changed files with 6 additions and 6 deletions
|
@ -19,7 +19,7 @@ the text impossible to read).
|
||||||
.. note:: The default theme should work properly in any case. If not, that’s a bug.
|
.. 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
|
A theme file is a python file (with the .py extension) containing a
|
||||||
class, inheriting the *theming.Theme* class defined into the *theming*
|
class, inheriting the *poezio.theming.Theme* class defined into the *theming*
|
||||||
poezio module.
|
poezio module.
|
||||||
|
|
||||||
To check how many colors your current terminal/$TERM supports, do:
|
To check how many colors your current terminal/$TERM supports, do:
|
||||||
|
@ -38,18 +38,18 @@ add:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
import theming
|
from poezio.theming import Theme
|
||||||
|
|
||||||
class FooTheme(theming.Theme):
|
class FooTheme(Theme):
|
||||||
# Define here colors for that theme
|
# Define here colors for that theme
|
||||||
theme = FooTheme()
|
theme = FooTheme()
|
||||||
|
|
||||||
To define a *color pair* and assign it to the *COLOR_NAME* option, just do
|
To define a *color pair* and assign it to the *COLOR_NAME* option, just do
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
class FooTheme(theming.Theme):
|
class FooTheme(Theme):
|
||||||
COLOR_NAME = (fg_color, bg_color, opt_attr)
|
COLOR_NAME = (fg_color, bg_color, opt_attr)
|
||||||
|
|
||||||
You do not have to define all the :ref:`available-options`,
|
You do not have to define all the :ref:`available-options`,
|
||||||
you can decide that your theme will only change some options, the other
|
you can decide that your theme will only change some options, the other
|
||||||
|
|
Loading…
Reference in a new issue