Back to Resources

Quickstart for writing Markdown on GitHub

Post a GitHub Markdown scratch issue with headings, images, quotes, and hidden comments via gh CLI, then verify the stored body with gh issue view.

What this covers

GitHub's Quickstart for writing on GitHub teaches advanced formatting by creating or editing a profile README. You write Markdown (plus a few supported HTML tags) in README.md, Preview in the editor, and commit. If you are new to Markdown, start with Basic writing and formatting syntax or the Communicate using Markdown GitHub Skills course.

If you already have a profile README, add features to it, or practice in a gist named something like about-me.md (Creating gists).

Flowchart
5 linescompact
flowchart LR
    Scaffold[Scaffold Profile README] --> Media[Add dark and light mode picture tags]
    Media --> Tables[Format data tables with alignment]
    Tables --> Tasks[Insert tasklists for tracking]
    Tasks --> Preview[Validate rendered output in Preview tab]
Rendered from Mermaid source with the native ZeroLabs diagram container.

Create or open your profile README

Your profile README appears at the top of your GitHub profile.

New profile README:

  1. Create a repository with the same name as your GitHub username, and initialize it with a README.md file. See Managing your profile README.
  2. Edit README.md and delete the starter template text (the block that begins ### Hi there).

Existing profile README:

  1. In the upper-right corner of any page, click your profile picture, then click Your profile.
  2. Click the pencil next to your profile README to edit.

Add a responsive image

Include a banner that swaps for light vs dark mode with a `` element and prefers-color-scheme.

  1. Paste this markup into README.md:
html
      <img alt="YOUR-ALT-TEXT">
  1. Replace the placeholders with image URLs (or use GitHub's example URLs below).
  2. Set YOUR-ALT-TEXT to a short description for screen readers.
  3. Click the Preview tab to confirm the image renders.

Example:

html
      <img alt="Shows an illustrated sun in light mode and a moon with stars in dark mode." src="https://user-images.githubusercontent.com/25423296/163456779-a8556205-d0a5-45e2-ac17-42d089e3c3f8.png">

Theme details: Managing your theme settings. Image Markdown: Basic writing and formatting syntax.

Add an About me table

  1. Return to the Edit file tab.
  2. Two lines below the picture markup, add a heading and short intro:
markdown
## About meHi, I'm Mona. You might recognize me as GitHub's mascot.
  1. Two lines below that, insert a ranking table. Right-align a numeric column with --: under the header:
markdown
| Rank | THING-TO-RANK ||-----:|---------------||     1|               ||     2|               ||     3|               |
  1. Replace THING-TO-RANK (for example Languages or Hobbies) and fill the rows.
  2. Click Preview.

Filled example:

markdown
## About meHi, I'm Mona. You might recognize me as GitHub's mascot.| Rank | Languages ||-----:|-----------||     1| JavaScript||     2| Python    ||     3| SQL       |

More on tables: Organizing information with tables.

Wrap the table in a collapsed section

Keep the README tidy with <details> / <summary>:

html
<details><summary>My top THINGS-TO-RANK</summary>YOUR TABLE</details>

Replace THINGS-TO-RANK with the same label you used in the table. Optionally start expanded:

html
<details>

Preview again after wrapping.

Add a horizontal rule and quote

  1. Below the details block, type three or more dashes for a rule:
markdown
---
  1. Add a blockquote:
markdown
> QUOTE

Example:

markdown
---> If we pull together and commit ourselves, then we can push through anything.- Mona the Octocat
  1. Click Preview.

Add a hidden HTML comment

Two lines below ## About me, insert a comment that stays hidden in the rendered README:

markdown

Preview to confirm it does not appear in the output.

Save your work

When you are happy with the Preview, click Commit changes.

  • Commit to main to publish on your profile immediately.
  • Or choose Create a new branch for this commit and start a pull request if you want to stage changes first.

What you will practice

BlockWhat you typeHow you check
Responsive image`` + prefers-color-scheme sourcesPreview in light and dark theme
About tableGFM pipes + --: right-alignPreview table layout
Collapsed section<details> / <summary>Preview closed, then expand
Quote + rule--- and >Preview divider and gray quote
Hidden comment``Preview hides it; Code view still shows it

Next steps

Share