How can I test what my readme.md file will look like before committing to github?
Solution 1
Many ways: If you're on a Mac, use Mou.
If you want to test in a browser, you could try StackEdit, as pointed out by @Aaron or Dillinger since Notepag seems to be down now. Personally I use Dillinger since it just works and saves all my documents in my browser's local database.
Solution 2
Atom works nicely out of the box - just open the Markdown file and hit Ctrl+Shift+M to toggle the Markdown preview panel next to it. It handles HTML and images also.
Solution 3
Visual Studio Code has the option to edit and preview md file changes. Since VS Code is platform independent, this would work for Windows, Mac and Linux.
To switch between views, press Ctrl+Shift+V in the editor. You can view the preview side-by-side (Ctrl+K V) with the file you are editing and see changes reflected in real-time as you edit.
Also...
Q: Does VS Code support GitHub Flavored Markdown?
A: No, VS Code targets the CommonMark Markdown specification using the markdown-it library. GitHub is moving toward the CommonMark specification.
Solution 4
This is a pretty old question, however since I stumbled upon it while searching the internet maybe my answer is useful to others. I just found a very useful CLI tool for rendering GitHub flavored markdown: grip. It uses GitHub's API, thus renders quite well.
Frankly, the developer of grip, has a more elaborate answer on these very similar questions:
- Is there a command line utility for rendering github flavored markdown?
- What's the best way to edit GitHub's Readme.md?
Solution 5
This one has proven reliable for quite some time: http://tmpvar.com/markdown.html
Related videos on Youtube
Usman Ismail
Updated on March 29, 2022Comments
-
Usman Ismail about 2 years
I am writing a readme for my github project in the .md format. Is there a way can I test what my readme.md file will look like before committing to github?
-
Donnie D'Amato about 5 yearsI'm answering this as a comment because the thread is closed and none of the solutions were rendering pipe tables the same way that github was. The web solution that seems closest is here: pandao.github.io/editor.md/en.html
-
VonC almost 4 yearsWith GitLab 13.0 (May 2020), the static site editor for GitLab has a WYSIWYG editor. See my answer below.
-
VonC over 2 yearsSince Nov. 2021, you can also use the new preview feature of a GitHub Gist to see what your Markdown will look like before adding, committing and pushing a copy to your local repository (and pushing to your GitHub
README.md
). See my answer below. -
DanielBell99 about 2 yearsMake sure you're using
README
.md and notREADME
**.rst** for **StackEdit*8
-
-
Ben over 10 yearsIt was off to a good start but then this one doesn't show horizontal rules...abandoned before further tests.
-
Nikos Alexandris over 9 yearsNice for a quick-check though.
-
Felix K. over 8 yearsThe problem with this solution is that GitHub (so far) shows inline diffs of the changes which makes a preview quite unusable if you want to get an impression of how the changes look like and not what actually changed.
-
Aaron over 7 yearsdillinger.io also seems to be down now, although it is still the first listed when you google "markdown online viewer", so it might just be me. I successfully used stackedit.io to preview and edit my readme.md.
-
Emadpres over 7 yearsSince I had local resources, like screenshots of app, this solution works best. Thanks!
-
oneWorkingHeadphone about 7 yearsThank you! It's nice not to have to break my workflow and open a different editor or go to a different website
-
PaulB about 7 yearsI have been using atom for a year now and had no idea it could do that! Bring forth the shame nun...
-
three almost 7 yearsDillinger ist ok. Has been ok most of the time.
-
Olkunmustafa over 6 yearsStackEdit is great tool. Thank you!
-
jmgarnier over 6 yearsbrew cask install atom
-
Bruno Bronosky about 6 yearsStackEdit formats "definition lists", github doesn't. StackEdit puts triple backtick code blocks on there own line (useful for use in numbered lists), github doesn't. There are other differences. The only safe bet is to trial and error with a gist and delete it when you are done.
-
Mahmoud about 6 years@B12Toaster You can create a new file on the repository using GitHub website (without saving it) and name it
xxx.md
and paste your code there. File extension is.md
so you can preview your changes. You will update util you finish, then copy the file content and paste it over the originalreadme.md
file. -
zhihong about 6 yearsUsed several tools before. And StackEdit is by now the one render most part like Github. Thanks
-
aerin over 5 yearsNice!! I don't have to install atom!!
-
Chris Priest about 5 yearsUnfortunately it doesn't look like Mou support MacOS Mojave (10.14)
-
Abel Callejo almost 5 yearsThis works well because it supports github, gitlab, and generic markdown. Although it is difficult to install.
-
Upio over 4 yearsThis should be the accepted answer - it's perfect! Just alt-tab between your editor and browser, and it will automatically re-render the markdown, and it looks exactly like it does on GitHub. Finally an acceptable solution.
-
Nagev about 4 yearsBy the way, I wanted to test the link to titles used by GitHub (stackoverflow.com/a/45860695/5362795) and found that it's also supported by VS Code!
-
austin about 4 yearsperfs already had Atom installed just typed
atom .
and right clicked the readme >Markdown Preview
-
David Parks about 4 yearsAtom rules the roost. None of stackedit, Dillinger, or typora supported collapsible sections via HTML
<details>
tags. Atom does and looks better than the rest to boot. -
AFOC about 4 yearsAn additional issue is that it does not accurately display everything. One concrete example: if you are centering an image at the top using
<div align='center'><img ...></div>
it will not show it centered in the preview, it will be left-aligned. You have to save it to see it accurately, which makes the preview untrustworthy in my opinion. -
Spikatrix almost 4 yearsCtrl+Shift+M didn't work for me for some reason. Had to open the command palette (Ctrl+Shift+P) and select markdown preview from there. Thanks!
-
matteok over 3 yearsMacDown is a great alternative to Mou. The developer states that the application is inspired by Mou so they are pretty similar. For me the transition was smooth macdown.uranusjr.com
-
Keeely over 2 yearsFor the latest Pycharm it seems to support it out of the box (no plugins needed).
-
randalv over 2 yearsCorrect - it's now built in to pycharm.
-
DanielBell99 about 2 yearsMake sure you're using
README
.md and notREADME
**.rst** for *StackEdit