Markdown documents are validated automatically as you type. The conversion
engine constantly tries to parse your changes to display the results in the Preview
pane. If a change results in an error that prevents the parser from converting the syntax, an
error message will be displayed in the DITA tab or in the Results view at the
bottom of the editor.
Examples of the type of errors that will be reported include headers being in the wrong order
or the syntax of a document begins with something other than a 1st level header.
Validating Markdown Documents with Schematron
It is possible to validate Markdown documents with Schematron rules.
There are two ways to create an association between Markdown documents and Schematron
files:
- You can configure an association using the Markdown preferences
page. You can specify a Schematron file to validate converted HTML content, as
well as one to validate converted DITA content.
- You can create a Schematron association for Markdown documents by
adding a catalog mapping for one of the
following URIs:
- http://www.oxygenxml.com/schematron/validation/markdown-as-html - The
obtained Schematron will be applied over HTML conversions.
- http://www.oxygenxml.com/schematron/validation/markdown-as-dita - The
obtained Schematron will be applied over DITA conversions.
The catalog mapping is a fallback in case the Schematron
validation is disabled in the
Markdown preferences page or the path to the
Schematron file is empty.
Warning: If you are using a
custom version
of DITA-OT, the mapping information might not be generated properly,
causing issues with the Schematron validation. For example, error locations may not
be accurate or synchronization may fail.
Tip: Inside the samples folder, there is a
schematron-validation folder with some files you can use to see how
Schematron validation can be done with Markdown files. The path of the folder is:
[OXYGEN_INSTALL_DIR]/samples/markdown/schematron-validation/.