MooseDocs Setup for MOOSE-based Applications
Any MOOSE-based application can use the MooseDocs system to create custom websites. If MOOSE is installed, the necessary dependencies exist. Also, if you have recently created an application with the stork script (after Aug. 15, 2018) then your application will have the files necessary for a simple website already. The sections below will aid in setting up your application if you do not have the dependencies or the necessary documentation files.
Create Base Documentation Files
If you have an existing application without a doc
directory, then a few files must be created before you can begin building a website.
First, create a doc
directory at the root of your application code that contains the homepage for your application.
Second, create the MooseDocs executable and configuration file. This is most easily done by copying the files used by the stork script.
Once the files are copied over, replace all mentions of "Stork" in the config.yml
with the name of your application.
Install Dependencies
If you are not using the MOOSE conda package or your package is old, then we suggest that a new moose-tools
package be installed to obtain all needed dependencies, which can be done using conda. This command assumes that you have created and activated a conda environment for your MOOSE development:
Build a Live Website
To build a live website for your application, run the following:
When this command completes a message will be printed and the site will be hosted at http://127.0.0.1:8000. Note, when new pages are added the build command will need to be re-executed.
This executable contains command-line based help, which can be accessed using the "-h" flag as follows.
The configuration file contains information on how to build the website, additional details regarding this file may be found at MooseDocs Configuration.
Once you have a basic website running, it is time to document your custom code and application objects. Information to get started follows in the next section of this documentation. In general, applications mimic the MOOSE process, so it is best to also refer to the MOOSE instructions for documentation (see Documenting MOOSE).
Generating Object Documentation Files
During the course of development, especially during the creation of new application objects (e.g., kernels, boundary conditions, interface conditions, etc.), it is important to create documentation outlining any new capabilities. Templates for object documents can be generated using the MooseDocs script using the "generate" sub-command. To generate templates for new objects (and assuming your application is named Foo
), run:
For example, with a new kernel object called FooDiffusion
without documentation, the following output will be seen:
And the following template would be created:
Note that certain items, such as the source code description, object parameters, inputs in which the object is used, and child objects are filled in automatically using the AppSyntax Extension. The lines leading with !!
as well as the !alert
extension command should be removed and replaced with relevant documentation regarding how to use the object.
When creating documentation, it is particularly important to note any design limitations or assumptions as well as best practices to apply when using the object.