Skip to content

Commit 5f87644

Browse files
committed
[docs] Move custom widget type guide from README
1 parent 7701418 commit 5f87644

File tree

4 files changed

+25
-23
lines changed

4 files changed

+25
-23
lines changed

README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,6 @@ Lua libraries, but may depend on additional system utilities (see widget
1313
description).
1414

1515

16-
## <a name="custom-widget"></a>Custom widget types
17-
18-
Use any of the existing widget types as a starting point for your
19-
own. Write a quick worker function that does the work and plug it
20-
in. How data will be formatted, will it be red or blue, should be
21-
defined in rc.lua (or somewhere else, outside the actual module).
22-
23-
Before writing a widget type you should check if there is already one in the
24-
contrib directory of Vicious. The contrib directory contains extra widgets you
25-
can use. Some are for less common hardware, and other were contributed by
26-
Vicious users. Most of the contrib widgets are obsolete. Contrib widgets will
27-
not be imported by init unless you explicitly enable it, or load them in your
28-
rc.lua.
29-
30-
Some users would like to avoid writing new modules. For them Vicious
31-
kept the old Wicked functionality, possibility to register their own
32-
functions as widget types. By providing them as the second argument to
33-
vicious.register. Your function can accept `format` and `warg`
34-
arguments, just like workers.
35-
36-
3716
## Usage examples
3817

3918
Start with a simple widget, like `date`. Then build your setup from

docs/source/custom.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. _custom-wtype:
2+
3+
Custom Widget Types
4+
===================
5+
6+
Use any of the existing widget types as a starting point for your own.
7+
Write a quick worker function that does the work and plug it in.
8+
How data will be formatted, will it be red or blue, should be
9+
defined in ``rc.lua`` (or somewhere else, outside the actual module).
10+
11+
Before writing a widget type you should check if there is already one
12+
in the contrib directory of Vicious. The contrib directory contains
13+
extra widgets you can use. Some are for less common hardware, and others
14+
were contributed by Vicious users. Most of the contrib widgets are obsolete.
15+
Contrib widgets will not be imported by init unless you explicitly enable it,
16+
or load them in your ``rc.lua``.
17+
18+
Some users would like to avoid writing new modules. For them Vicious kept
19+
the old Wicked functionality, possibility to register their own functions
20+
as widget types. By providing them as the second argument to
21+
:lua:func:`vicious.register`. Your function can accept ``format`` and ``warg``
22+
arguments, just like workers.

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Table of Contents
2121
usage-lua
2222
usage-awesome
2323
widgets
24+
custom
2425
caching
2526
security
2627
copying

docs/source/usage-awesome.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ call ``vicious.register`` to register it with Vicious:
3838
:ref:`provided by Vicious <widgets>` or customly defined.
3939
* ``function``: custom function from your own
4040
awesome configuration can be registered as widget types
41-
(see [Custom widget types](#custom-widget)).
41+
(see :ref:`custom-wtype`).
4242

4343
:param format:
4444
either of
@@ -120,7 +120,7 @@ vicious.call
120120
:ref:`provided by Vicious <widgets>` or customly defined.
121121
* ``function``: custom function from your own
122122
awesome configuration can be registered as widget types
123-
(see [Custom widget types](#custom-widget)).
123+
(see :ref:`custom-wtype`).
124124

125125
:param format:
126126
either of

0 commit comments

Comments
 (0)