The Markdown editor in Oxygen XML Author Eclipse plugin uses rules that were integrated from the most common set of default Markdown syntax rules along with many of the GitHub Flavored Markdown rules.
This topic lists the Oxygen XML Author Eclipse plugin implementation of the most commonly used syntax rules.
The Markdown editor supports two styles of headers, Setext and Atx.
Setext Style
Setext-style headers are underlined using equal signs (for first-level headers) and dashes (for second-level headers). Any number of equal signs or dashes will result in the same output.
First-Level Header (H1)
========
Second-Level Header (H2)
------------Atx Style
Atx-style headers use 1-6 hash characters at the start of the line, corresponding to header levels 1-6. Optionally, you may close atx-style headers. This is purely cosmetic and the closing hashes do not need to match the number of hashes used to open the header. It is the number of opening hashes that determines the header level.
# H1 text #
## H2 text
### H3 text ######
#### H4 text
##### H5 text ###
###### H6 textYou can produce a horizontal rule tag (<hr>) by placing three or more
hyphens, asterisks, or underscores on a line by themselves (they also need to be preceded
and followed by a blank line). Optionally, they can be separated by spaces.
* * *
*****
---------------------------------------
_ _ _ _
<br>. When converting
to DITA, the text is kept in a single paragraph in this case and a blank line is required
to break a paragraph. This behavior differs slightly from the default Markdown
rules.This is a paragraph that contains
two lines of text. (In HTML, a break tag is created in between the two lines)
This is a new paragraph.Italic (Emphasis)
*italic*
_italic_Bold (Strong)
**bold**
__bold__Strikethrough
~~strikethrough~~Underline
++underline++The Markdown editor supports two types of links, inline and reference. In both cases, it begins with link text that is delimited by [square brackets].
Inline Links
To create an inline link, use a set of regular parentheses immediately after the closing square bracket for the link text. Inside the parentheses, put the URL where you want the link to point, and optionally a title surrounded in quotes. Also, if you reference a local resource on the same server, you can use relative paths.
Examples: Inline Link
Text with [example link text](http://www.example.com/path "Title") inline link and title.Text with [example link text](http://www.example.com/path) inline link without a title.Text with [example link text](/relative_path/) inline link with relative path.Reference Links
Text with [link text1][id 1] a reference-type link and [link text2][id_2] another one.[id 1]: http://example1.com/ "Optional Title"
[id_2]: <http://example2.com/> "Optional Title2"[id]: http://example.com/long/path/to/resource/here
"Optional Title Here"[My Link][][My Link]: http://example.com/URLs
<http://example.com/><a href="http://example.com/">http://example.com/</a>Email Addresses
<address@example.com><a href="mailto:addre
ss@example.co
m">address@exa
mple.com</a>The Markdown editor uses an image syntax that is intended to resemble
the syntax for two types of links (inline and reference). In both
cases, the syntax for images begins with an exclamation mark, followed by
Alt attribute text surrounded by square brackets, and then followed by a
set of parentheses that contain the URL or path to the image.
Inline Images
For inline images, use a set of regular parentheses immediately after the closing
square bracket for the Alt attribute text. Inside the parentheses,
put the URL or path of the image, and optionally a title surrounded in quotes.
Examples: Inline Images
Text with  inline image and a title.Text with  inline link without a title.Reference Images
Text with ![Alt text1][id] a reference-type image.[id]: url/to/image "Optional Title"The Markdown editor uses email-style greater than characters (>) for blockquotes. You only need to put the > before the first line of a hard-wrapped paragraph, but it looks better (and is clearer) if you put a > before every line.
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.Example: Nested Blockquotes
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.Example: Blockquotes with Other Markdown Elements
> ## This is a header.
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script")The Markdown editor supports quoting code or commands inline within a sentence or in distinct blocks.
Inline
You can quote or emphasize code within a sentence (inline) with single backticks (`). The text within the backticks will not be formatted.
This is a normal sentence with a `code` in the middle. Code Blocks
You can format code or text into its own distinct block by inserting a blank line before and after the content and using at least 4 spaces (or 1 tab), or by using opening and closing triple backticks (```) on separate lines.
This is a normal paragraph:
This is a code block
This is a normal paragraph:
```
This is a code block
```One level of indentation is removed from each line of a codeblock and it continues until it reaches a line that is not indented (or until the closing backticks).
tell application "something"
beep
end tell<pre><code>tell application "Foo"
beep
end tell
</code></pre>You can also add an optional language identifier to enable syntax highlighting in your code blocks. The Oxygen XML Author Eclipse plugin Markdown editor syntax highlight supports the following languages: Java, JavaScript, CSS, and Python. When publishing Markdown content as part of a DITA project, more language values are supported and produce syntax highlights in the published WebHelp or PDF outputs: How to Add Syntax Highlights for Codeblocks in the Output.
```css
input[type="submit"] {
color: white;
font-weight: bold;
```The Markdown editor supports writing inline XHTML. Since Markdown is just a writing format, it requires a conversion for publishing purposes. If you are using the HTML conversion, for any markup that is not covered by Markdown syntax, you can simply use XHTML syntax.
This is a regular paragraph.
<table>
<tr>
<td>Col 1</td>
<td>Col 2</td>
</tr>
</table>
This is another regular paragraph.The Markdown editor supports ordered and unordered lists. You can also insert blockquotes and code blocks inside list items. List markers typically start at the left margin, but may be indented by up to three spaces.
Unordered Lists
* List item 1
+ List item 2
- List item 3Ordered Lists
1. List item 1
8. List item 2
5. List item 3Nested Lists
1. Ordered list item 1
1. Nested ordered list item 1
2. Nested ordered list item 2
* 2nd level nested unordered list item 1
* 2nd level nested unordered list item 2
* 3rd level nested unordered list item 1
2. Ordered list item 2 Paragraphs Inside Lists
* List item 1
* List item 2<ul>
<li><p>List item 1</p></li>
<li><p>List item 2</p></li>
</ul>Multiple Paragraphs Inside Lists
1. This is a list item with two paragraphs. Lorem ipsum dolor
sit amet, consectetuer adipiscing elit. Aliquam hendrerit
mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.Blockquotes Inside Lists
* A list item with a blockquote:
> This is a blockquote
> inside a list item.Code Blocks Inside Lists
* A list item with a code block:
This is a code block inside a list item
```
This is a code block inside a list item using the backticks method
```You can create task lists by prefacing list items with a hyphen followed by a space followed by square brackets (- [ ]). To mark a task as complete, use - [x].
- [ ] Unfinished task 1
- [x] Finished task 2You can create definition lists by using a colon plus a space for each list item.
Term 1
: Definition A
: Definition BYou can create tables in the Markdown editor by using pipes (|) and hyphens (-).
Creating a Table
| First Header | Second Header |
| ------------- | ------------- |
| Column 1 Row 1 Cell | Column 2 Row 1 Cell |
| Column 1 Row 2 Cell | Column 2 Row 2 Cell |Formatting Rules in Table Cells
| First Header | Second Header |
| --- | --- |
| `inline code` | Content with **bold text** inside cell |Aligning Text in Tables
| Left-aligned | Center-aligned | Right-aligned |
| :--- | :---: | ---: |
| Content Cell | Content Cell | Content Cell |Joining Cells (Span a Cell Over Multiple Columns)
| First Header | Second Header | Third Header | Fourth Header |
| ------------ | ------------- | ------------ | ------------- |
| Content Cell | *Cell Span Over 3 Columns* |||You can add emoji in the Markdown editor by surrounding the EMOJICODE with colons (:EMOJICODE:).
:smile:
:laughing:The resulting emoticons will appear in the output, but they are not displayed in the Preview pane.
For a full list of available emoji codes, see Emoji Cheat Sheet.
\*literal asterisks\*\ backslash
` backtick
* asterisk
_ underscore
{} curly braces
[] square brackets
() parentheses
# hash mark
+ plus sign
- minus sign (hyphen)
. dot
! exclamation markThe Markdown editor includes support for automatically escaping special characters such as
angle brackets (< >) and ampersands
(&). If you want to use them as literal characters, you must
escape them as entities, as in the table below. The exception to this is in HTML output, if
the special characters for a valid tag (for example, <b>), they are
treated as literal characters and escaping is not necessary.
| Literal Character | Escaping Code |
|---|---|
| < | < |
| > | > |
| & | & |
The Markdown editor in Oxygen XML Author Eclipse plugin supports normal and inline footnotes. The following examples show the required syntax.
Here is a footnote reference,[^1]
[^1]: Here is the footnote.Here is a footnote reference,[^longnote]
[^longnote]: Here is the footnote with multiple blocks.
Subsequent paragraphs are indented with 4 spaces or 1 tab to show that they
belong to the previous footnote.Here is an inline note.^[Inlines notes are easier to write, since
you don't have to pick an identifier and move down to type the
note.]Mathematical equations in Latex format can be specified either inline or as blocks.
$f(x) = x^2$Such equations are automatically preserved as <foreign> elements
when converting the Markdown content to DITA XML and with the addition of editing and publishing plugins, they can be rendered
in the Markdown editor's DITA preview tab and when the Markdown
content is published as part of a DITA map.
For information about unique Markdown features for DITA projects, see Working with Markdown Documents in DITA. Also, for a list of Markdown rules and examples for DITA, see the Markdown DITA Syntax Reference.