Skip to content

GitHubMarkdown

smarkwal edited this page Mar 9, 2025 · 5 revisions

GitHub Markdown cheatsheet

This is a cheatsheet for Markdown syntax which works in GitHub Wiki and IntelliJ Markdown preview.

URLs to files in repository

URL to GitHub Pages (files in /docs)

https://smarkwal.github.io/jarhc/...

Example: https://smarkwal.github.io/jarhc/jarhc-logo.png

URL to a file anywhere in the repository

https://github.com/smarkwal/jarhc/blob/master/...?raw=true

Example: https://smarkwal.github.io/jarhc/jarhc-logo.png?raw=true

Text

**Bold**
*Italic*
<u>Underline</u>
~~Strikethrough~~
<sup>Superscript</sup>
<sub>Subscript</sub>

Bold
Italic
Underline
Strikethrough
Superscript
Subscript

Image

![JarHC Logo](https://smarkwal.github.io/jarhc/jarhc-logo.png)

JarHC Logo

Resized image:

<img src="https://smarkwal.github.io/jarhc/jarhc-logo.png" alt="JarHC Logo" width="150"/>
JarHC Logo

Quote

> This is a quote.

This is a quote.

Can also be used to create "alerts":

> **Important**<br/>
> This is a note.

Important
This is a note.


Link

[Google](https://www.google.com)

Google

Link to Wiki page

Important: It does not matter whether Wiki page is saved in a subdirectory.

[Home Page](Home)

Home Page

Link to section in same page

[Collapsed section](#collapsed-section)

Collapsed section


Line breaks

  • 2 spaces at end of line
  • Backslash \ at end of line
  • <br/> tag at end of line
Line 1  
Line 2

Line 1\
Line 2

Line 1<br/>
Line 2

All three options also work in lists and quotes. <br/> also works in tables.


Table

| Left                      |          Center           |                     Right |
|:--------------------------|:-------------------------:|--------------------------:|
| `code`                    | 230 KB                    | 1                         |
| **bold**                  | 12 B                      | 2                         |
| This is a vert long text. | This is a vert long text. | This is a vert long text. |
Left Center Right
code 230 KB 1
bold 12 B 2
This is a vert long text. This is a vert long text. This is a vert long text.

Collapsed section

<details>
<summary>Text about collapsed section</summary>

Add any kind of content here.

</details>
Text about collapsed section

Add any kind of content here.


Diagram

```mermaid
graph TD
    A --> B
    A --> C
    B --> D
    C --> D
```
graph TD
    A --> B
    A --> C
    B --> D
    C --> D
Loading

Mermaid Diagram Syntax

Clone this wiki locally