docs: update configuration documention

Note support for inline comments and the current behavior
for include directives.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2022-07-25 17:06:51 -04:00
parent e264fa82b2
commit 5d4db16fd6
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
3 changed files with 33 additions and 8 deletions

View File

@ -43,7 +43,7 @@ to see if any action is necessary on their part. The date of the most
recent change is included. recent change is included.
Users:\ Users:\
[user_changes.md](https://moonraker.readthedocs.io/en/latest/user_changes/) - April 6th 2022 [user_changes.md](https://moonraker.readthedocs.io/en/latest/user_changes/) - July 27th 2022
Developers:\ Developers:\
[api_changes.md](https://moonraker.readthedocs.io/en/latest/api_changes/) - March 4th 2022 [api_changes.md](https://moonraker.readthedocs.io/en/latest/api_changes/) - March 4th 2022

View File

@ -9,6 +9,24 @@ and Moonraker (`moonraker.conf`), each example contains a comment indicating
which configuration file is being referenced A basic which configuration file is being referenced A basic
[sample configuration](./moonraker.conf) in the `docs` directory. [sample configuration](./moonraker.conf) in the `docs` directory.
Moonraker uses an ini style configuration very close to that of Klipper.
Inline comments are supported, prefixed by either a `#` or `;`. If it
is necessary to use one of those characters in an option, they may be
escaped using backslash, ie `\#`. For example:
```ini
# This is a comment
[section_name] # This is a comment
opt: \# This is not a comment
```
Moonraker uses strict parsing rules. A configuration file may not
contain multiple sections of the same name. A section may not contain
multiple options of the same name. However, configuration files included
using [include directives](#include-directives) may contain sections
specified in other files, and those sections may contain options
specified in other files.
## Core Components ## Core Components
Moonraker's core components are always loaded regardless of configuration. Moonraker's core components are always loaded regardless of configuration.
@ -1933,8 +1951,8 @@ attach: http://192.168.1.100/webcam/?action=snapshot
It is possible to include configuration from other files via include It is possible to include configuration from other files via include
directives. Include directives in Moonraker are specified identically directives. Include directives in Moonraker are specified identically
to those in Klipper, ie: `[include relative_path]`. The `relative_path` to those in Klipper, ie: `[include relative_path]`. The `relative_path`
is a path relative to the configuration file's parent, and may include is a path relative to the configuration file's parent folder, and may
wildcards. For example: include wildcards. For example:
```ini ```ini
# moonraker.conf # moonraker.conf
@ -1946,11 +1964,10 @@ wildcards. For example:
``` ```
If a section is duplicated in an included file the options from both If a section is duplicated in an included file the options from both
sections will be merged, with the latest file parsed taking precedence. sections will be merged, with the latest section parsed taking precedence.
When wildcards are specified all matches are parsed in alphabetical The order in which a section is parsed depends on the location of the
order. If includes are nested (ie: an included file specifies an include directive. When wildcards are specified all matches are parsed in
`[include]` directive), those includes will be parsed after all matches alphabetical order.
of the previous include.
## Jinja2 Templates ## Jinja2 Templates

View File

@ -2,6 +2,14 @@
This file will track changes that require user intervention, This file will track changes that require user intervention,
such as a configuration change or a reinstallation. such as a configuration change or a reinstallation.
### July 27th 2022
- The behavior of `[include]` directives has changed. Included files
are now parsed as they are encountered. If sections are duplicated
options in the last section parsed take precendence. If you are
using include directives to override configuration in `moonraker.conf`
the directives should be moved to the bottom of the file.
- Configuration files now support inline comments.
### April 6th 2022 ### April 6th 2022
- The ability to configure core components in the `[server]`section - The ability to configure core components in the `[server]`section
is now deprecated. When legacy items are detected in `[server]` a is now deprecated. When legacy items are detected in `[server]` a