Mercurial > irccd
annotate doc/html/misc/configuration-syntax.md @ 276:5795a1769de5
Docs: add more indexes
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 29 Sep 2016 13:09:58 +0200 |
parents | 904ee87bc808 |
children | a60142be369a |
rev | line source |
---|---|
260
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
1 --- |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
2 title: Configuration file format |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
3 guide: yes |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
4 --- |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
5 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
6 Both `irccd` and `irccdctl` use configuration file in a extended [INI][ini] format. |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
7 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
8 # General syntax |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
9 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
10 The file syntax has following rules: |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
11 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
12 1. Each option is stored in a section, |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
13 2. Some sections may be redefined multiple times, |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
14 3. Empty option must have quotes (e.g. `option = ""`). |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
15 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
16 # The @include statement |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
17 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
18 Irccd adds an extension to this format by adding an `@include` keyword which let you splitting your configuration file. |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
19 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
20 <div class="alert alert-info" role="alert"> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
21 **Note:** this `@include` statement must be at the beginning of the file and must be surrounded by quotes if the file |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
22 name has spaces. |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
23 </div> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
24 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
25 You can use both relative or absolute paths. If relative paths are used, they are relative to the current file being |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
26 parsed. |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
27 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
28 ## Example |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
29 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
30 ````ini |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
31 @include "rules.conf" |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
32 @include "servers.conf" |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
33 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
34 [mysection] |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
35 myoption = "1" |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
36 ```` |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
37 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
38 # The list construct |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
39 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
40 When requested, an option can have multiples values in a list. The syntax uses parentheses and values are separated |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
41 by commas. |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
42 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
43 If the list have only one value, you can just use a simple string. |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
44 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
45 ## Examples |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
46 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
47 <div class="panel panel-success"> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
48 <div class="panel-heading">**Example:** two servers defined in a rule</div> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
49 <div class="panel-body"> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
50 ````ini |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
51 [rule] |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
52 servers = ( "server1", "server2" ) |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
53 ```` |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
54 </div> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
55 </div> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
56 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
57 <div class="panel panel-success"> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
58 <div class="panel-heading">**Example:** only one server</div> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
59 <div class="panel-body"> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
60 ````ini |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
61 [rule] |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
62 servers = "only-one-server" |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
63 ```` |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
64 </div> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
65 </div> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
66 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
67 <div class="alert alert-info" role="alert"> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
68 **Note:** spaces are completely optional. |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
69 </div> |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
70 |
904ee87bc808
CMake: split documentation into several topic, closes #535
David Demelier <markand@malikania.fr>
parents:
diff
changeset
|
71 [ini]: https://en.wikipedia.org/wiki/INI_file |