Skip to content

Commit

Permalink
Add file extensions support for major languages
Browse files Browse the repository at this point in the history
This adds aliases for file extensions of some major languages.

- `.coffee` -> `.coffee`
- `.md` -> `.markdown`
- `.py` -> `.python`
- `.rb` -> `.ruby`
- `.yml` -> `.yaml`
  • Loading branch information
ybiquitous committed Dec 3, 2018
1 parent 4a8219a commit 4d76640
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/prism-coffeescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ Prism.languages.insertBefore('coffeescript', 'keyword', {

delete Prism.languages.coffeescript['template-string'];

Prism.languages.coffee = Prism.languages.coffeescript;
}(Prism));
2 changes: 2 additions & 0 deletions components/prism-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,5 @@ Prism.hooks.add('wrap', function (env) {

env.content = Prism.highlight(code, grammar, codeLang);
});

Prism.languages.md = Prism.languages.markdown;
2 changes: 2 additions & 0 deletions components/prism-python.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,5 @@ Prism.languages.python = {
};

Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python;

Prism.languages.py = Prism.languages.python;
2 changes: 2 additions & 0 deletions components/prism-ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,6 @@
}
}
];

Prism.languages.rb = Prism.languages.ruby;
}(Prism));
2 changes: 2 additions & 0 deletions components/prism-yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ Prism.languages.yaml = {
'important': /[&*][\w]+/,
'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./
};

Prism.languages.yml = Prism.languages.yaml;

0 comments on commit 4d76640

Please sign in to comment.