Previous topic

plantweb.args

Next topic

plantweb.directive

This Page

plantweb.defaults

Plantweb main rendering module.

Functions

plantweb.defaults.read_defaults(cached=True)

Get the defaults values.

Parameters:cached (bool) – Read cached default values or determine them from the list of providers. See DEFAULTS_PROVIDERS.
Returns:A dictionary like DEFAULT_CONFIG with the user defaults.
Return type:dict

Variables

plantweb.defaults.DEFAULT_CONFIG

Default configuration for plantweb.

Note

The default engine will be used only when the engine was unset and it was unable to be auto-determined.

To set a different default configuration create a JSON file .plantwebrc in your git repository root or in your home, as defined in DEFAULTS_PROVIDERS.

{'cache_dir': '~/.cache/plantweb',
 'engine': 'plantuml',
 'format': 'svg',
 'server': 'http://plantuml.com/plantuml/',
 'use_cache': True}
plantweb.defaults.DEFAULTS_PROVIDERS

List of defaults providers ordered by read priority.

Last items will be processed last and thus will override previous values.

Available providers are:

git://
Will fetch the repository root from current working directory using git’s git rev-parse --show-toplevel and then read the specified file from that path.
file://
Will read the file specified. User expansion ~ is supported.
python://

Will import the given variable or function:

  • If a function, it will be executed without arguments and its result will be used.
  • If a variable, it must be a dictionary similar to DEFAULT_CONFIG.
['python://plantweb.defaults.DEFAULT_CONFIG',
 'file://~/.plantwebrc',
 'git://.plantwebrc']