Settings
Flamingo manages its settings in plain python files. Settings are project specific and hold information like where the content files are stored, where the output should be written to and which plugins are installed.
Naming Conventions
All settings should be uppercase. If a setting has no prefix or the prefix DEFAULT_ you are free to change them. If a setting is prefixed CORE_ it is used to implement flamingo core features.
For example the variable CORE_PLUGINS holds a list of plugins that implement parts of the meta data handling, handling of static files, hooks etc. If you change this list, you should know what you are doing.
DEFAULT_PLUGINS holds a selection of plugins the most users will need. If you don't need them, you are free to clear or modify this list.
PLUGINS holds a list of user activated plugins and is empty by default.
Overlaying Settings
Most of flamingo command line tools come with an option -s for settings, which can be one or more python files.
Let's say you have two settings files named settings.py and debug.py.
# settings.py
DEBUG = False
PLUGINS = [
'plugin1',
'plugin2',
]
# debug.py
DEBUG = True
PLUGINS.append('debug_plugin')
If you call flamingo flamingo build -s settings.py debug.py, debug.py will override settings.py like this:
# settings.py + debug.py
DEBUG = True
PLUGINS = [
'plugin1',
'plugin2',
'debug_plugin',
]
Default Settings
Paths
DEFAULT_PLUGINS =
['flamingo.plugins.HTML',
'flamingo.plugins.Yaml',
'flamingo.plugins.reStructuredText',
'flamingo.plugins.rstInclude',
'flamingo.plugins.rstImage',
'flamingo.plugins.rstLink',
'flamingo.plugins.rstTable']
this are the default plugins
CONTENT_ROOT =
'content'
flamingo will search for content here recursivly
CONTENT_PATHS =
[]
if set, flamingo will only parse the defined paths
OUTPUT_ROOT =
'output'
flamingo will write the rendered HTML here
MEDIA_ROOT =
'media'
flamingo will copy all media files used in content objects here
STATIC_ROOT =
'output/static'
flamingo will copy all static files of activated themes here
Plugins
CORE_PLUGINS_PRE =
['flamingo.core.plugins.layers.PreBuildLayers',
'flamingo.core.plugins.MetaDataDefaults']
these plugins implement basic flamingo features
you can change this list if you are a developer and know what you are doing
DEFAULT_PLUGINS =
['flamingo.plugins.HTML',
'flamingo.plugins.Yaml',
'flamingo.plugins.reStructuredText',
'flamingo.plugins.rstInclude',
'flamingo.plugins.rstImage',
'flamingo.plugins.rstLink',
'flamingo.plugins.rstTable']
these plugins are the default selection of flaming plugins, the most users will need
you are free to change this list
PLUGINS =
[]
list of user installed plugins
CORE_PLUGINS_POST =
['flamingo.core.plugins.Media',
'flamingo.core.plugins.Static',
'flamingo.core.plugins.layers.PostBuildLayers']
these plugins implement basic flamingo features
you can change this list if you are a developer and know what you are doing
SKIP_HOOKS =
[]
Parsing
USE_CHARDET =
False
if enabled, chardet gets used to detect file types while parsing content files
FOLLOW_LINKS =
True
control if flamingo should follow filesystem links while searching for content files
DEDENT_INPUT =
False
control if flamingo should try to dedent a content file while parsing
HTML_PARSER_RAW_HTML =
False
if set to True the HTML parser won't process the HTML content of html content files
Templating
TEMPLATING_ENGINE =
'flamingo.core.templating.Jinja2'
PRE_RENDER_CONTENT =
True
if set to True, templating syntax in content files is available
CORE_THEME_PATHS =
['/home/runner/work/flamingo/flamingo/flamingo/theme']
THEME_PATHS =
[]
DEFAULT_TEMPLATE =
'page.html'
DEFAULT_PAGINATION =
25
EXTRA_CONTEXT =
{}
JINJA2_EXTENSIONS =
[]