-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade ember-code-snippet to v3.0.0 (#436)
- Loading branch information
1 parent
b03d4c1
commit 73f9eb1
Showing
8 changed files
with
70 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Component from '@ember/component'; | ||
import layout from './template'; | ||
import hljs from 'highlight.js/lib/highlight'; | ||
|
||
// Installed languages | ||
import javascript from 'highlight.js/lib/languages/javascript'; | ||
import css from 'highlight.js/lib/languages/css'; | ||
import handlebars from 'highlight.js/lib/languages/handlebars'; | ||
import htmlbars from 'highlight.js/lib/languages/htmlbars'; | ||
import json from 'highlight.js/lib/languages/json'; | ||
import xml from 'highlight.js/lib/languages/xml'; | ||
import diff from 'highlight.js/lib/languages/diff'; | ||
import shell from 'highlight.js/lib/languages/shell'; | ||
import typescript from 'highlight.js/lib/languages/typescript'; | ||
|
||
hljs.registerLanguage('javascript', javascript); | ||
hljs.registerLanguage('js', javascript); | ||
hljs.registerLanguage('css', css); | ||
hljs.registerLanguage('handlebars', handlebars); | ||
hljs.registerLanguage('htmlbars', htmlbars); | ||
hljs.registerLanguage('hbs', htmlbars); | ||
hljs.registerLanguage('json', json); | ||
hljs.registerLanguage('xml', xml); | ||
hljs.registerLanguage('diff', diff); | ||
hljs.registerLanguage('shell', shell); | ||
hljs.registerLanguage('sh', shell); | ||
hljs.registerLanguage('typescript', typescript); | ||
hljs.registerLanguage('ts', typescript); | ||
|
||
export default Component.extend({ | ||
tagName: 'pre', | ||
classNameBindings: ['language'], | ||
layout, | ||
didInsertElement() { | ||
this._super.apply(this, arguments); | ||
|
||
hljs.highlightBlock(this.element); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{yield}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters