MooseDocs Configuration
In order to use the MooseDocs build
command, one or more configuration files are required. By default the moosedocs.py
script looks for any file in the same directory as itself with a name that ends with "config.yml" (the --config
option can be used to specify the files directly). As the extension suggests, these must be YAML files. The configurations must each contain a Content
section, and optionally the additional sections described here to fine-tune your MooseDocs build.
Content
The content section is typically a list of directories that contain the markdown content that is desired to be rendered to HTML, as shown below. It is possible to use environment variables within the list. In particular, MOOSE_DIR
and ROOT_DIR
are always available, where ROOT_DIR
is the directory of your application.
Content:
- doc/content
- ${MOOSE_DIR}/framework/doc/content
The path may also include *
and **
wildcards. The *
wildcard will match any single directory or filename. For example, doc/content/*/minimal
will include all sub-directories of the content directory that contain a minimal
directory. The **
wildcard allows for arbitrary levels of nesting. For example doc/content/**/minimal
will include the minimal
directory for any directory below the content directory, regardless of depth.
Content Across Multiple Configurations
For the case of multiple configuration files, redundant content is not permitted. That is, any two configurations may not specify the same file of any type—directories are the only exception. The content of each is added to a shared pool so the complete, combined list of files will be available to all translators. Importantly, the respective configurations of content files will be honored during translation allowing different pages to use different readers, renderers, executioners, and extensions, which provides an extraordinary amount of flexibility about how your website is built.
As a good example of how to resolve content conflicts, consider the main MOOSE website along with the error_outline Page not found. It is possible to build the main site configuration by itself by running the following commands:
cd modules/doc
./moosedocs.py build --config config.yml
Or the workshop configuration by
cd tutorials/darcy_thermo_mech/doc
./moosedocs.py build
However, these two configurations specify some of the same content. Thus, we made use of the YAML !include
syntax to create a separate workshop configuration specialized for a combined build and it is shown in Listing 1. In this file, we made sure to not add any files already added by the main site configuration, which left only the actual workshop pages. All of the media, bibliographies, JavaScript, etc., that it needs will still be available in the combined build. Then the configurations of the Executioner, Renderer, and Extensions were simply imported from the original file.
Listing 1: Configuration for the MOOSE workshop designed to build alongside the main website that takes advantage of the !include
syntax.
Content:
workshop:
root_dir: !include tutorials/darcy_thermo_mech/doc/config.yml Content workshop root_dir
content:
- workshop/**
Executioner: !include tutorials/darcy_thermo_mech/doc/config.yml Executioner
Renderer: !include tutorials/darcy_thermo_mech/doc/config.yml Renderer
Extensions: !include tutorials/darcy_thermo_mech/doc/config.yml Extensions
If you find yourself creating autolinks across pages from different configurations and you are concerned about them failing when only building one of those configurations, consider using the alternative
setting (see the AutoLink Extension page for more information).
Advanced Content
There is also a more advanced interface for the content, but it is required to explain how these directories are used. When building content all relevant files (e.g., markdown) are extracted from the supplied list of directories into a set, with the path relative to the supplied directory. This unique set of files is then copied to the destination directory of the build, with markdown files being rendered to html first. For example, the following illustrates how the multiple source files are combined in the destination directory.
doc/content/index.md -> ${HOME}/.local/share/moose/site/index.html
${MOOSE_DIR}/framework/doc/content/utilities/index.md -> ${HOME}/.local/share/moose/site/utilties/index.md
In the advanced mode the root location can be specified for each location, in this case the content configuration section contains a dictionary of dictionaries as shown below. The top-level key is an arbitrary name, the second level has two keys available: "root_dir" and "content". The root_dir is the directory to include and "content" is a list of folders and/or files within the root_dir to consider.
Content:
app:
root_dir: doc/content
framework:
root_dir: ${MOOSE_DIR}/framework/doc/content/utilities
content:
- MooseDocs
Given the above configuration, the files within the MooseDocs folder are now included directly within the destination folder (i.e., the "utilities" directory is removed) as shown below.
doc/content/index.md -> ${HOME}/.local/share/moose/site/index.html
${MOOSE_DIR}/framework/doc/content/utilities/MooseDocs/setup.md -> ${HOME}/.local/share/moose/site/MooseDocs/setup.md
Extensions
The Extensions section is used to enable non-default or custom extensions as well as change the configuration for existing extensions. The list of default extensions is shown in Listing 2. For example, the following snippet changes the settings for the Common Extension extension. Note, the first level key name ("globals") is arbitrary and the "type" key name under that is required. The value matches with the python package loaded, as in Listing 2.
Extensions:
globals:
type: MooseDocs.extensions.common
shortcuts: !include framework/doc/globals.yml
The various extensions as well as links to the documentation for each extension, which includes the available configuration options, is found on the specification page.
Listing 2: List of default MooseDocs extensions.
DEFAULT_EXTENSIONS = ['MooseDocs.extensions.core',
'MooseDocs.extensions.shortcut',
'MooseDocs.extensions.floats',
'MooseDocs.extensions.command',
'MooseDocs.extensions.include',
'MooseDocs.extensions.style',
'MooseDocs.extensions.media',
'MooseDocs.extensions.listing',
'MooseDocs.extensions.table',
'MooseDocs.extensions.autolink',
'MooseDocs.extensions.devel',
'MooseDocs.extensions.package',
'MooseDocs.extensions.alert',
'MooseDocs.extensions.katex',
'MooseDocs.extensions.appsyntax',
'MooseDocs.extensions.bibtex',
'MooseDocs.extensions.common',
'MooseDocs.extensions.layout',
'MooseDocs.extensions.config',
'MooseDocs.extensions.materialicon',
'MooseDocs.extensions.acronym',
'MooseDocs.extensions.content',
'MooseDocs.extensions.graph',
'MooseDocs.extensions.heading',
'MooseDocs.extensions.gallery',
'MooseDocs.extensions.navigation',
'MooseDocs.extensions.template',
'MooseDocs.extensions.comment',
'MooseDocs.extensions.special',
'MooseDocs.extensions.ifelse',
'MooseDocs.extensions.pysyntax',
'MooseDocs.extensions.modal',
'MooseDocs.extensions.datetime',
'MooseDocs.extensions.algorithm',
'MooseDocs.extensions.gitutils',
'MooseDocs.extensions.versioner']
Renderer
The Renderer section allows for the type of renderer to be selected, the default is the MaterializeRenderer
. This is the only complete renderer object and it does have many available options, please refer to the source code for the available options. An example Renderer section is shown below.
Renderer:
type: MooseDocs.base.MaterializeRenderer
favicon: media/moose.ico
Reader
The Reader section allows the reader object to be defined, by default the MarkdownReader
objects is used. Currently, this is the only type of reader and there are no configuration options, so this section is not necessary.
(contrib/moose/modules/doc/config.yml)
Content:
framework:
root_dir: ${MOOSE_DIR}/framework/doc/content
modules:
root_dir: ${MOOSE_DIR}/modules/doc/content
python:
root_dir: ${MOOSE_DIR}/python/doc/content
chemical_reactions:
root_dir: ${MOOSE_DIR}/modules/chemical_reactions/doc/content
combined:
root_dir: ${MOOSE_DIR}/modules/combined/doc/content
contact:
root_dir: ${MOOSE_DIR}/modules/contact/doc/content
electromagnetics:
root_dir: ${MOOSE_DIR}/modules/electromagnetics/doc/content
external_petsc_solver:
root_dir: ${MOOSE_DIR}/modules/external_petsc_solver/doc/content
fluid_properties:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/doc/content
fsi:
root_dir: ${MOOSE_DIR}/modules/fsi/doc/content
functional_expansion_tools:
root_dir: ${MOOSE_DIR}/modules/functional_expansion_tools/doc/content
geochemistry:
root_dir: ${MOOSE_DIR}/modules/geochemistry/doc/content
heat_transfer:
root_dir: ${MOOSE_DIR}/modules/heat_transfer/doc/content
level_set:
root_dir: ${MOOSE_DIR}/modules/level_set/doc/content
misc:
root_dir: ${MOOSE_DIR}/modules/misc/doc/content
navier_stokes:
root_dir: ${MOOSE_DIR}/modules/navier_stokes/doc/content
optimization:
root_dir: ${MOOSE_DIR}/modules/optimization/doc/content
peridynamics:
root_dir: ${MOOSE_DIR}/modules/peridynamics/doc/content
phase_field:
root_dir: ${MOOSE_DIR}/modules/phase_field/doc/content
porous_flow:
root_dir: ${MOOSE_DIR}/modules/porous_flow/doc/content
ray_tracing:
root_dir: ${MOOSE_DIR}/modules/ray_tracing/doc/content
rdg:
root_dir: ${MOOSE_DIR}/modules/rdg/doc/content
richards:
root_dir: ${MOOSE_DIR}/modules/richards/doc/content
reactor:
root_dir: ${MOOSE_DIR}/modules/reactor/doc/content
scalar_transport:
root_dir: ${MOOSE_DIR}/modules/scalar_transport/doc/content
solid_mechanics:
root_dir: ${MOOSE_DIR}/modules/solid_mechanics/doc/content
solid_properties:
root_dir: ${MOOSE_DIR}/modules/solid_properties/doc/content
stochastic_tools:
root_dir: ${MOOSE_DIR}/modules/stochastic_tools/doc/content
thermal_hydraulics:
root_dir: ${MOOSE_DIR}/modules/thermal_hydraulics/doc/content
xfem:
root_dir: ${MOOSE_DIR}/modules/xfem/doc/content
air:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/air/doc/content/source
external: True
carbon_dioxide:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/carbon_dioxide/doc/content/source
external: True
helium:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/helium/doc/content/source
external: True
nitrogen:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/nitrogen/doc/content/source
external: True
potassium:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/potassium/doc/content/source
external: True
sodium:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/sodium/doc/content/source
external: True
Renderer:
type: MooseDocs.base.MaterializeRenderer
favicon: media/moose.ico
Extensions:
MooseDocs.extensions.navigation:
name: 'MOOSE'
repo: https://github.com/idaholab/moose
google-cse: 000781241768298771085:pedtnlxdkx8
menu:
Training: training/index.md
Getting Started:
Installing MOOSE: getting_started/installation/index.md
Creating an Application: getting_started/new_users.md
Examples and Tutorials: getting_started/examples_and_tutorials/index.md
NCRC Applications: help/inl/applications.md
Virtual Test Bed: https://mooseframework.inl.gov/virtual_test_bed/
INL HPC Services: help/inl/index.md
Supplemental Resources: getting_started/supplemental_resources/index.md
Frequently Asked Questions: help/faq/index.md
Troubleshooting: help/troubleshooting.md
Help Forum: https://github.com/idaholab/moose/discussions
Contact Us: help/contact_us.md
Documentation:
Application Usage: application_usage/index.md
Application Development: application_development/index.md
Framework Development: framework_development/index.md
Modules: modules/index.md
MOOSEDocs: MooseDocs/index.md
Infrastructure: infrastructure/index.md
Syntax Index: syntax/index.md
Source Index: /source/index.md
A-to-Z Index: help/a-to-z.md
Applications:
Thermal Hydraulics: applications/thermal_hydraulics.md
NCRC Applications: help/inl/applications.md
Gallery: /gallery.md
News: newsletter/index.md
Citing: citing.md
MooseDocs.extensions.bibtex:
duplicates: !include modules/doc/duplicate_bibs.yml
MooseDocs.extensions.katex:
macros: !include modules/doc/katex_macros.yml
MooseDocs.extensions.appsyntax: # WARNING: this must follow katex for doco pages to work
executable: ${MOOSE_DIR}/modules/combined
unregister:
framework: !include framework/doc/unregister.yml
thermal_hydraulics:
AddComponentAction: Components/*/*
Component: Components/*/*
remove:
framework: !include framework/doc/remove.yml
fluid_properties: !include modules/fluid_properties/doc/remove.yml
richards: !include modules/richards/doc/remove.yml
stochastic_tools: !include modules/stochastic_tools/doc/remove.yml
MooseDocs.extensions.common:
shortcuts: !include framework/doc/globals.yml
MooseDocs.extensions.acronym:
acronyms: !include framework/doc/acronyms.yml
MooseDocs.extensions.content:
source_links:
actions: source/actions/Action.md
actioncomponents: ActionComponents/index.md
application: Application/index.md
auxkernels: AuxKernels/index.md
auxscalarkernels: AuxScalarKernels/index.md
bcs: syntax/BCs/index.md
bounds: syntax/Bounds/index.md
closures: syntax/Closures/index.md
components: syntax/Components/index.md
constraints: syntax/Constraints/index.md
controllogic: syntax/ControlLogic/index.md
controls: syntax/Controls/index.md
correctors: syntax/Correctors/index.md
covariances: syntax/Covariance/index.md
dampers: syntax/Dampers/index.md
dgkernels: syntax/DGKernels/index.md
dirackernels: syntax/DiracKernels/index.md
distributions: syntax/Distributions/index.md
executioners: syntax/Executioner/index.md
executors: syntax/Executors/index.md
fluidproperties: syntax/FluidProperties/index.md
functions: syntax/Functions/index.md
functormaterials: syntax/FunctorMaterials/index.md
fvbcs: syntax/FVBCs/index.md
fviks: syntax/FVInterfaceKernels/index.md
fvics: syntax/FVICs/index.md
fvkernels: syntax/FVKernels/index.md
hdgbcs: syntax/HDGBCs/index.md
hdgkernels: syntax/HDGKernels/index.md
linearfvkernels: syntax/LinearFVKernels/index.md
linearfvbcs: syntax/LinearFVBCs/index.md
ics: syntax/ICs/index.md
indicators: syntax/Adaptivity/Indicators/index.md
interfacekernels: syntax/InterfaceKernels/index.md
interfaces: framework_development/interfaces/index.md
kernels: syntax/Kernels/index.md
linesearches: syntax/LineSearches/index.md
markers: syntax/Adaptivity/Markers/index.md
materials: syntax/Materials/index.md
mesh: syntax/Mesh/index.md
meshdivisions: syntax/MeshDivisions/index.md
meshgenerators: syntax/Mesh/index.md
meshmodifiers: syntax/MeshModifiers/index.md
multiapps: syntax/MultiApps/index.md
neml2: syntax/NEML2/index.md
nodalkernels: syntax/NodalKernels/index.md
optimizationreporters: syntax/OptimizationReporter/index.md
outputs: syntax/Outputs/index.md
parser: source/parser/Parser.md
partitioner: syntax/Mesh/Partitioner/index.md
physics: syntax/Physics/index.md
positions: syntax/Positions/index.md
postprocessors: syntax/Postprocessors/index.md
preconditioners: syntax/Preconditioning/index.md
predictors: syntax/Executioner/Predictor/index.md
problems: syntax/Problem/index.md
raybcs: syntax/RayBCs/index.md
raykernels: syntax/RayKernels/index.md
raytracing: modules/ray_tracing/index.md
relationshipmanagers: source/relationshipmanagers/RelationshipManager.md
reporters: syntax/Reporters/index.md
restart: application_usage/restart_recover.md
samplers: syntax/Samplers/index.md
scalarkernels: syntax/ScalarKernels/index.md
solidproperties: syntax/SolidProperties/index.md
splits: syntax/Preconditioning/index.md
surrogates: syntax/Surrogates/index.md
likelihoods: syntax/Likelihood/index.md
trainers: syntax/Trainers/index.md
systems: syntax/Systems/index.md
timeintegrators: syntax/Executioner/TimeIntegrator/index.md
times: syntax/Times/index.md
timesteppers: syntax/Executioner/TimeStepper/index.md
transfers: syntax/Transfers/index.md
userobject: syntax/UserObjects/index.md
userobjects: syntax/UserObjects/index.md
utils: framework_development/utils/index.md
variablemappings: syntax/VariableMappings/index.md
variables: syntax/Variables/index.md
vectorpostprocessors: syntax/VectorPostprocessors/index.md
MooseDocs.extensions.civet:
test_results_cache: '/tmp/civet/jobs'
remotes:
moose:
url: https://civet.inl.gov
repo: idaholab/moose
MooseDocs.extensions.template:
active: True
args:
company: Ford # used for example in python/MooseDocs/extensions/template.md
thm-bin-opt: thermal_hydraulics-opt
thm-bin-dbg: thermal_hydraulics-dbg
MooseDocs.extensions.sqa:
active: True
reports: !include modules/doc/sqa_reports.yml
categories:
framework: !include framework/doc/sqa_framework.yml
python: !include python/doc/sqa_python.yml
contact: !include modules/contact/doc/sqa_contact.yml
electromagnetics: !include modules/electromagnetics/doc/sqa_electromagnetics.yml
fluid_properties: !include modules/fluid_properties/doc/sqa_fluid_properties.yml
fsi: !include modules/fsi/doc/sqa_fsi.yml
heat_transfer: !include modules/heat_transfer/doc/sqa_heat_transfer.yml
level_set: !include modules/level_set/doc/sqa_level_set.yml
misc: !include modules/misc/doc/sqa_misc.yml
navier_stokes: !include modules/navier_stokes/doc/sqa_navier_stokes.yml
optimization: !include modules/optimization/doc/sqa_optimization.yml
phase_field: !include modules/phase_field/doc/sqa_phase_field.yml
porous_flow: !include modules/porous_flow/doc/sqa_porous_flow.yml
ray_tracing: !include modules/ray_tracing/doc/sqa_ray_tracing.yml
rdg: !include modules/rdg/doc/sqa_rdg.yml
reactor: !include modules/reactor/doc/sqa_reactor.yml
scalar_transport: !include modules/scalar_transport/doc/sqa_scalar_transport.yml
solid_properties: !include modules/solid_properties/doc/sqa_solid_properties.yml
stochastic_tools: !include modules/stochastic_tools/doc/sqa_stochastic_tools.yml
solid_mechanics: !include modules/solid_mechanics/doc/sqa_solid_mechanics.yml
thermal_hydraulics: !include modules/thermal_hydraulics/doc/sqa_thermal_hydraulics.yml
xfem: !include modules/xfem/doc/sqa_xfem.yml
requirement-groups:
dgkernels: DGKernel Objects
interfacekernels: InterfaceKernel Objects
MooseDocs.extensions.algorithm:
active: True
MooseDocs.extensions.analytics:
active: True
google_measurement_id: G-RH7BY5XXNW
# Used to create a reference/example page for the tagging extension (see PR #25388)
MooseDocs.extensions.tagging: !include modules/electromagnetics/doc/config.yml Extensions MooseDocs.extensions.tagging
(contrib/moose/tutorials/darcy_thermo_mech/doc/config.yml)
Content:
workshop:
root_dir: ${MOOSE_DIR}/tutorials/darcy_thermo_mech/doc/content
moose:
root_dir: ${MOOSE_DIR}/framework/doc/content
content:
- ../../../tutorials/tutorial02_multiapps/doc/content/getting_started/examples_and_tutorials/tutorial02_multiapps/images/coupling.png
- large_media/tutorials/darcy_thermo_mech/*
- large_media/testing/*
- large_media/tutorials/INL_Hex_Light_Presentation_Background_Thin.png
- large_media/contact/ironing_gallery.mp4
- large_media/gallery/dipole_antenna.mp4
- large_media/ray_tracing/cone_ray_study_u.png
- large_media/ray_tracing/cone_ray_study_rays.png
- large_media/optimization/fig_optCycle.png
- large_media/fsi/sloshing.gif
- contrib/**
- css/**
- js/**
- bib/**
- syntax/**
- source/base/MooseObject.md
- source/utils/InputParameters.md
- source/parser/Parser.md
- source/geomsearch/GeometricSearchData.md
- source/actions/Action.md
- source/relationshipmanagers/RelationshipManager.md
- source/outputs/Exodus.md
- source/meshgenerators/FileMeshGenerator.md
- source/meshgenerators/MeshDiagnosticsGenerator.md
modules:
root_dir: ${MOOSE_DIR}/modules/doc/content
content:
- application_usage/failed_solves.md
- getting_started/installation/index.md
- help/development/VSCode.md
chemical_reactions:
root_dir: ${MOOSE_DIR}/modules/chemical_reactions/doc/content
content:
- bib/**
fet:
root_dir: ${MOOSE_DIR}/modules/functional_expansion_tools/doc/content
content:
- bib/**
reactor:
root_dir: ${MOOSE_DIR}/modules/reactor/doc/content
content:
- modules/reactor/index.md
Executioner:
type: MooseDocs.base.Serial
Renderer:
type: MooseDocs.base.RevealRenderer
theme: simple
Extensions:
disable_defaults: True
MooseDocs.extensions.alert: default
MooseDocs.extensions.comment: default
MooseDocs.extensions.command: default
MooseDocs.extensions.core: default
MooseDocs.extensions.config: default
MooseDocs.extensions.media: default
MooseDocs.extensions.floats: default
MooseDocs.extensions.include: default
MooseDocs.extensions.bibtex:
duplicates: !include modules/doc/duplicate_bibs.yml # necessary when building with main site
MooseDocs.extensions.katex:
macros:
\vec: "\\bar" # TODO: \vec doesn't render
\pf: "\\frac{\\partial #1}{\\partial #2}"
MooseDocs.extensions.style: default
MooseDocs.extensions.autolink: default
MooseDocs.extensions.materialicon: default
MooseDocs.extensions.heading: default
MooseDocs.extensions.shortcut: default
MooseDocs.extensions.table: default
MooseDocs.extensions.layout: default
MooseDocs.extensions.content: default
MooseDocs.extensions.modal: default
MooseDocs.extensions.acronym:
acronyms: !include framework/doc/acronyms.yml
MooseDocs.extensions.listing:
modal-link: False
MooseDocs.extensions.reveal:
translate: workshop/index.md
background_image: INL_Hex_Light_Presentation_Background_Thin.png
MooseDocs.extensions.datetime: default
(contrib/moose/modules/doc/workshop_config.yml)
Content:
workshop:
root_dir: !include tutorials/darcy_thermo_mech/doc/config.yml Content workshop root_dir
content:
- workshop/**
Executioner: !include tutorials/darcy_thermo_mech/doc/config.yml Executioner
Renderer: !include tutorials/darcy_thermo_mech/doc/config.yml Renderer
Extensions: !include tutorials/darcy_thermo_mech/doc/config.yml Extensions
(contrib/moose/python/MooseDocs/common/load_config.py)
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
"""Tool for loading MooseDocs config hit file."""
import types
import importlib
import logging
import collections
from mooseutils import recursive_update
from mooseutils.yaml_load import yaml_load
import MooseDocs
from ..tree import pages
from ..common import exceptions
LOG = logging.getLogger(__name__)
# Set of extensions to load by default
DEFAULT_EXTENSIONS = ['MooseDocs.extensions.core',
'MooseDocs.extensions.shortcut',
'MooseDocs.extensions.floats',
'MooseDocs.extensions.command',
'MooseDocs.extensions.include',
'MooseDocs.extensions.style',
'MooseDocs.extensions.media',
'MooseDocs.extensions.listing',
'MooseDocs.extensions.table',
'MooseDocs.extensions.autolink',
'MooseDocs.extensions.devel',
'MooseDocs.extensions.package',
'MooseDocs.extensions.alert',
'MooseDocs.extensions.katex',
'MooseDocs.extensions.appsyntax',
'MooseDocs.extensions.bibtex',
'MooseDocs.extensions.common',
'MooseDocs.extensions.layout',
'MooseDocs.extensions.config',
'MooseDocs.extensions.materialicon',
'MooseDocs.extensions.acronym',
'MooseDocs.extensions.content',
'MooseDocs.extensions.graph',
'MooseDocs.extensions.heading',
'MooseDocs.extensions.gallery',
'MooseDocs.extensions.navigation',
'MooseDocs.extensions.template',
'MooseDocs.extensions.comment',
'MooseDocs.extensions.special',
'MooseDocs.extensions.ifelse',
'MooseDocs.extensions.pysyntax',
'MooseDocs.extensions.modal',
'MooseDocs.extensions.datetime',
'MooseDocs.extensions.algorithm',
'MooseDocs.extensions.gitutils',
'MooseDocs.extensions.versioner']
DEFAULT_READER = 'MooseDocs.base.MarkdownReader'
DEFAULT_RENDERER = 'MooseDocs.base.MarkdownReader'
DEFAULT_TRANSLATOR = 'MooseDocs.base.Translator'
DEFAULT_EXECUTIONER = 'MooseDocs.base.ParallelQueue'
def load_config(filename, **kwargs):
"""
Read the config.yml file and create the Translator object.
"""
config = yaml_load(filename, root=MooseDocs.ROOT_DIR)
# Replace 'default' and 'disable' key in Extensions to allow for recursive_update to accept command line
for key in config.get('Extensions', dict()).keys():
if config['Extensions'][key] == 'default':
config['Extensions'][key] = dict()
if config['Extensions'][key] == 'disable':
config['Extensions'][key] = dict(active=False)
# Apply command-line key value pairs
recursive_update(config, kwargs)
extensions = _yaml_load_extensions(config)
reader = _yaml_load_object('Reader', config, DEFAULT_READER)
renderer = _yaml_load_object('Renderer', config, DEFAULT_RENDERER)
content = _yaml_load_content(config, reader.EXTENSIONS)
executioner = _yaml_load_object('Executioner', config, DEFAULT_EXECUTIONER)
translator = _yaml_load_object('Translator', config, DEFAULT_TRANSLATOR,
content, reader, renderer, extensions, executioner)
return translator, config
def load_configs(filenames, **kwargs):
"""
Read the YAML files listed in filenames and create unique Translator objects for each. Each
configuration should specify the same translator destination unless it is set globally via the
kwargs. The kwargs are applied the same to all configurations (see the load_config() method).
The content specified by each configuration is added to a common pool of content and then
distributed to each Translator object. The contents output is a list of lists containing the
pages that a corresponding translator is responsible for. Each translator creates independent
Extensions, Reader, Renderer, and Executioner objects to build its designated page objects, but
they still should have access to those built by any other translator.
The local names of all page objects must be unique within the global content pool. The only
exceptions are pages.Directory objects, for which duplicates may occur. Directories will simply
be written out by the first translator that encounters them.
"""
destination = kwargs.get('Translator', dict()).get('destination')
destined = False
translators = list()
configurations = list()
for file in filenames:
trans, config = load_config(file, **kwargs)
# Make sure translators are all outputting to the same destination
current = config.get('Translator', dict()).get('destination')
if current is not None:
if destined and current != destination:
msg = "The translator destination '{}' was specified by {}, but another " \
"configuration file used '{}'. Please specify a value in only one file or " \
"the same value in all files. Otherwise, use the kwargs to override all."
raise exceptions.MooseDocsException(msg, current, file, destination)
elif destination is None:
destination = current
destined = True
translators.append(trans)
configurations.append(config)
if destined:
for translator in translators:
translator.update(destination=destination)
# Set contents for each translator then loop through and distribute their contents to all others
contents = [[page for page in translator.getPages()] for translator in translators]
pooled = list() # initialize global content pool
for index, translator in enumerate(translators):
cotranslators = [t for t in translators if t is not translator]
for page in contents[index]:
if page.local in pooled:
if not isinstance(page, pages.Directory):
msg = "A page or file '{}' was specified by {}, but one by the same name had " \
"already been added to the content pool by another configuration file."
raise exceptions.MooseDocsException(msg, page.local, filenames[index])
else:
pooled.append(page.local)
for ct in cotranslators:
ct.addPage(page)
return translators, contents, configurations
def load_extensions(ext_list, ext_configs=None):
"""
Convert the supplied list into MooseDocs extension objects by calling the make_extension method.
Inputs:
ext_list[list]: List of extension modules or module names.
ext_configs[dict]: A dict() connecting configurations to the module, the key is the
complete module name.
"""
if ext_configs is None:
ext_configs = dict()
extensions = []
for ext in ext_list:
name, mod = _get_module(ext)
if not hasattr(mod, 'make_extension'):
msg = "The supplied module {} does not contain the required 'make_extension' function."
raise exceptions.MooseDocsException(msg, name)
else:
obj = mod.make_extension(**ext_configs.get(name, dict()))
# hack to allow build to disable via command line
extensions.append(obj)
return extensions
def _get_module(ext):
"""Helper for loading a module."""
if isinstance(ext, types.ModuleType):
name = ext.__name__
elif isinstance(ext, str):
name = ext
try:
ext = importlib.import_module(name)
except ImportError as e:
msg = "Failed to import the supplied '{}' module.\n{}"
raise exceptions.MooseDocsException(msg, name, e)
else:
msg = "The supplied module ({}) must be a module type or a string, but a {} object "\
"was provided."
raise exceptions.MooseDocsException(msg, ext, type(ext))
return name, ext
def _yaml_load_extensions(config):
"""Load extensions from the Extensions block of the YAML configuration file."""
# Extensions block
options = config.get('Extensions', dict())
# Load default configuration
ext_configs = collections.OrderedDict()
disable_defaults = options.pop('disable_defaults', False)
if not disable_defaults:
for ext in DEFAULT_EXTENSIONS:
ext_configs[ext] = dict()
# Get configuration items from configuration
for ext_type, settings in options.items():
if (settings is not None) and ('type' in settings):
msg = "Using 'type' for the extensions is deprecated, the type should be supplied " \
"as the key to the dictionary, rather than an arbitrary name."
LOG.warning(msg)
ext_type = settings.pop('type')
if ext_type not in ext_configs:
ext_configs[ext_type] = dict()
if isinstance(settings, dict):
ext_configs[ext_type].update(settings)
else:
msg = "The supplied settings for the '%s' extension must be dict() or the 'default' " \
"keyword should be used."
LOG.error(msg, ext_type)
return load_extensions(list(ext_configs.keys()), ext_configs)
def _yaml_load_object(name, config, default, *args):
"""Helper for loading MooseDocs objects: Reader, Renderer, Translator"""
options = config.get(name, dict())
obj_type = options.pop('type', default)
try:
return eval(obj_type)(*args, **options)
except NameError:
msg = "ERROR: The %s block must contain a valid object name."
LOG.error(msg, name)
def _yaml_load_content(config, in_ext):
"""Load the 'Content' section."""
options = config.get('Content', None)
if options is None:
msg = "The 'Content' section is required."
raise exceptions.MooseDocsException(msg)
items = MooseDocs.common.get_items(options)
return MooseDocs.common.get_content(items, in_ext)
(contrib/moose/modules/doc/config.yml)
Content:
framework:
root_dir: ${MOOSE_DIR}/framework/doc/content
modules:
root_dir: ${MOOSE_DIR}/modules/doc/content
python:
root_dir: ${MOOSE_DIR}/python/doc/content
chemical_reactions:
root_dir: ${MOOSE_DIR}/modules/chemical_reactions/doc/content
combined:
root_dir: ${MOOSE_DIR}/modules/combined/doc/content
contact:
root_dir: ${MOOSE_DIR}/modules/contact/doc/content
electromagnetics:
root_dir: ${MOOSE_DIR}/modules/electromagnetics/doc/content
external_petsc_solver:
root_dir: ${MOOSE_DIR}/modules/external_petsc_solver/doc/content
fluid_properties:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/doc/content
fsi:
root_dir: ${MOOSE_DIR}/modules/fsi/doc/content
functional_expansion_tools:
root_dir: ${MOOSE_DIR}/modules/functional_expansion_tools/doc/content
geochemistry:
root_dir: ${MOOSE_DIR}/modules/geochemistry/doc/content
heat_transfer:
root_dir: ${MOOSE_DIR}/modules/heat_transfer/doc/content
level_set:
root_dir: ${MOOSE_DIR}/modules/level_set/doc/content
misc:
root_dir: ${MOOSE_DIR}/modules/misc/doc/content
navier_stokes:
root_dir: ${MOOSE_DIR}/modules/navier_stokes/doc/content
optimization:
root_dir: ${MOOSE_DIR}/modules/optimization/doc/content
peridynamics:
root_dir: ${MOOSE_DIR}/modules/peridynamics/doc/content
phase_field:
root_dir: ${MOOSE_DIR}/modules/phase_field/doc/content
porous_flow:
root_dir: ${MOOSE_DIR}/modules/porous_flow/doc/content
ray_tracing:
root_dir: ${MOOSE_DIR}/modules/ray_tracing/doc/content
rdg:
root_dir: ${MOOSE_DIR}/modules/rdg/doc/content
richards:
root_dir: ${MOOSE_DIR}/modules/richards/doc/content
reactor:
root_dir: ${MOOSE_DIR}/modules/reactor/doc/content
scalar_transport:
root_dir: ${MOOSE_DIR}/modules/scalar_transport/doc/content
solid_mechanics:
root_dir: ${MOOSE_DIR}/modules/solid_mechanics/doc/content
solid_properties:
root_dir: ${MOOSE_DIR}/modules/solid_properties/doc/content
stochastic_tools:
root_dir: ${MOOSE_DIR}/modules/stochastic_tools/doc/content
thermal_hydraulics:
root_dir: ${MOOSE_DIR}/modules/thermal_hydraulics/doc/content
xfem:
root_dir: ${MOOSE_DIR}/modules/xfem/doc/content
air:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/air/doc/content/source
external: True
carbon_dioxide:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/carbon_dioxide/doc/content/source
external: True
helium:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/helium/doc/content/source
external: True
nitrogen:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/nitrogen/doc/content/source
external: True
potassium:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/potassium/doc/content/source
external: True
sodium:
root_dir: ${MOOSE_DIR}/modules/fluid_properties/contrib/sodium/doc/content/source
external: True
Renderer:
type: MooseDocs.base.MaterializeRenderer
favicon: media/moose.ico
Extensions:
MooseDocs.extensions.navigation:
name: 'MOOSE'
repo: https://github.com/idaholab/moose
google-cse: 000781241768298771085:pedtnlxdkx8
menu:
Training: training/index.md
Getting Started:
Installing MOOSE: getting_started/installation/index.md
Creating an Application: getting_started/new_users.md
Examples and Tutorials: getting_started/examples_and_tutorials/index.md
NCRC Applications: help/inl/applications.md
Virtual Test Bed: https://mooseframework.inl.gov/virtual_test_bed/
INL HPC Services: help/inl/index.md
Supplemental Resources: getting_started/supplemental_resources/index.md
Frequently Asked Questions: help/faq/index.md
Troubleshooting: help/troubleshooting.md
Help Forum: https://github.com/idaholab/moose/discussions
Contact Us: help/contact_us.md
Documentation:
Application Usage: application_usage/index.md
Application Development: application_development/index.md
Framework Development: framework_development/index.md
Modules: modules/index.md
MOOSEDocs: MooseDocs/index.md
Infrastructure: infrastructure/index.md
Syntax Index: syntax/index.md
Source Index: /source/index.md
A-to-Z Index: help/a-to-z.md
Applications:
Thermal Hydraulics: applications/thermal_hydraulics.md
NCRC Applications: help/inl/applications.md
Gallery: /gallery.md
News: newsletter/index.md
Citing: citing.md
MooseDocs.extensions.bibtex:
duplicates: !include modules/doc/duplicate_bibs.yml
MooseDocs.extensions.katex:
macros: !include modules/doc/katex_macros.yml
MooseDocs.extensions.appsyntax: # WARNING: this must follow katex for doco pages to work
executable: ${MOOSE_DIR}/modules/combined
unregister:
framework: !include framework/doc/unregister.yml
thermal_hydraulics:
AddComponentAction: Components/*/*
Component: Components/*/*
remove:
framework: !include framework/doc/remove.yml
fluid_properties: !include modules/fluid_properties/doc/remove.yml
richards: !include modules/richards/doc/remove.yml
stochastic_tools: !include modules/stochastic_tools/doc/remove.yml
MooseDocs.extensions.common:
shortcuts: !include framework/doc/globals.yml
MooseDocs.extensions.acronym:
acronyms: !include framework/doc/acronyms.yml
MooseDocs.extensions.content:
source_links:
actions: source/actions/Action.md
actioncomponents: ActionComponents/index.md
application: Application/index.md
auxkernels: AuxKernels/index.md
auxscalarkernels: AuxScalarKernels/index.md
bcs: syntax/BCs/index.md
bounds: syntax/Bounds/index.md
closures: syntax/Closures/index.md
components: syntax/Components/index.md
constraints: syntax/Constraints/index.md
controllogic: syntax/ControlLogic/index.md
controls: syntax/Controls/index.md
correctors: syntax/Correctors/index.md
covariances: syntax/Covariance/index.md
dampers: syntax/Dampers/index.md
dgkernels: syntax/DGKernels/index.md
dirackernels: syntax/DiracKernels/index.md
distributions: syntax/Distributions/index.md
executioners: syntax/Executioner/index.md
executors: syntax/Executors/index.md
fluidproperties: syntax/FluidProperties/index.md
functions: syntax/Functions/index.md
functormaterials: syntax/FunctorMaterials/index.md
fvbcs: syntax/FVBCs/index.md
fviks: syntax/FVInterfaceKernels/index.md
fvics: syntax/FVICs/index.md
fvkernels: syntax/FVKernels/index.md
hdgbcs: syntax/HDGBCs/index.md
hdgkernels: syntax/HDGKernels/index.md
linearfvkernels: syntax/LinearFVKernels/index.md
linearfvbcs: syntax/LinearFVBCs/index.md
ics: syntax/ICs/index.md
indicators: syntax/Adaptivity/Indicators/index.md
interfacekernels: syntax/InterfaceKernels/index.md
interfaces: framework_development/interfaces/index.md
kernels: syntax/Kernels/index.md
linesearches: syntax/LineSearches/index.md
markers: syntax/Adaptivity/Markers/index.md
materials: syntax/Materials/index.md
mesh: syntax/Mesh/index.md
meshdivisions: syntax/MeshDivisions/index.md
meshgenerators: syntax/Mesh/index.md
meshmodifiers: syntax/MeshModifiers/index.md
multiapps: syntax/MultiApps/index.md
neml2: syntax/NEML2/index.md
nodalkernels: syntax/NodalKernels/index.md
optimizationreporters: syntax/OptimizationReporter/index.md
outputs: syntax/Outputs/index.md
parser: source/parser/Parser.md
partitioner: syntax/Mesh/Partitioner/index.md
physics: syntax/Physics/index.md
positions: syntax/Positions/index.md
postprocessors: syntax/Postprocessors/index.md
preconditioners: syntax/Preconditioning/index.md
predictors: syntax/Executioner/Predictor/index.md
problems: syntax/Problem/index.md
raybcs: syntax/RayBCs/index.md
raykernels: syntax/RayKernels/index.md
raytracing: modules/ray_tracing/index.md
relationshipmanagers: source/relationshipmanagers/RelationshipManager.md
reporters: syntax/Reporters/index.md
restart: application_usage/restart_recover.md
samplers: syntax/Samplers/index.md
scalarkernels: syntax/ScalarKernels/index.md
solidproperties: syntax/SolidProperties/index.md
splits: syntax/Preconditioning/index.md
surrogates: syntax/Surrogates/index.md
likelihoods: syntax/Likelihood/index.md
trainers: syntax/Trainers/index.md
systems: syntax/Systems/index.md
timeintegrators: syntax/Executioner/TimeIntegrator/index.md
times: syntax/Times/index.md
timesteppers: syntax/Executioner/TimeStepper/index.md
transfers: syntax/Transfers/index.md
userobject: syntax/UserObjects/index.md
userobjects: syntax/UserObjects/index.md
utils: framework_development/utils/index.md
variablemappings: syntax/VariableMappings/index.md
variables: syntax/Variables/index.md
vectorpostprocessors: syntax/VectorPostprocessors/index.md
MooseDocs.extensions.civet:
test_results_cache: '/tmp/civet/jobs'
remotes:
moose:
url: https://civet.inl.gov
repo: idaholab/moose
MooseDocs.extensions.template:
active: True
args:
company: Ford # used for example in python/MooseDocs/extensions/template.md
thm-bin-opt: thermal_hydraulics-opt
thm-bin-dbg: thermal_hydraulics-dbg
MooseDocs.extensions.sqa:
active: True
reports: !include modules/doc/sqa_reports.yml
categories:
framework: !include framework/doc/sqa_framework.yml
python: !include python/doc/sqa_python.yml
contact: !include modules/contact/doc/sqa_contact.yml
electromagnetics: !include modules/electromagnetics/doc/sqa_electromagnetics.yml
fluid_properties: !include modules/fluid_properties/doc/sqa_fluid_properties.yml
fsi: !include modules/fsi/doc/sqa_fsi.yml
heat_transfer: !include modules/heat_transfer/doc/sqa_heat_transfer.yml
level_set: !include modules/level_set/doc/sqa_level_set.yml
misc: !include modules/misc/doc/sqa_misc.yml
navier_stokes: !include modules/navier_stokes/doc/sqa_navier_stokes.yml
optimization: !include modules/optimization/doc/sqa_optimization.yml
phase_field: !include modules/phase_field/doc/sqa_phase_field.yml
porous_flow: !include modules/porous_flow/doc/sqa_porous_flow.yml
ray_tracing: !include modules/ray_tracing/doc/sqa_ray_tracing.yml
rdg: !include modules/rdg/doc/sqa_rdg.yml
reactor: !include modules/reactor/doc/sqa_reactor.yml
scalar_transport: !include modules/scalar_transport/doc/sqa_scalar_transport.yml
solid_properties: !include modules/solid_properties/doc/sqa_solid_properties.yml
stochastic_tools: !include modules/stochastic_tools/doc/sqa_stochastic_tools.yml
solid_mechanics: !include modules/solid_mechanics/doc/sqa_solid_mechanics.yml
thermal_hydraulics: !include modules/thermal_hydraulics/doc/sqa_thermal_hydraulics.yml
xfem: !include modules/xfem/doc/sqa_xfem.yml
requirement-groups:
dgkernels: DGKernel Objects
interfacekernels: InterfaceKernel Objects
MooseDocs.extensions.algorithm:
active: True
MooseDocs.extensions.analytics:
active: True
google_measurement_id: G-RH7BY5XXNW
# Used to create a reference/example page for the tagging extension (see PR #25388)
MooseDocs.extensions.tagging: !include modules/electromagnetics/doc/config.yml Extensions MooseDocs.extensions.tagging