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 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]Create or open your profile README
Your profile README appears at the top of your GitHub profile.
New profile README:
- Create a repository with the same name as your GitHub username, and initialize it with a
README.mdfile. See Managing your profile README. - Edit
README.mdand delete the starter template text (the block that begins### Hi there).
Existing profile README:
- In the upper-right corner of any page, click your profile picture, then click Your profile.
- 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.
- Paste this markup into
README.md:
<img alt="YOUR-ALT-TEXT">- Replace the placeholders with image URLs (or use GitHub's example URLs below).
- Set
YOUR-ALT-TEXTto a short description for screen readers. - Click the Preview tab to confirm the image renders.
Example:
<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
- Return to the Edit file tab.
- Two lines below the picture markup, add a heading and short intro:
## About meHi, I'm Mona. You might recognize me as GitHub's mascot.- Two lines below that, insert a ranking table. Right-align a numeric column with
--:under the header:
| Rank | THING-TO-RANK ||-----:|---------------|| 1| || 2| || 3| |- Replace
THING-TO-RANK(for example Languages or Hobbies) and fill the rows. - Click Preview.
Filled example:
## 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>:
<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:
<details>Preview again after wrapping.
Add a horizontal rule and quote
- Below the details block, type three or more dashes for a rule:
---- Add a blockquote:
> QUOTEExample:
---> If we pull together and commit ourselves, then we can push through anything.- Mona the Octocat- Click Preview.
Add a hidden HTML comment
Two lines below ## About me, insert a comment that stays hidden in the rendered README:
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
mainto 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
| Block | What you type | How you check |
|---|---|---|
| Responsive image | `` + prefers-color-scheme sources | Preview in light and dark theme |
| About table | GFM pipes + --: right-align | Preview 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 |