Skip to content

Commit 59ca5fb

Browse files
committed
first documentation for plugins
1 parent 65df43b commit 59ca5fb

File tree

3 files changed

+34
-14
lines changed

3 files changed

+34
-14
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ not released yet
3131
status of an event with a symbol (e.g. `` for accepted, `` for declined,
3232
`?` for tentative); partication status is shown for the email addresses
3333
configured for the event's calendar
34+
* NEW support for color theme, command, and formatter plugins
3435

3536
0.11.2
3637
======

doc/source/hacking.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,36 @@ Before we will accept your PR, we will ask you to:
3131
* make sure your patch conforms with :pep:`008` (should be covered by passing
3232
tests)
3333

34+
Plugins
35+
-------
36+
37+
Khal now supports plugins, currently for supporting new commands (`example
38+
command plugin`_), formatting (`example formatting plugin`), and
39+
colors (`example color plugin`).
40+
41+
If you want to develop a new feature, please check if it can be implemented as
42+
a plugin. If you are unsure, please ask us, we will gladly help you and, if
43+
needed, also extend the plugin API. We would like to see new functionality
44+
matured in plugins before we consider integrating it into khal's core.
45+
46+
.. _`example command plugin`: https://github.com/geier/khal_navigate
47+
.. _`example formatting plugin`: https://github.com/tcuthbert/khal/tree/plugin/example
48+
.. _`example color plugin`: https://github.com/geier/khal_gruvbox/tree/importlib
49+
50+
51+
Color scheme plugins
52+
*********************
53+
54+
Khal color schemes plugins are only availlable for the `ikhal` interface. They
55+
are installed as python packages (e.g. `python -m pip install khal_gruvbox`).
56+
A color scheme plugin must provide an entry point `khal_colorscheme` and contain
57+
an urwid palette definition. The palette definition is a list of tuples, where
58+
each tuple contains an attribute name and a color definition. See the `urwid
59+
documentation`_ for more information. All currently avaialable attributes can be
60+
found in `khal's source code`_.
61+
62+
.. _`urwid documentation`: http://urwid.org/manual/displayattributes.html
63+
.. _`khal's source code`: https://github.com/pimutils/khal/blob/master/khal/ui/colors.py
3464

3565
General notes for developing khal (and lots of other python packages)
3666
---------------------------------------------------------------------

khal/settings/khal.spec

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -255,20 +255,9 @@ blank_line_before_day = boolean(default=False)
255255

256256
# Choose a color theme for khal.
257257
#
258-
# This is very much work in progress. Help is really welcome! The two currently
259-
# available color schemes (*dark* and *light*) are defined in
260-
# *khal/ui/colors.py*, you can either help improve those or create a new one
261-
# (see below). As ikhal uses urwid, have a look at `urwid's documentation`__
262-
# for how to set colors and/or at the existing schemes. If you cannot change
263-
# the color of an element (or have any other problems) please open an issue on
264-
# github_.
265-
#
266-
# If you want to create your own color scheme, copy the structure of the
267-
# existing ones, give it a new and unique name and also add it as an option in
268-
# `khal/settings/khal.spec` in the section `[default]` of the property `theme`.
269-
#
270-
# __ http://urwid.org/manual/displayattributes.html
271-
# .. _github: https://github.com/pimutils/khal/issues
258+
# Khal ships with two color themes, *dark* and *light*. Additionally, plugins
259+
# might supply different color schemes.
260+
# You can also define your own color theme in the [palette] section.
272261
theme = string(default='dark')
273262

274263
# Whether to show a visible frame (with *box drawing* characters) around some

0 commit comments

Comments
 (0)