|
| 1 | +# Use Markdown |
| 2 | + |
| 3 | +Openblocks supports you using the lightweight markup language Markdown to format texts in your app, such as changing the font size, inserting code, and adding a list. You can also embed HTML-formatted text in Markdown for more styling options. |
| 4 | + |
| 5 | +Use Markdown in **Text** and **Table** components. |
| 6 | + |
| 7 | +* **Text**: Use Markdown for the input text. |
| 8 | + |
| 9 | + <figure><img src="../.gitbook/assets/md-in-text-input.png" alt=""><figcaption></figcaption></figure> |
| 10 | +* **Table**: Use Markdown for column type. |
| 11 | + |
| 12 | + <figure><img src="../.gitbook/assets/md-in-table.png" alt=""><figcaption></figcaption></figure> |
| 13 | + |
| 14 | +## Markdown basics |
| 15 | + |
| 16 | +All Markdown syntax is valid in Openblocks. |
| 17 | + |
| 18 | +* **Headings**: Use hashtag (#) before heading. More hashtags, lower heading level. |
| 19 | +* **Paragraphs**: Use a blank line to separate texts into paragraphs. |
| 20 | +* **Line breaks**: Add at least two whitespaces at the end of a line and press **Enter** to start a new line. |
| 21 | +* **Emphasis**: Use single asterisk (∗) before and after text to convert it to _italic_ text, double asterisks (∗∗) for **bold** text, and triple asterisks (∗∗∗) for _**italic bold**_ text. |
| 22 | +* **Blockquotes**: Use the closing angle bracket (>) to create a blockquote. |
| 23 | +* **Lists**: Use hyphen (-), asterisk (∗), or plus sign (+) followed by a whitespace to create an unordered list, and use numbers followed by a period (.) to create an ordered list. |
| 24 | +* **Code**: Use backticks (\`) before and after code to denote `` `code` `` in plain text, and three backticks (\`\`\`) to present ` ```code block``` `. |
| 25 | +* **Horizontal rules**: Use at least three asterisks (∗∗∗), hyphens (---), or underscores (\_ \_ \_) at the beginning of a line to create a horizontal rule. |
| 26 | +* **Links**: Use square brackets (\[]) for the display text and parenthesis (()) for the link address. Note that no space should be inbetween. For example, `[Openblocks](https://docs.openblocks.dev)`. |
| 27 | +* **Images**: Use an exclamation mark (!) to start an image shiinsertion, and then use square bracket (\[]) for the alternative text and parenthesis (()) for the link address or source path. The caption can follow the parentheses or start at a new line. |
| 28 | +* **Escaping characters**: Use backslash (\\) to display the special symbols that Markdown uses. For instance, to print ` `` ` in plain text, you should use `` \`\` `` in Markdown.  |
| 29 | + |
| 30 | +For more information, see [Markdown guide](https://www.markdownguide.org/basic-syntax/). |
| 31 | + |
| 32 | +## GFM extension |
| 33 | + |
| 34 | +You can also use GitHub Flavored Markdown (GFM) extensions for additional syntax. |
| 35 | + |
| 36 | +* **Footnotes**: Use caret (^) and number in square brackets (\[]) to insert footnotes. For more information, see [Footnotes](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#footnotes). |
| 37 | +* **Strikethrough lines**: Use double tilde (\~\~) before and after text to add strikethrough lines. For more information, see [Styling text](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#styling-text). |
| 38 | +* **Tables**: Use hyphens (-) separated by the vertical bar (|) to create the header row of a table, and continue using the vertical bar to separate content in cells. For more information, see [Tables (extension)](https://github.github.com/gfm/#tables-extension-). |
| 39 | +* **Task lists**: Use a whitespace in square brackets (\[ ]) within the list format to create task lists. To mark a task completed, replace the whitespace with the letter _x_. For more information, see [Task lists](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#task-lists). |
| 40 | + |
| 41 | +## HTML support |
| 42 | + |
| 43 | +In Openblocks, you can use most HTML tags and properties. For more information, see [Embed HTML in Markdown](https://www.markdownguide.org/basic-syntax/#html). |
| 44 | + |
| 45 | +{% hint style="warning" %} |
| 46 | +For security reasons, a few HTML tags including **iframe** and **script** are not permitted in Openblocks. |
| 47 | +{% endhint %} |
| 48 | + |
| 49 | +### Appendix: Supported HTML tags |
| 50 | + |
| 51 | +```html |
| 52 | +<h1> |
| 53 | +<h2> |
| 54 | +<h3> |
| 55 | +<h4> |
| 56 | +<h5> |
| 57 | +<h6> |
| 58 | +<br> |
| 59 | +<b> |
| 60 | +<i> |
| 61 | +<strong> |
| 62 | +<em> |
| 63 | +<a> |
| 64 | +<pre> |
| 65 | +<code> |
| 66 | +<img> |
| 67 | +<tt> |
| 68 | +<div> |
| 69 | +<ins> |
| 70 | +<del> |
| 71 | +<sup> |
| 72 | +<sub> |
| 73 | +<p> |
| 74 | +<ol> |
| 75 | +<ul> |
| 76 | +<table> |
| 77 | +<thead> |
| 78 | +<tbody> |
| 79 | +<tfoot> |
| 80 | +<blockquote> |
| 81 | +<dl> |
| 82 | +<dt> |
| 83 | +<dd> |
| 84 | +<kbd> |
| 85 | +<q> |
| 86 | +<samp> |
| 87 | +<var> |
| 88 | +<hr> |
| 89 | +<ruby> |
| 90 | +<rt> |
| 91 | +<rp> |
| 92 | +<li> |
| 93 | +<tr> |
| 94 | +<td> |
| 95 | +<th> |
| 96 | +<s> |
| 97 | +<strike> |
| 98 | +<summary> |
| 99 | +<details> |
| 100 | +<caption> |
| 101 | +<figure> |
| 102 | +<figcaption> |
| 103 | +<abbr> |
| 104 | +<bdo> |
| 105 | +<cite> |
| 106 | +<dfn> |
| 107 | +<mark> |
| 108 | +<small> |
| 109 | +<span> |
| 110 | +<time> |
| 111 | +<wbr> |
| 112 | +<input> |
| 113 | +``` |
0 commit comments