This post is to explain and demonstrate the Markdown syntax supported by xLog.
If you have any questions or suggestions, feel free to submit an issue or comment.
Follows GitHub Flavored Markdown (GFM)
Specification details: https://github.github.com/gfm
Examples:
-
## Heading level 2
Heading level 2
-
**Bold**
Bold
-
> Quote
Quote
-
List
-
Normal list
- list 1 - list 2
- list 1
- list 2
-
Ordered list
1. - ordered list 1 1. - ordered list 2
- ordered list 1
- ordered list 2
-
Task list
- [ ] task list 1 - [x] task list 2
- task list 1
- task list 2
-
-
Code
`code`
code
```js console.log("xLog") console.log("is the best!") ```
console.log("xLog") console.log("is the best!")
-
Thematic break
---
-
Link
[link title](url)
-
Image

-
*Italic*
Italic
-
Autolink
-
~~Strikethrough~~
Strikethrough -
Table
foo bar baz bim
Allowed HTML Tags and Attributes
See: https://github.com/Crossbell-Box/xLog/blob/main/src/markdown/sanitize-schema.ts
For security reasons, only whitelisted HTML tags and attributes are allowed, but this is not set in stone, so if you need other tags or attributes, feel free to submit a pr or issue.
Examples:
<audio src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4" controls></audio>
Supports Generic Directives Proposal
Specification details: https://talk.commonmark.org/t/generic-directives-plugins-syntax/444
Examples:
-
line1 :br line2 :i[HTML]{class="test"}
=>line1 <br> line2 <i class="test">HTML</i>
line1
line2 HTML -
::video[title]{src=https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4 controls=true}
=><video src="https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4" controls="">title</video>
-
:::div{style="text-align: center"} Centered Content :::
=>
<div style="text-align: center"><p>Centered Content</p></div>
Centered Content
Supports Mathematical Expressions
This sentence uses $
delimiters to show math inline: $\sqrt{3x-1}+(1+x)^2$
3x−1+(1+x)2\sqrt{3x-1}+(1+x)^2
To add a math expression as a block, start a new line and delimit the expression with two dollar symbols $$.
$$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)$$
(∑k=1nakbk)2≤(∑k=1nak2)(∑k=1nbk2)\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)
Built-in components
YouTube
::youtube{#pLBX9vdrtn4}
Mention
:mention{#xlog}