From 0640631d074c6be26261dcb953670d079dc27a0d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 24 Apr 2013 17:57:44 -0700 Subject: [PATCH] Include JS/CoffeeScript grammars in markdown code blocks --- README.md | 4 ++++ src/packages/gfm/grammars/gfm.cson | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/README.md b/README.md index 715e0b5d4..5e26ad9ea 100644 --- a/README.md +++ b/README.md @@ -17,3 +17,7 @@ Check out our [documentation on the docs tab](https://github.com/github/atom/doc 1. `gh-setup atom` 2. `cd ~/github/atom && rake install` + +```coffeescript +-> 'hello' +``` diff --git a/src/packages/gfm/grammars/gfm.cson b/src/packages/gfm/grammars/gfm.cson index 4f8f9fc79..ff93a3099 100644 --- a/src/packages/gfm/grammars/gfm.cson +++ b/src/packages/gfm/grammars/gfm.cson @@ -49,6 +49,26 @@ 'match': '^\\s*[-]{3,}\\s*$' 'name': 'comment.hr.gfm' } + { + 'begin': '^```coffee(script)?$' + 'beginCaptures': + '0': 'name': 'support.gfm' + 'end': '^```$' + 'endCaptures': + '0': 'name': 'support.gfm' + 'name': 'markup.raw.gfm' + 'patterns': ['include': 'source.coffee'] + } + { + 'begin': '^```(javascript|js)$' + 'beginCaptures': + '0': 'name': 'support.gfm' + 'end': '^```$' + 'endCaptures': + '0': 'name': 'support.gfm' + 'name': 'markup.raw.gfm' + 'patterns': ['include': 'source.js'] + } { 'begin': '^```.*$' 'beginCaptures':