Commit 97d57c65d4a5cb6b3f01903bd42fe6d67819557d

Lea Verou 2013-05-19T00:35:29

Split the components registration object into its own file

diff --git a/code.js b/code.js
index 2ab9491..545267e 100644
--- a/code.js
+++ b/code.js
@@ -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) {
diff --git a/components.js b/components.js
new file mode 100644
index 0000000..1aa5020
--- /dev/null
+++ b/components.js
@@ -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'
+	}
+};
\ No newline at end of file
diff --git a/download.html b/download.html
index 37419ba..da20da5 100644
--- a/download.html
+++ b/download.html
@@ -126,6 +126,7 @@ section.download {
 
 <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>
 
diff --git a/examples.html b/examples.html
index 943e736..c2b5599 100644
--- a/examples.html
+++ b/examples.html
@@ -433,6 +433,7 @@ class CoffeeScript extends Prism.Javascript
 
 <script src="prism.js"></script>
 <script src="utopia.js"></script>
+<script src="components.js"></script>
 <script src="code.js"></script>
 
 </body>
diff --git a/extending.html b/extending.html
index eddb26c..6bbb063 100644
--- a/extending.html
+++ b/extending.html
@@ -180,6 +180,7 @@
 
 <script src="prism.js"></script>
 <script src="utopia.js"></script>
+<script src="components.js"></script>
 <script src="code.js"></script>
 
 </body>
diff --git a/faq.html b/faq.html
index c0f9e2b..da6d038 100644
--- a/faq.html
+++ b/faq.html
@@ -175,6 +175,7 @@ entity</pre>
 		});
 	});
 </script>
+<script src="components.js"></script>
 <script src="code.js"></script>
 
 </body>
diff --git a/index.html b/index.html
index 523868e..19651ed 100644
--- a/index.html
+++ b/index.html
@@ -84,7 +84,7 @@
 <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>. 
@@ -193,6 +193,7 @@
 
 <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>
diff --git a/test.html b/test.html
index 75d0b48..f2f5874 100644
--- a/test.html
+++ b/test.html
@@ -75,6 +75,7 @@ textarea {
 
 <script src="prism.js"></script>
 <script src="utopia.js"></script>
+<script src="components.js"></script>
 <script src="code.js"></script>
 <script>
 (function() {