מדריך תחביר Markdown

תחביר חיוני לעיצוב המסמכים שלך

סקירה

Markdown היא שפת סימון קלה שאפשר להשתמש בה כדי להוסיף אלמנטי עיצוב למסמכי טקסט גולמי. נוצר על ידי John Gruber ב-2004, Markdown הוא כעת אחת משפות הסימון הפופולריות בעולם.

שימוש ב-Markdown שונה משימוש בעורך WYSIWYG. ביישום כמו Microsoft Word לוחצים על כפתורים לעצב מילים ומשפטים, והשינויים נראים מיד. Markdown לא ככה. כשאתה יוצר קובץ בפורמט Markdown, אתה מוסיף תחביר Markdown לטקסט כדי לציין אילו מילים ומשפטים צריכים להיראות אחרת.

כותרות

כדי ליצור כותרת, הוסף סימני מספר (#) לפני מילה או משפט. מספר סימני המספר צריך להתאים לרמת הכותרת. למשל, לרמת כותרת שלוש השתמש בשלושה סימני מספר (### הכותרת שלי).

Markdown
HTML
פלט מוצג
# Heading level 1
<h1>Heading level 1</h1>

Heading level 1

## Heading level 2
<h2>Heading level 2</h2>

Heading level 2

### Heading level 3
<h3>Heading level 3</h3>

Heading level 3

#### Heading level 4
<h4>Heading level 4</h4>

Heading level 4

##### Heading level 5
<h5>Heading level 5</h5>
Heading level 5
###### Heading level 6
<h6>Heading level 6</h6>
Heading level 6

פסקאות

כדי ליצור פסקאות, השתמש בשורה ריקה להפרדת שורת טקסט אחת או יותר.

Markdown
HTML
פלט מוצג
I really like using Markdown.

It lets me write easily.
<p>I really like using Markdown.</p>
<p>It lets me write easily.</p>

I really like using Markdown.

It lets me write easily.

שבירת שורות

כדי ליצור שבירת שורה או שורה חדשה, סיים שורה עם שני רווחים או יותר ואז לחץ Enter.

Markdown
HTML
פלט מוצג
This is the first line.
And this is the second line.
<p>This is the first line.<br>
And this is the second line.</p>

This is the first line.
And this is the second line.

הדגשה

אפשר להוסיף הדגשה על ידי הפיכת טקסט למודגש או נטוי.

מודגש

לטקסט מודגש, הוסף שני כוכביות (**) או קו תחתון (__) לפני ואחרי מילה או משפט.

Markdown
HTML
פלט מוצג
I just love **bold text**.
I just love <strong>bold text</strong>.

I just love bold text.

I just love __bold text__.
I just love <strong>bold text</strong>.

I just love bold text.

נטוי

לטקסט נטוי, הוסף כוכבית אחת (*) או קו תחתון (_) לפני ואחרי מילה או משפט.

Markdown
HTML
פלט מוצג
The *cat* meows.
The <em>cat</em> meows.

The cat meows.

The _cat_ meows.
The <em>cat</em> meows.

The cat meows.

מודגש ונטוי

להדגשת טקסט במודגש ונטוי יחד, הוסף שלוש כוכביות (***) או קו תחתון (___) לפני ואחרי מילה או משפט.

Markdown
HTML
פלט מוצג
This text is ***really important***.
This text is <strong><em>really important</em></strong>.

This text is really important.

This text is ___really important___.
This text is <strong><em>really important</em></strong>.

This text is really important.

בלוקי ציטוט

כדי ליצור בלוק ציטוט, הוסף > לפני פסקה.

Markdown
HTML
פלט מוצג
> Dorothy followed her through many of the beautiful rooms in her castle.
<blockquote><p>Dorothy followed her through many of the beautiful rooms in her castle.</p></blockquote>

Dorothy followed her through many of the beautiful rooms in her castle.

בלוקי ציטוט מקוננים

בלוקי ציטוט אפשר לקנן. הוסף >> לפני הפסקה שברצונך לקנן.

Markdown
פלט מוצג
> Dorothy followed her through many of the beautiful rooms in her castle.
>
>> The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.

Dorothy followed her through many of the beautiful rooms in her castle.

The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.

רשימות

אפשר לארגן פריטים לרשימות ממוספרות ולא ממוספרות.

רשימות ממוספרות

לרשימה ממוספרת, הוסף שורות עם מספרים ואחריהם נקודה. המספרים לא חייבים להיות בסדר מספרי, אבל הרשימה צריכה להתחיל באחד.

Markdown
HTML
פלט מוצג
1. First item
2. Second item
3. Third item
4. Fourth item
<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
  <li>Fourth item</li>
</ol>
  1. First item
  2. Second item
  3. Third item
  4. Fourth item

רשימות לא ממוספרות

לרשימה לא ממוספרת, הוסף מקפים (-), כוכביות (*) או סימני פלוס (+) לפני שורות.

Markdown
HTML
פלט מוצג
- First item
- Second item
- Third item
- Fourth item
<ul>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
  <li>Fourth item</li>
</ul>
  • First item
  • Second item
  • Third item
  • Fourth item

קוד

כדי לסמן מילה או משפט כקוד, סגור ב-backticks (`).

Markdown
HTML
פלט מוצג
At the command prompt, type `nano`.
At the command prompt, type <code>nano</code>.

At the command prompt, type nano.

בלוקי קוד

לבלוק קוד, הזח כל שורה בבלוק בלפחות ארבע רווחים או טאב אחד, או השתמש בשלושה backticks (```) לפני ואחרי בלוק הקוד.

Markdown
פלט מוצג
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

קווים אופקיים

לקו אופקי, השתמש בשלוש כוכביות (***), מקפים (---) או קו תחתון (___) בשורה לבד.

Markdown
HTML
פלט מוצג
***
<hr>

---
<hr>

___
<hr>

תמונות

להוספת תמונה, הוסף סימן קריאה (!), אחריו טקסט חלופי בסוגריים מרובעים והנתיב או ה-URL לתמונה בסוגריים. אפשר אופציונלית להוסיף כותרת במרכאות אחרי הנתיב או ה-URL.

Markdown
HTML
פלט מוצג
![The San Juan Mountains](https://mdg.imgix.net/assets/images/san-juan-mountains.jpg "San Juan Mountains")
<img src="https://mdg.imgix.net/assets/images/san-juan-mountains.jpg" alt="The San Juan Mountains" title="San Juan Mountains">
The San Juan Mountains

בריחת תווים

כדי להציג תו מילולי שמשמש אחרת לעיצוב טקסט במסמך Markdown, הוסף backslash (\) לפני התו.

Markdown
פלט מוצג
\* Without the backslash, this would be a bullet in an unordered list.

* Without the backslash, this would be a bullet in an unordered list.

תווים שאפשר לברוח

אפשר להשתמש ב-backslash לברוח מהתווים הבאים:

\backslash
`backtick
*asterisk
_underscore
{ }curly braces
[ ]brackets
( )parentheses
#pound sign
+plus sign
-minus sign (hyphen)
.dot
!exclamation mark
|pipe

טבלאות

לטבלה, השתמש בשלושה מקפים (---) או יותר ליצירת כותרת כל עמודה, וצינורות (|) להפרדת עמודות. אפשר אופציונלית להוסיף צינורות בשני קצות הטבלה.

Markdown
פלט מוצג
| Syntax    | Description |
| --------- | ----------- |
| Header    | Title       |
| Paragraph | Text        |
SyntaxDescription
HeaderTitle
ParagraphText

יישור

אפשר ליישר טקסט בעמודות לשמאל, ימין או מרכז על ידי הוספת נקודתיים (:) לשמאל, ימין או משני צדי המקפים בשורת הכותרת.

Markdown
פלט מוצג
| Align Left | Align Center | Align Right |
| :--- | :---: | ---: |
| This | This | This |
| column | column | column |
| will | will | will |
| align | align | align |
| left | center | right |
יישר לשמאלמרכזיישר לימין
ThisThisThis
columncolumncolumn
willwillwill
alignalignalign
leftcenterright