Markdown Editor & HTML Converter · Tutorial
How to write a README.md file with a live preview
8 min readbeginnerUpdated
A README is the first thing people see in a code repository. This tutorial uses the Markdown Editor to write one with a title, a short description, installation and usage commands, a feature list and a contributing section, checking every part in the live preview before saving it as README.md.
What you need
- The Markdown Editor
- A few facts about your project, or the sample README from the Try it button
Steps
Start with a title and one sentence
Type
#followed by the project name on the first line, then a blank line and one sentence saying what the project does. In the sample that is# bento-toolsand "Small command-line helpers for packing balanced lunch boxes." The preview shows the large heading straight away.Add sections with level-two headings
Use
##for each section: Installation, Usage, Features and Contributing. These become the entries in Outline, which you can open below the editor to jump between sections.Put commands in code blocks
Commands go in fenced code blocks so they keep their spacing and are easy to copy. Press the { } button, or type three backticks with the language name. Code hosting sites colour the code using that name.
```bash pip install bento-tools ```List the features
Select the feature lines and press the • button to turn them into a bulleted list. Keep each item short and start it with a verb, such as "Plans a week of boxes" or "Prints a shopping list".
Check the preview and statistics
Switch View to Preview only and read the README as a visitor would. The line below the editor shows the word count and reading time; a good README can be skimmed in a minute or two.
Save as README.md
Press Download .md. The file is named after the first heading, so rename it to
README.mdand put it in the root of your repository. Your draft also stays saved in this browser.
Try it yourself
Opens the Markdown Editor & HTML Converter with this tutorial's sample loaded.
Common mistakes
- Forgetting the blank line before a list or code block
- Some Markdown renderers need an empty line between a paragraph and the list or code block after it. If the preview runs them together, add the blank line.
- Skipping heading levels
- Go from
#to##to###in order. Jumping straight to###makes the outline confusing and hurts accessibility. - Long lines of commands in plain text
- Without a code block, underscores and asterisks in commands can turn into italics. Always put commands and file names in backticks.
Next steps
Go back to the Markdown Editor & HTML Converter, or keep going with one of these:
FAQ
Will the README look the same on code hosting sites?
Very close. The editor uses GitHub Flavored Markdown, which those sites use too, though their colours and fonts differ.
Can I add badges and images?
Yes. Use  for images. They load in the preview from the address you give.