Rendering a draft document
To render a draft that your peers should review, you need to add these metadata to the document header:
-
:draft:
: Tells the compiler to display comments in the final output -
:status: draft
Defines the current document stage.
NOTE: Some flavors, for example ISO, use:docstage:
and a status code to indicate in what stage the document is.
To compile a Metanorma document you must enter the name of the application Metanorma
and the document you want to compile document.adoc
.
Metanorma document.adoc
With this command you trigger the Metanorma toolchain to:
-
Read the AsciiDoc input
-
Convert it into XML
-
Check the XML against the document model (XML schema)
-
Create HTML, PDF, and DOC output
Practice time
The code for this exercise is available on GitHub.
The corresponding file is named exercise-3-2.adoc
Let’s check out what happens when we compile exercise-3-2.adoc
To compile our document:
-
Open a new terminal
-
Start Docker using Docker Desktop.
-
Go to the directory where your Metanorma document(s) are stored. For example:
$ cd Documents/Metanorma/metanorma-tutorial
-
Start the container and compile the document. To learn more about the command syntax and options, read the metanorma-cli documentation.
NoteThe fontist automatically installs all needed fonts. The --agree-to-terms
option agrees to all font license agreements that come up during the compilation process. If you don’t set this option, you will be asked to agree to the licenses during the compilation process which might break it.Docker on Linux and macOSdocker run -v "$(pwd)":/metanorma/ -w /metanorma metanorma/metanorma metanorma compile -t ogc exercises/exercise-3-2.adoc --agree-to-terms
Docker on Windowsdocker run -v "%cd%":/metanorma/ -w /metanorma metanorma/metanorma metanorma compile -t ogc exercises/exercise-3-2.adoc --agree-to-terms
Hint Result
-
Relaton fetches checks the cited standards if it can fetch some information automatically. .
Now that you are familiar with the simplest way of creating a Metanorma document, let’s look at different ways to compile documents in the next lesson.