How to add custom markdown?

Code line highlighting

Highlighting lines inside a code block.

image

const http = require('http')
const bodyParser = require('body-parser')

http.createServer((req, res) => {
  bodyParser.parse(req, (error, body) => {
    res.end(body)
  })
}).listen(3000)

Code Blocks

Group code blocks inside tabs.

2018-08-04_22-44-22

[codegroup]

const http = require('http')

http.createServer((req, res) => {
}).listen(3000)
$ node server.js

[/codegroup]


Alerts

Alerts help you in adding visually distinguished notes to catch user attention.

image

[tip]
Dimer only needs markdown files to generate a documentation website. Say goodbye to complex build tools :wave:
[/tip]


Collapse

To keep your documentation structured, we have added support for collapsible content

2018-08-04_22-46-13

[collapse title=“Contact Us”]
You can contact us during weekdays (9am to 5pm) on our toll-free number.
[/collapse]


Variables

---
name: Yashu Mittal
---

Mr. [%name%]

Mr. Yashu Mittal

Any comments for custom markdown?

This is plugin territory. You can write custom “tags” to do such things. In fact if you search around there are a few plugins that do some of the things above.

For example I have a simple plugin on my site that creates notices or alerts like the example you have above.

To use it in my Markdown files I add something like this:

{% notice %}
Call out some text. **Markdown** is acceptable.
{% endnotice %}

Which generates the following HTML:

<div class="notice">
  <p>Call out some text. <strong>Markdown</strong> is acceptable.</p>
</div>