Suqing LiuStudent / Researcher / Developerhttps://lsq0000.github.ioMarkdown Syntax Supporthttps://lsq0000.github.io/blog/markdownhttps://lsq0000.github.io/blog/markdownMarkdown is a lightweight markup language.Wed, 26 Jul 2023 08:00:00 GMT<h2>Basic Syntax</h2> <p>Markdown is a lightweight and easy-to-use syntax for styling your writing.</p> <h3>Headers</h3> <p>When the content of the article is extensive, you can use headers to segment:</p> <pre><code class="language-markdown"># Header 1 ## Header 2 ## Large Header ### Small Header </code></pre> <p>Header previews would disrupt the structure of the article, so they are not displayed here.</p> <h3>Bold and Italics</h3> <pre><code class="language-markdown">_Italic text_ and **Bold text**, together will be **_Bold Italic text_** </code></pre> <p>Preview:</p> <p><em>Italic text</em> and <strong>Bold text</strong>, together will be <strong><em>Bold Italic text</em></strong></p> <h3>Links</h3> <pre><code class="language-markdown">Text link [Link Name](http://link-url) </code></pre> <p>Preview:</p> <p>Text link <a href="http://link-url">Link Name</a></p> <h3>Inline Code</h3> <pre><code class="language-markdown">This is an `inline code` </code></pre> <p>Preview:</p> <p>This is an <code>inline code</code></p> <h3>Code Blocks</h3> <pre><code class="language-markdown">```js // calculate fibonacci function fibonacci(n) { if (n &#x3C;= 1) return 1 const result = fibonacci(n - 1) + fibonacci(n - 2) // [\!code --] return fibonacci(n - 1) + fibonacci(n - 2) // [\!code ++] } ``` </code></pre> <p>Preview:</p> <pre><code class="language-js">// calculate fibonacci function fibonacci(n) { if (n &#x3C;= 1) return 1 const result = fibonacci(n - 1) + fibonacci(n - 2) // [!code --] return fibonacci(n - 1) + fibonacci(n - 2) // [!code ++] } </code></pre> <p>Currently using shiki as the code highlighting plugin. For supported languages, refer to <a href="https://shiki.matsu.io/languages.html">Shiki: Languages</a>.</p> <h3>Inline Formula</h3> <pre><code class="language-markdown">This is an inline formula $e^{i\pi} + 1 = 0$ </code></pre> <p>Preview:</p> <p>This is an inline formula $e^{i\pi} + 1 = 0$</p> <h3>Formula Blocks</h3> <pre><code class="language-markdown">$$ \hat{f}(\xi) = \int_{-\infty}^{\infty} f(x) e^{-2\pi i x \xi} \, dx $$ </code></pre> <p>Preview:</p> <p>$$ \hat{f}(\xi) = \int_{-\infty}^{\infty} f(x) e^{-2\pi i x \xi} , dx $$</p> <p>Currently using KaTeX as the math formula plugin. For supported syntax, refer to <a href="https://katex.org/docs/supported.html">KaTeX Supported Functions</a>.</p> <h4>Images</h4> <pre><code class="language-markdown">![CWorld](https://cravatar.cn/avatar/1ffe42aa45a6b1444a786b1f32dfa8aa?s=200) </code></pre> <p>Preview:</p> <p><img src="https://cravatar.cn/avatar/1ffe42aa45a6b1444a786b1f32dfa8aa?s=200" alt="CWorld"></p> <h4>Strikethrough</h4> <pre><code class="language-markdown">~~Strikethrough~~ </code></pre> <p>Preview:</p> <p>~~Strikethrough~~</p> <h3>Lists</h3> <p>Regular unordered list</p> <pre><code class="language-markdown">- 1 - 2 - 3 </code></pre> <p>Preview:</p> <ul> <li>1</li> <li>2</li> <li>3</li> </ul> <p>Regular ordered list</p> <pre><code class="language-markdown">1. GPT-4 2. Claude Opus 3. LLaMa </code></pre> <p>Preview:</p> <ol> <li>GPT-4</li> <li>Claude Opus</li> <li>LLaMa</li> </ol> <p>You can continue to nest syntax within lists.</p> <h3>Blockquotes</h3> <pre><code class="language-markdown">> Gunshot, thunder, sword rise. A scene of flowers and blood. </code></pre> <p>Preview:</p> <blockquote> <p>Gunshot, thunder, sword rise. A scene of flowers and blood.</p> </blockquote> <p>You can continue to nest syntax within blockquotes.</p> <h3>Line Breaks</h3> <p>Markdown needs a blank line to separate paragraphs.</p> <pre><code class="language-markdown">If you don't leave a blank line it will be in one paragraph First paragraph Second paragraph </code></pre> <p>Preview:</p> <p>If you don't leave a blank line it will be in one paragraph</p> <p>First paragraph</p> <p>Second paragraph</p> <h3>Separators</h3> <p>If you have the habit of writing separators, you can start a new line and enter three dashes <code>---</code> or asterisks <code>***</code>. Leave a blank line before and after when there are paragraphs:</p> <pre><code class="language-markdown">--- </code></pre> <p>Preview:</p> <hr> <h2>Advanced Techniques</h2> <h3>Inline HTML Elements</h3> <p>Currently, only some inline HTML elements are supported, including <code>&#x3C;kdb> &#x3C;b> &#x3C;i> &#x3C;em> &#x3C;sup> &#x3C;sub> &#x3C;br></code>, such as</p> <h4>Key Display</h4> <pre><code class="language-markdown">Use &#x3C;kbd>Ctrl&#x3C;/kbd> + &#x3C;kbd>Alt&#x3C;/kbd> + &#x3C;kbd>Del&#x3C;/kbd> to reboot the computer </code></pre> <p>Preview:</p> <p>Use Ctrl + Alt + Del to reboot the computer</p> <h4>Bold Italics</h4> <pre><code class="language-markdown">&#x3C;b> Markdown also applies here, such as _bold_ &#x3C;/b> </code></pre> <p>Preview:</p> <p> Markdown also applies here, such as <em>bold</em> </p> <h3>Other HTML Writing</h3> <h4>Foldable Blocks</h4> <pre><code class="language-markdown">&#x3C;details>&#x3C;summary>Click to expand&#x3C;/summary>It is hidden&#x3C;/details> </code></pre> <p>Preview:</p> <h3>Tables</h3> <pre><code class="language-markdown">| Header1 | Header2 | | -------- | -------- | | Content1 | Content2 | </code></pre> <p>Preview:</p> <p>| Header1 | Header2 | | -------- | -------- | | Content1 | Content2 |</p> <h3>Footnotes</h3> <pre><code class="language-markdown">Use [^footnote] to add a footnote at the point of reference. Then, at the end of the document, add the content of the footnote (it will be rendered at the end of the article by default). [^footnote]: Here is the content of the footnote </code></pre> <p>Preview:</p> <p>Use [^footnote] to add a footnote at the point of reference.</p> <p>Then, at the end of the document, add the content of the footnote (it will be rendered at the end of the article by default).</p> <p>[^footnote]: Here is the content of the footnote</p> <h3>To-Do Lists</h3> <pre><code class="language-markdown">- [ ] Incomplete task - [x] Completed task </code></pre> <p>Preview:</p> <ul> <li>[ ] Incomplete task</li> <li>[x] Completed task</li> </ul> <h3>Symbol Escaping</h3> <p>If you need to use markdown symbols like _ # * in your description but don't want them to be escaped, you can add a backslash before these symbols, such as <code>\_</code> <code>\#</code> <code>\*</code> to avoid it.</p> <pre><code class="language-markdown">\_Don't want the text here to be italic\_ \*\*Don't want the text here to be bold\*\* </code></pre> <p>Preview:</p> <p>_Don't want the text here to be italic_</p> <p>**Don't want the text here to be bold**</p> <hr> <h2>Embedding Astro Components</h2> <p>See <a href="/docs/integrations/components">User Components</a> and <a href="/docs/integrations/advanced">Advanced Components</a> for details.</p>