Building Documents


MMT can be used as a build tool using a special shell command.

build ARCHIVE TARGET [P/A/T/H] runs the build target TARGET on the archive with id ARCHIVE. Optionally, the operation can be restricted to the subfolder P/A/T/H.

Defining Build Targets

The collection of build targets is maintained by the extension manager. New build targets are defined by implementing the archives.BuildTarget class. Build target modfiers and change management are supported for automatically for every build target.

Build Target Modifiers

  • The target TARGET* only operates on input files that have been modified since the last build.
  • The target -TARGET cleans, i.e., deletes the generated files.

The file-properties of the operating system are used to detect changes. Timestamps for the previous build are stored in META-INF/timestamps.

Any target may be followed by a modifier. Apart from --force, other supported modifiers are --forceDeps (which also forces building of dependencies), --depsFirst, --onChange, --onError, --dry-run and --clean (as well as --test,--test-add and --test-update). Omitting the modifier defaults to --onChange, i.e. files are only rebuild if they have changed on disk after an earlier build. (--onError rebuilds if the previous build failed with an error.)

Individual Build Targets

Many build targets work with input and/or output dimensions. Those are the top level folders within an archive. The most important build targets (which are available by default) include:

TargetInput dimensionOutput dimensionProvided byDescription
indexsourcecontent, narration, relationalapi indexes and prepares OMDoc source files for MMT lookups, the produced dimensions are from where MMT retrieves content, documents, and the ontology, respectively
mmt-omdocsourceas indexapi like index but parses and type-checks MMT source files instead of OMDoc files
twelf-omdocsourceas indexLF plugin like mmt-omdoc but for Twelf syntax
htmlnarrationhtmlapi produces html website, which relates to source roughly as JavaDoc does to Java
svgnarrationsvgapi produces theory graphs
scalacontentscalaapi produces Scala stubs for all MMT theories
lf-scalacontentlf-scalaLF plugin produces LF-aware typed Scala stubs
marmultiplenone, produces file NAME.marapi creates a math archive, a zipped collection of the archive

Build Queue Interface

See Build Queue for detailed information on multi-threaded building.

Error Viewer Interface

See Error Viewer for detailed information on seeing the results of building many files.