คู่มือไวยากรณ์ Markdown
ข้อมูลอ้างอิงไวยากรณ์ Markdown ฉบับเต็ม สำหรับเขียนเอกสารที่จัดรูปแบบสวยงาม
Markdown เป็นภาษามาร์กอัปแบบเบา ใช้สัญลักษณ์ง่ายๆ ไม่กี่ตัวก็จัดข้อความเป็นหัวข้อ รายการ และตารางได้ กฎเข้าใจง่ายและเรียนรู้ได้เร็ว จึงเหมาะกับการจดโน้ต ทำการบ้าน และเขียนเอกสารทางเทคนิค คู่มือนี้รวบรวมไวยากรณ์ Markdown ทั้งหมดที่ MarkPDF รองรับ
หัวข้อ
ใช้เครื่องหมาย # เพื่อสร้างหัวข้อ จำนวน # กำหนดระดับตั้งแต่ H1 ถึง H6
# Heading 1 ## Heading 2 ### Heading 3 #### Heading 4 ##### Heading 5 ###### Heading 6
<h1>Heading 1</h1> <h2>Heading 2</h2> <h3>Heading 3</h3> <h4>Heading 4</h4> <h5>Heading 5</h5> <h6>Heading 6</h6>
ย่อหน้าและการขึ้นบรรทัดใหม่
คั่นย่อหน้าด้วยบรรทัดว่าง หากต้องการขึ้นบรรทัดใหม่ในย่อหน้าเดิม ให้เว้นวรรคสองครั้งท้ายบรรทัดแล้วกด Enter
This is paragraph one. This is paragraph two. Line one with two spaces at end Line two (soft break)
<p>This is paragraph one.</p> <p>This is paragraph two.</p> <p>Line one with two spaces at end<br> Line two (soft break)</p>
การเน้นข้อความ
ล้อมข้อความด้วยเครื่องหมายดอกจันหรือขีดล่างเพื่อทำตัวหนาหรือตัวเอียง
*Italic* or _italic_ **Bold** or __bold__ ***Bold and italic*** ~~Strikethrough~~
<em>Italic</em> <strong>Bold</strong> <strong><em>Bold and italic</em></strong> <del>Strikethrough</del>
รายการ
รายการแบบมีลำดับ แบบไม่มีลำดับ และรายการซ้อน
Unordered list: - Item 1 - Item 2 - Nested item - Another nested Ordered list: 1. First 2. Second 3. Third
<ul> <li>Item 1</li> <li>Item 2 <ul> <li>Nested item</li> <li>Another nested</li> </ul> </li> </ul> <ol> <li>First</li> <li>Second</li> <li>Third</li> </ol>
ลิงก์และรูปภาพ
ใช้วงเล็บเหลี่ยมคู่กับวงเล็บกลมเพื่อสร้างลิงก์และแทรกรูปภาพ
[Link text](https://example.com) [Link with title](https://example.com "Title") 
<a href="https://example.com">Link text</a> <a href="https://example.com" title="Title">Link with title</a> <img src="https://example.com/image.png" alt="Image alt">
โค้ด
ใช้แบ็กทิกหนึ่งตัวสำหรับโค้ดในบรรทัด และสามตัวสำหรับบล็อกโค้ด
Inline `code` in text.
```javascript
function hello() {
console.log("Hello!");
}
```<code>code</code>
<pre><code class="language-javascript">
function hello() {
console.log("Hello!");
}
</code></pre>ตาราง
สร้างตารางด้วยเส้นตั้งและขีด กำหนดการจัดแนวคอลัมน์ได้
| Header 1 | Header 2 | Header 3 | |----------|:--------:|---------:| | Left | Center | Right | | Cell | Cell | Cell |
<table> <thead><tr> <th>Header 1</th> <th align="center">Header 2</th> <th align="right">Header 3</th> </tr></thead> <tbody> <tr><td>Left</td><td>Center</td><td>Right</td></tr> <tr><td>Cell</td><td>Cell</td><td>Cell</td></tr> </tbody> </table>
ข้อความอ้างอิง
ใช้เครื่องหมาย > เพื่อสร้างข้อความอ้างอิง ซ้อนกันได้
> This is a blockquote. > It can span multiple lines. > > > Nested blockquote
<blockquote> <p>This is a blockquote. It can span multiple lines.</p> <blockquote><p>Nested blockquote</p></blockquote> </blockquote>
เส้นคั่น
ขีด ดอกจัน หรือขีดล่างตั้งแต่สามตัวขึ้นไปจะกลายเป็นเส้นคั่น
--- *** ___
<hr>
อักขระหลีก
ใส่แบ็กสแลชหน้าสัญลักษณ์พิเศษเพื่อให้แสดงเป็นข้อความธรรมดา
\*Not italic\* \# Not a heading \[Not a link\]
*Not italic* # Not a heading [Not a link]