MDITA syntax
In 2017, the Markdown plug-in was superseded by the LwDITA plug-in, which was bundled with DITA-OT 3.0, and added new formats for Lightweight DITA. The mdita
format implements the subset of Markdown features proposed in the latest specification drafts, but differs in some ways from the original Markdown DITA format.
To apply the stricter LwDITA-specific processing to a Markdown topic, create a topic reference in your map and set the @format
attribute to mdita
:
In this case, the first paragraph in the topic is treated as a short description, and tables are converted to DITA <simpletable>
elements.
The MDITA format uses CommonMark as the underlying markup language. MDITA files must be UTF-8 encoded.
The MDITA parser processes topics according to the MDITA “Extended profile” proposed for LwDITA. The "Core profile" can be enabled for custom parser configurations.
The following Markdown constructs are parsed differently when the @format
attribute is set to mdita
.
Titles and document structure
The first heading level generates a topic and the second heading level a section:
The ID is generated automatically from the title content.
Topic content
The first paragraph is treated as a <shortdesc>
element.
Tables
Tables use the MultiMarkdown table extension format:
Tables in MDITA files are converted to DITA <simpletable>
elements:
Table cells may only contain inline content.
MDITA map syntax
DITA maps can be written in MDITA using standard Markdown syntax for links and lists.
In MDITA, maps use the file name extension mditamap
to define the file as a map:
In MDITA, both ordered and unordered list items create <topicref>
elements.
Common syntax
The following common Markdown constructs are processed in the same way for both mdita
and markdown
topics.
Hard line breaks
A line break that is preceded by two or more spaces is parsed as a hard line break. Because DITA doesn’t have a <br>
element for line break, hard line breaks are converted into <?linebreak?>
processing instructions.
The LwDITA plug-in contains extensions for HTML5 and PDF outputs to generate line breaks.
Links
The format of local link targets is detected based on file name extension. The following extensions are treated as DITA files:
extension | format |
---|---|
|
|
|
|
|
|
|
|
All other link targets detect the format
from the file name extension and are treated as non-DITA files. Absolute link targets are treated as external scope links:
Images
Images used in inline content are processed with inline placement. If a block-level image contains a title, it is treated as an image wrapped in a figure element:
Key references
Keys can be referenced using standard Markdown syntax for shortcut reference links:
Inline
The following inline elements are supported:
Lists
Standard Markdown syntax is used for both ordered (numbered) and unordered (bulleted) lists.
Unordered list items can be marked up using either asterisks “ *
” or hyphens “ -
” as list markers:
Ordered lists use either numbers or number signs “ #
”, followed by a period:
Definition lists use the PHP Markdown Extra format with a single-line term followed by a colon and the definition:
Each definition list entry must have only one term and contain only inline content.
Metadata
A YAML metadata block as defined in the pandoc_metadata_block extension can be used to specify metadata elements for the DITA prolog.
The supported elements are:
author
source
publisher
permissions
audience
category
keyword
resourceid
Any unrecognized keys are output using the <data>
element.