8. DataTables Markdown
Markdown is a plain text formatting syntax, initially created by John Gruber and now widely used on the web. It is designed to provide an easy to use set of formatting rules which can be applied to a document, converting it from an easily readable and editable plain text format to HTML.
The DataTables project uses an extended form of Markdown in an number of areas:
- Forum posts
- Web-site page comments
- DataTables reference source
Syntax
DataTables Markdown follows the same rules as GitHub Flavoured Markdown with a couple of extensions (see below). The most common Markdown rules used by DataTables are documented below, but for full documentation of the syntax supported in Markdown, please refer to:
Extensions
If you know Markdown already, you will be interested in the extensions DataTables makes use of. These are primarily to add the ability to easily link to different DataTables reference documentation, or highlight different types of inline code:
| Markdown syntax | Action | Example Markdown | Example rendered |
|---|---|---|---|
`-api x` |
Link to the reference documentation for API method x | `-api row().data()` |
row().data() |
`-button x` |
Link to the reference documentation for button x | `-button pdf` |
pdf |
`-event x` |
Link to the reference documentation for event x | `-event draw` |
draw |
`-feature x` |
Link to the reference documentation for feature x | `-feature info` |
into |
`-init x` |
Link to the reference documentation for initialisation option x | `-init scrollY` |
scrollY |
`-path x` |
Highlight code as a file path | `-path /home/datatables` |
/home/datatables |
`-string x` |
Highlight code as a string literal | `-string full_numbers` |
full_numbers |
`-type x` |
Link to the reference documentation for data type x | `-type row-selector` |
row-selector |
`-tag x` |
Highlight code as an HTML tag | `-tag tbody` |
tbody |
The `-api x`, `-event x`, `-init x` and `-button x` code links can optionally be prefixed with an e to indicate that it is an