Skip to content

Commit

Permalink
Split the components registration object into its own file
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaVerou committed May 18, 2013
1 parent 08143d9 commit 97d57c6
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 96 deletions.
95 changes: 0 additions & 95 deletions code.js
Original file line number Diff line number Diff line change
@@ -1,98 +1,3 @@
var components = {
core: {
meta: {
path: 'components/prism-core.js',
option: 'mandatory'
},
'core': 'Core'
},
themes: {
meta: {
path: '{id}.css',
link: 'index.html?theme={id}',
exclusive: true
},
'prism': {
title: 'Default',
option: 'default'
},
'prism-dark': 'Dark',
'prism-funky': 'Funky',
'okaidia': 'Okaidia'
},
languages: {
meta: {
path: 'components/prism-{id}'
},
'markup': {
title: 'Markup',
option: 'default'
},
'css': {
title: 'CSS',
option: 'default'
},
'clike': {
title: 'C-like',
option: 'default'
},
'javascript': {
title: 'JavaScript',
option: 'default',
require: 'clike'
},
'java' : {
title: 'Java',
require: 'clike'
},
'php' : {
title: 'PHP',
require: 'clike'
},
'coffeescript': {
title: 'CoffeeScript',
require: 'javascript'
},
'scss': {
title: 'Sass (Scss)',
require: 'css'
},
'bash' : {
title: 'Bash',
require: 'clike'
},
'c': {
title: 'C',
require: 'clike'
},
'cpp': {
title: 'C++',
require: 'c'
},
'python': {
title: 'Python'
},
'sql': {
title: 'SQL'
},
'groovy': {
title: 'Groovy',
require: 'clike'
}
},
plugins: {
meta: {
path: 'plugins/{id}/prism-{id}',
link: 'plugins/{id}/',
hasCSS: true
},
'line-highlight': 'Line Highlight',
'show-invisibles': 'Show Invisibles',
'autolinker': 'Autolinker',
'wpd': 'WebPlatform Docs'
}
};

(function(){

if(!document.body.addEventListener) {
Expand Down
94 changes: 94 additions & 0 deletions components.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
var components = {
core: {
meta: {
path: 'components/prism-core.js',
option: 'mandatory'
},
'core': 'Core'
},
themes: {
meta: {
path: '{id}.css',
link: 'index.html?theme={id}',
exclusive: true
},
'prism': {
title: 'Default',
option: 'default'
},
'prism-dark': 'Dark',
'prism-funky': 'Funky',
'okaidia': 'Okaidia'
},
languages: {
meta: {
path: 'components/prism-{id}'
},
'markup': {
title: 'Markup',
option: 'default'
},
'css': {
title: 'CSS',
option: 'default'
},
'clike': {
title: 'C-like',
option: 'default'
},
'javascript': {
title: 'JavaScript',
option: 'default',
require: 'clike'
},
'java' : {
title: 'Java',
require: 'clike'
},
'php' : {
title: 'PHP',
require: 'clike'
},
'coffeescript': {
title: 'CoffeeScript',
require: 'javascript'
},
'scss': {
title: 'Sass (Scss)',
require: 'css'
},
'bash' : {
title: 'Bash',
require: 'clike'
},
'c': {
title: 'C',
require: 'clike'
},
'cpp': {
title: 'C++',
require: 'c'
},
'python': {
title: 'Python'
},
'sql': {
title: 'SQL'
},
'groovy': {
title: 'Groovy',
require: 'clike'
}
},
plugins: {
meta: {
path: 'plugins/{id}/prism-{id}',
link: 'plugins/{id}/',
hasCSS: true
},
'line-highlight': 'Line Highlight',
'show-invisibles': 'Show Invisibles',
'autolinker': 'Autolinker',
'wpd': 'WebPlatform Docs'
}
};
1 change: 1 addition & 0 deletions download.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ <h2>Customize your download</h2>

<script src="prism.js"></script>
<script src="utopia.js"></script>
<script src="components.js"></script>
<script src="code.js"></script>
<script src="download.js"></script>

Expand Down
1 change: 1 addition & 0 deletions examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ <h2>Two quotes of the same type (i.e. both single or both double) inside a regex

<script src="prism.js"></script>
<script src="utopia.js"></script>
<script src="components.js"></script>
<script src="code.js"></script>

</body>
Expand Down
1 change: 1 addition & 0 deletions extending.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ <h2>Returns</h2>

<script src="prism.js"></script>
<script src="utopia.js"></script>
<script src="components.js"></script>
<script src="code.js"></script>

</body>
Expand Down
1 change: 1 addition & 0 deletions faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ <h1>How can I use different highlighting for tokens with the same name in differ
});
});
</script>
<script src="components.js"></script>
<script src="code.js"></script>

</body>
Expand Down
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h1>Examples</h1>
<section id="features-full">
<h1>Full list of features</h1>
<ul>
<li><strong>Only 1.6KB</strong> minified &amp; gzipped (core). Each language definition adds roughly 300-500 bytes.</li>
<li><strong>Only 2KB</strong> minified &amp; gzipped (core). Each language definition adds roughly 300-500 bytes.</li>
<li>Encourages good author practices. Other highlighters encourage or even force you to use elements that are semantically wrong,
like <code>&lt;pre></code> (on its own) or <code>&lt;script></code>.
Prism forces you to use the correct element for marking up code: <code>&lt;code></code>.
Expand Down Expand Up @@ -193,6 +193,7 @@ <h1>Credits</h1>

<script src="prism.js" data-default-language="markup"></script>
<script src="utopia.js"></script>
<script src="components.js"></script>
<script src="code.js"></script>

</body>
Expand Down
1 change: 1 addition & 0 deletions test.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ <h2>Test drive</h2>

<script src="prism.js"></script>
<script src="utopia.js"></script>
<script src="components.js"></script>
<script src="code.js"></script>
<script>
(function() {
Expand Down

0 comments on commit 97d57c6

Please sign in to comment.