ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Markdown Extended

by jonschlinkert ALL Top 100

Top 100 Sublime Text plugin! Markdown syntax highlighter for Sublime Text, with extended support for GFM fenced code blocks, with language-specific syntax highlighting. YAML Front Matter. Works with ST2/ST3. Goes great with Assemble.

Details

  • 2017.08.08.23.08.34
  • github.​com
  • github.​com
  • 7 years ago
  • 2 hours ago
  • 11 years ago

Installs

  • Total 322K
  • Win 140K
  • Mac 122K
  • Linux 59K
Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 29 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3
Windows 10 20 10 13 20 20 25 22 17 12 14 20 24 28 29 29 13 15 20 18 31 28 25 7 15 22 25 21 22 21 16 24 19 14 23 13 13 8 7 13 15 22 22 21 10 10
Mac 2 12 16 9 12 9 20 14 15 6 0 8 10 12 15 14 7 8 17 15 18 15 9 17 7 8 16 17 25 14 7 6 10 14 12 16 8 4 6 10 8 12 10 15 6 8
Linux 5 9 5 7 6 5 10 14 12 2 5 7 6 6 6 10 3 4 8 11 9 12 5 5 3 13 11 8 7 11 11 6 8 12 11 8 8 8 6 3 6 6 8 8 8 5

Readme

Source
raw.​githubusercontent.​com

sublime-markdown-extended package control total downloads

Extends Soda's Monokai and the default markdown styles with additional syntax highlighting for YAML Front Matter, GitHub Flavored Markdown (GFM) and language-specific syntax highlighting inside GFM “fenced” code blocks

Although substantial changes have been made, thank you @aziz and other contributors to Knockdown, for the code for the fenced code blocks.

Get Monokai Extended for better highlighting.

Jump to Examples ↓

Getting Started

1. Installation

Package Control

If you already have Package Control installed in Sublime Text:

  • Select “Install Package” from the Command Palette: Ctrl+Shift+P on Windows and Linux or ⇧⌘P on OS X)
  • Search for “Markdown Extended” and click enter.

Manual Installation

Go to Preferences -> Browse Packages, and then either download and unzip this plugin into that directory, or:

git clone https://github.com/jonschlinkert/sublime-markdown-extended.git "sublime-markdown-extended"

2. Activate this Language

After installing this package, open a markdown file and switch the language to Markdown Extended, using one of the following methods:

  • Select from the list of supported languages in your status bar at the bottom right corner of your editor
  • ctrl + shift + p and search for “Markdown Extended”

3. Make “Markdown Extended” the default

To make Markdown Extended the default highlighting for the current extension:

  1. Open a file with the extension you want to set a default for (i.e. .md)
  2. Navigate through the following menus in Sublime Text: View -> Syntax -> Open all with current extension as... -> Markdown Extended

Features:

  • Support for YAML Front Matter
  • Support for GFM “fenced” code blocks
  • Language-specific syntax highlighting support inside GFM “fenced” code blocks for most popular languages (see below for the list of supported languages)
  • Syntax highlighting for URLs in text which is auto-linked by GFM
  • Proper syntax highlighting for bullets and numbers in ordered/unordered lists
  • Proper syntax highlighting for bold and italics by ignoring multiple underscores in words

Markdown Enhancements

The following examples use the Monokai Extended theme.

Whitespace

Significant whitespace

Whitespace is significant only directly before and directly after fenced code blocks! Following these instructions will ensure that highlighting works properly and consistently._

This is very simple:

  • Add a newline before and after clode blocks
  • No trailing spaces after the last code block

If you don't, it won't break your code but it won't always look awesome.

Comparisons with and without proper whitespace

Whitespace before the block

You will need to keep a space above and below fenced code blocks for predictable results with syntax highlighting. For example, this is what it looks like when there is no space before a fenced code block:

image

This is what it looks like with proper spacing:

image

Whitespace after the block

Also add a new line after code blocks, but make sure that there is no trailing whitespace next to the bottom fence.

With a trailing whitespace

image

Without a trailing whitespace

image

Supported languages

The following languages are highlighted inside fenced code blocks:

Note that in order for a language to be highlighted properly, you must have the language installed in Sublime Text.

  • coffee|coffeescript
  • coffee front matter
  • cpp
  • csharp
  • css
  • c
  • c++
  • diff
  • ejs
  • erlang
  • underscore
  • go
  • graphql
  • lodash
  • handlebars|hbs: requires the Sublime Text Handlebars package
  • html|html5
  • ini
  • jade
  • java
  • javascript|js
  • json
  • json front matter
  • julia
  • less
  • ls|livescript|LiveScript
  • lua
  • md|markdown
  • nginx
  • objective-c
  • objective-c++
  • perl
  • r
  • ruby
  • sass
  • scala
  • scss
  • shell
  • bash
  • sql|ddl|dml
  • postgresql|postgres|pgsql
  • styl
  • swift
  • swig
  • liquid
  • xml
  • yaml
  • yaml front matter

CSS

Before

image

After

image

LESS

Before

image

After

image

HTML

Before

image

After

image

JavaScript

Before

image

After

image

Coffee

Before

image

After

image

LiveScript

Before

image

After

image

Shell

Before

image

After

image

YAML Front Matter

See gray-matter

Before

image

After

image

Coffee Front Matter

See gray-matter

Before

image

After

image

Authors

Jon Schlinkert

Alexander Krivoshhekov

Copyright and license

Copyright 2013-2015 Jon Schlinkert

MIT License