Skip to content

Latest commit

 

History

History
246 lines (166 loc) · 6.53 KB

gitbook-markdown-syntax.md

File metadata and controls

246 lines (166 loc) · 6.53 KB
description
A page showing the Markdown for all the basic and fancy options there are. Also compares it to Github's Markdown. This block is the page description.

Gitbook Markdown syntax

Contrast this page to:

Heading 1

(shows up in the outline)

Heading 2

(also shows up in the outline)

Heading 3

(does not show up in the outline)

Headings can be used anywhere, including inside other blocks.

Inline text formatting options

Bold,
Italics,
Code,
Strikethrough,
Link,
internal link,
anchor link,
page link: style-guide.md,
page anchor link: #inline-text-formatting-options,
colored text,
colored background,
both colored,
LaTeX: $$f(x) = x * e^{2 pi i \xi x}$$

These can be used anywhere.

Lists

  • Unordered
  • List
  1. Ordered
  2. List
  • Task
  • List
  • List with
    1. sub-items
    2. can have
      • changing list styles
  • ...

Lists can be used anywhere, including inside other blocks. They can only include inline content and other (nested) lists.

Infoboxes, quotes and code blocks

Infoboxes:

{% hint style="info" %} Hint {% endhint %}

{% hint style="warning" %} Caution {% endhint %}

{% hint style="danger" %} Danger {% endhint %}

{% hint style="success" %} Success {% endhint %}

A quote block

// a code block
code blocks <b style="some_css: 23px;" class="and other things"> also supports syntax highlighting</b>

These blocks can be used inside of Tabs. The code block can also be used in Expandables, but cannot have other blocks inside it. The quote block and infobox can have headings, inline content and lists inside it.

Images and files

Inline image:

Image block:

supports captions

Attached file:

{% file src="../../../.gitbook/assets/transport toolbar.png" %} supports captions {% endfile %}

Embeds

{% embed url="https://www.youtube.com/watch?v=HpA138b-J9s" %} YouTube embed {% endembed %}

{% embed url="https://audacityteam.org" %} Arbitrary website without player {% endembed %}

{% embed url="https://gist.github.com/LWinterberg/fbdfe97044af6fafc01f06862817babe" %} gist embed {% endembed %}

{% embed url="https://soundcloud.com/rick-astley-official/never-gonna-give-you-up-4" %} soundcloud embed {% endembed %}

Embeds cannot be used inside of other blocks except the Tabs block, nor can other blocks be placed inside them.

Tables

checkbox columntext column, center-alignednumber columnhidden text column
truetext123hidden
falsetext456hidden
truetext789hidden
select-option columnfiles columnRatings column
3
2
1

{% hint style="danger" %} Select-option and files columns appear empty in Markdown. Avoid using them. {% endhint %}

Tables cannot be used inside other blocks except the Tabs block, nor can other blocks be placed inside them. Inline content works inside of text columns only.

Tabs

{% tabs %} {% tab title="First Tab" %} content of first tab {% endtab %}

{% tab title="Second Tab" %} content of second tab {% endtab %}

{% tab title="Third tab" %} content of third tab {% endtab %} {% endtabs %}

Tabs cannot be used inside other blocks. Tabs can have most other blocks inside them, except of other tabs, expandables, and API blocks.

Expandable (Details block)

Expandable title

Expandable content

Expandables cannot be inside other blocks. Expandables can have headings, lists, code blocks, and inline content inside them.

Drawings

also supports captions

A Gitbook-specific drawing thing, generating SVGs. Likely useless when using Markdown.

LaTeX

$$ f(x) = x * e^{2 pi i \xi x} $$

Cannot be placed inside of other blocks except the Tabs block. That said, an inline variant is available which can go pretty much anywhere.

Web API methods

{% swagger method="get" path="/example" baseUrl="https://example.com" summary="API title" %} {% swagger-description %} shows itself up in the outline. Example of all available parameters follows: {% endswagger-description %}

{% swagger-parameter in="path" name="id" type="String" %} Description {% endswagger-parameter %}

{% swagger-parameter in="query" name="id" type="String" required="true" %} Description {% endswagger-parameter %}

{% swagger-parameter in="header" name="id" type="String" %} Description {% endswagger-parameter %}

{% swagger-parameter in="cookie" name="id" type="String" %} Description {% endswagger-parameter %}

{% swagger-parameter in="body" name="id" type="String" %} Description {% endswagger-parameter %}

{% swagger-response status="200: OK" description="Description" %}

{
    // good Response
}

{% endswagger-response %}

{% swagger-response status="404: Not Found" description="Description" %}

{
    // not found Response
}

{% endswagger-response %}

{% swagger-response status="500: Internal Server Error" description="Description" %}

{
    // error Response
}

{% endswagger-response %} {% endswagger %}

Cannot be used inside other blocks. Can only contain plain text. Unfortunately very tailored towards web APIs only.