add dockerfile highlighting
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
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>