

Learn more about the diff format and its syntax on Wikipedia.įor example, the json block above could show some changes using a code listing like this one: This language will let you use syntax highlighting on line-by-line diff(erence) files like you get in commit messages and pull requests using git (and other source control providers). In addition to the many other languages that support syntax highlighting in your Markdown files, you can specify the language of diff. I also want to introduce you to one generally-supported language that you may not have used before, even if you're a long time Markdown user. My goal here isn't to reproduce the information already available in these resources, but to make sure you're aware of it and can leverage it in your technical writing. You'll find a list of supported languages for highlight.js, the tool used by Stack Overflow's Markdown.

Stack Overflow also has docs on editing with Stack Overflow's Markdown. GitHub has some nice docs on code highlighting with GitHub flavored Markdown. For instance, if you try to highlight your JSON as XML or your C# as VB. Nothing forces you to use the correct language for your code block - you'll just get odd results. In the above code listing, there is better syntax highlighting, because I've indicated what language to use. Personally, I just write the markdown by hand, usually with VS Code, as I'm doing now for this article.ĭifferent platforms have different support for Markdown features, but virtually all of them support code listing using something commonly referred to as "code fences." Code fences are a markdown syntax used to denote the start and end of a code block, like this one:ĭescription : "We help sftware teams deliver better software, faster." , If you really want a great editor for markdown, I recommend my friend Rick Strahl's Markdown Monster (no affiliate link or kickbacks) tool.
#Macdown code highlighted in editor software#
As a result, it's become pretty ubiquitous within the software development space, and most online platforms support some flavor of it. Markdown is a great language to use to write content in, because it offers built-in styling without the security and other issues that similar markup languages like HTML have. Did you know these support many different languages to allow for proper syntax highlighting, including a diff 'language'? Markdown code fences If you're writing blog posts, GitHub content, and/or Stack Over flow questions and answers using Markdown, it's often helpful to show code in code blocks of within code fences.
