Commit 951e973eaf6f61f9bbba513ed075638aa1c76b65

beckwith 2015-05-08T08:27:36

add dockerfile highlighting

diff --git a/components.js b/components.js
index 7be1869..8997f0a 100644
--- a/components.js
+++ b/components.js
@@ -114,6 +114,10 @@ var components = {
 			"require": "clike",
 			"owner": "Golmote"
 		},
+		"dockerfile": {
+			"title": "Dockerfile",
+			"owner": "JustinBeckwith"
+		},
 		"eiffel": {
 			"title": "Eiffel",
 			"owner": "Conaclos"
diff --git a/components/prism-docker.js b/components/prism-docker.js
new file mode 100644
index 0000000..835f037
--- /dev/null
+++ b/components/prism-docker.js
@@ -0,0 +1,8 @@
+Prism.languages.docker = {
+	'keyword': {
+    pattern: /^\s*\b(ONBUILD|FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|COPY|VOLUME|USER|WORKDIR|CMD|ENTRYPOINT)\b\s/mi
+	},
+  'string': /("|')(\\\n|\\?.)*?\1/,
+	'comment': /#[^\n]+/,
+  'punctuation': /([:[\]{}\-,|>?]|---|\.\.\.)/
+};
diff --git a/examples/prism-dockerfile.html b/examples/prism-dockerfile.html
new file mode 100644
index 0000000..295a3cf
--- /dev/null
+++ b/examples/prism-dockerfile.html
@@ -0,0 +1,39 @@
+<h1>Dockerfile</h1>
+<p>To use this language, use the class "language-docker".</p>
+
+<h2>Comments</h2>
+<pre><code># These are the comments for a dockerfile.
+# I want to make sure $(variables) don't break out,
+# and we shouldn't see keywords like ADD or ENTRYPOINT
+</code></pre>
+
+<h2>Instructions</h2>
+<pre><code># Use the official go docker image built on debian.
+FROM golang:1.4.2
+
+# Grab the source code and add it to the workspace.
+ADD . /go/src/github.com/JustinBeckwith/revel-appengine
+
+# Install revel and the revel CLI.
+RUN go get github.com/revel/revel
+RUN go get github.com/revel/cmd/revel
+</code></pre>
+
+
+<h2>Full example</h2>
+<pre><code># Use the official go docker image built on debian.
+FROM golang:1.4.2
+
+# Grab the source code and add it to the workspace.
+ADD . /go/src/github.com/JustinBeckwith/revel-appengine
+
+# Install revel and the revel CLI.
+RUN go get github.com/revel/revel
+RUN go get github.com/revel/cmd/revel
+
+# Use the revel CLI to start up our application.
+ENTRYPOINT revel run github.com/JustinBeckwith/revel-appengine dev 8080
+
+# Open up the port where the app is running.
+EXPOSE 8080
+</code></pre>