dmr configuration parsing is done in several phases:
Each phase overwrites values that were read in the previous phase.
Some options can take multiple values --exclude. These are specified differently depending on where they are configured:
On the command line, give multiple option strings:
dmr --exclude foo --exclude "bar and baz"
In the config file, use a quoted, space-separated list:
.. code-block:: cfg
[global] exclude = foo “bar and baz”
In the document, give multiple option strings:
In-document options are specified as comments. For instance:
.. options
footer
exclude Experience
You can specify options for a specific output format thusly:
.. options=json
footer
exclude Experience
Output-specific options override generic in-document options.
See ConfigParser.RawConfigParser.getboolean() for acceptable values for boolean configuration options.
All of the options below may be configured in the [global] section of the config file.
Command line | Config file | In Document | Description | Default | Values |
---|---|---|---|---|---|
--config -c | N/A | N/A | Specify a config file | /etc/dmr.conf | string |
--footer | footer | footer | Include a footer in the document with the DMR version | False | boolean |
--no-footer | N/A | no-footer | Override a default footer setting. | False | boolean |
--verbose -v | verbose | N/A | Be verbose. Specify this multiple times on the command line, or higher values in the config file, to increase verbosity. | 0 | int |
--format -f | output_format | N/A | Specify the output format | html | html, json, latex |
--exclude | exclude | exclude | Exclude the named sections or groups from the output. See Exclusions for more details. | None | multiple strings |
--include | include | include | Include the named sections or groups from the output. See Exclusions for more details. | None | multiple strings |
--outfile -o | outfile | N/A | Path to the output file. Specify - for stdout. | stdout | string |
First positional argument | infile | N/A | Path to the input file. Specify - for stdin. | stdin | string |
Individual output formatters can have their own configuration options. These options are generally set in a section of the config file named after the output format, although there are some sections (see, e.g., Genshi output options).
This option is configured in the [json] section of the config file.
Command line | Config file | Description | Default | Values |
---|---|---|---|---|
--pretty | pretty | Output prettified JSON | False | boolean |
All output formats that use Genshi may use the following options. (Currently, that’s just the LaTeX output format.)
Command line | Config file | Description | Default | Values |
---|---|---|---|---|
--template-path | template_path in [genshi] | Path to Genshi template directory | See below | string |
--template | template in output format section | Template to use, relative to the template path | See below | string |
The default template path is platform-specific, but will generally be something like /usr/share/dmr/templates. ~/.dmr/templates is also checked, regardless of what you specify for the template path.
The default template is <output name>.genshi, where <output name> is the all-lowercase name of the output format. For the LaTeX output, for instance, the default template is latex.genshi.
[global]
footer = yes
verbose = 1
format = latex
infile = resume.rst
outfile = resume.tex
[json]
pretty = yes
[genshi]
template_path = /usr/share/dmr/templates
[latex]
template = myresume.genshi