This content originally appeared on @mdo and was authored by Mark Otto
I see a fair number of issues, pull requests, and comments on GitHub from folks who don’t know how to highlight snippets of code. While this is a problem in it’s own right and we should solve that, I figure I’d drop some knowledge until we figure that other stuff out at GitHub.
Inline code
Inline code is wrapped in backticks—the ``` character.
Unlike normal HTML, there is no need to escape angle brackets—GitHub Flavored Markdown does that for you.
Code blocks
Multiple lines of code are easily created by placing three backticks before and after a code block.
Language-specific code blocks
You can optional specify a language for proper syntax highlighting on code blocks. Just add the language identifier after the first set of backticks.
Further reading
More of the GitHub Flavored Markdown nuances are documented on the GitHub Help site. Check it out for information on autolinking, task lists, Emoji, and more.
This content originally appeared on @mdo and was authored by Mark Otto
Mark Otto | Sciencx (2013-04-23T00:00:00+00:00) Formatting code on GitHub. Retrieved from https://www.scien.cx/2013/04/23/formatting-code-on-github/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.