From 08c34ebdde097c5aca49df530a2ff203727cdfa9 Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke <marijn@haverbeke.nl> Date: Mon, 15 Aug 2016 13:46:20 +0200 Subject: [PATCH] [pug mode] Rename from Jade Closes #4166 --- doc/compress.html | 2 +- mode/index.html | 2 +- mode/meta.js | 2 +- mode/{jade => pug}/index.html | 16 ++++++++-------- mode/{jade/jade.js => pug/pug.js} | 5 +++-- 5 files changed, 14 insertions(+), 13 deletions(-) rename mode/{jade => pug}/index.html (83%) rename mode/{jade/jade.js => pug/pug.js} (99%) diff --git a/doc/compress.html b/doc/compress.html index 80de52da..3487d75e 100644 --- a/doc/compress.html +++ b/doc/compress.html @@ -166,7 +166,6 @@ <option value="http://codemirror.net/mode/htmlmixed/htmlmixed.js">htmlmixed.js</option> <option value="http://codemirror.net/mode/http/http.js">http.js</option> <option value="http://codemirror.net/mode/idl/idl.js">idl.js</option> - <option value="http://codemirror.net/mode/jade/jade.js">jade.js</option> <option value="http://codemirror.net/mode/javascript/javascript.js">javascript.js</option> <option value="http://codemirror.net/mode/jinja2/jinja2.js">jinja2.js</option> <option value="http://codemirror.net/mode/julia/julia.js">julia.js</option> @@ -193,6 +192,7 @@ <option value="http://codemirror.net/mode/properties/properties.js">properties.js</option> <option value="http://codemirror.net/mode/protobuf/protobuf.js">protobuf.js</option> <option value="http://codemirror.net/mode/python/python.js">python.js</option> + <option value="http://codemirror.net/mode/pug/pug.js">pug.js</option> <option value="http://codemirror.net/mode/puppet/puppet.js">puppet.js</option> <option value="http://codemirror.net/mode/q/q.js">q.js</option> <option value="http://codemirror.net/mode/r/r.js">r.js</option> diff --git a/mode/index.html b/mode/index.html index 732e0e52..3a2fe551 100644 --- a/mode/index.html +++ b/mode/index.html @@ -76,7 +76,6 @@ option.</p> <li><a href="http/index.html">HTTP</a></li> <li><a href="idl/index.html">IDL</a></li> <li><a href="clike/index.html">Java</a></li> - <li><a href="jade/index.html">Jade</a></li> <li><a href="javascript/index.html">JavaScript</a> (<a href="jsx/index.html">JSX</a>)</li> <li><a href="jinja2/index.html">Jinja2</a></li> <li><a href="julia/index.html">Julia</a></li> @@ -107,6 +106,7 @@ option.</p> <li><a href="powershell/index.html">PowerShell</a></li> <li><a href="properties/index.html">Properties files</a></li> <li><a href="protobuf/index.html">ProtoBuf</a></li> + <li><a href="pug/index.html">Pug</a></li> <li><a href="puppet/index.html">Puppet</a></li> <li><a href="python/index.html">Python</a></li> <li><a href="q/index.html">Q</a></li> diff --git a/mode/meta.js b/mode/meta.js index eb25e242..2e9ac7ce 100644 --- a/mode/meta.js +++ b/mode/meta.js @@ -66,7 +66,7 @@ {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]}, {name: "HTTP", mime: "message/http", mode: "http"}, {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]}, - {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]}, + {name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"]}, {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]}, {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]}, {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"], diff --git a/mode/jade/index.html b/mode/pug/index.html similarity index 83% rename from mode/jade/index.html rename to mode/pug/index.html index e534981b..1765853a 100644 --- a/mode/jade/index.html +++ b/mode/pug/index.html @@ -1,6 +1,6 @@ <!doctype html> -<title>CodeMirror: Jade Templating Mode</title> +<title>CodeMirror: Pug Templating Mode</title> <meta charset="utf-8"/> <link rel=stylesheet href="../../doc/docs.css"> @@ -10,7 +10,7 @@ <script src="../css/css.js"></script> <script src="../xml/xml.js"></script> <script src="../htmlmixed/htmlmixed.js"></script> -<script src="jade.js"></script> +<script src="pug.js"></script> <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style> <div id=nav> <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a> @@ -22,17 +22,17 @@ </ul> <ul> <li><a href="../index.html">Language modes</a> - <li><a class=active href="#">Jade Templating Mode</a> + <li><a class=active href="#">Pug Templating Mode</a> </ul> </div> <article> -<h2>Jade Templating Mode</h2> +<h2>Pug Templating Mode</h2> <form><textarea id="code" name="code"> doctype html html head - title= "Jade Templating CodeMirror Mode Example" + title= "Pug Templating CodeMirror Mode Example" link(rel='stylesheet', href='/css/bootstrap.min.css') link(rel='stylesheet', href='/css/index.css') script(type='text/javascript', src='/js/jquery-1.9.1.min.js') @@ -60,11 +60,11 @@ doctype html </textarea></form> <script> var editor = CodeMirror.fromTextArea(document.getElementById("code"), { - mode: {name: "jade", alignCDATA: true}, + mode: {name: "pug", alignCDATA: true}, lineNumbers: true }); </script> - <h3>The Jade Templating Mode</h3> + <h3>The Pug Templating Mode</h3> <p> Created by Forbes Lindesay. Managed as part of a Brackets extension at <a href="https://github.com/ForbesLindesay/jade-brackets">https://github.com/ForbesLindesay/jade-brackets</a>.</p> - <p><strong>MIME type defined:</strong> <code>text/x-jade</code>.</p> + <p><strong>MIME type defined:</strong> <code>text/x-pug</code>, <code>text/x-jade</code>.</p> </article> diff --git a/mode/jade/jade.js b/mode/pug/pug.js similarity index 99% rename from mode/jade/jade.js rename to mode/pug/pug.js index 51ed105a..40182336 100644 --- a/mode/jade/jade.js +++ b/mode/pug/pug.js @@ -11,7 +11,7 @@ })(function(CodeMirror) { "use strict"; -CodeMirror.defineMode('jade', function (config) { +CodeMirror.defineMode("pug", function (config) { // token types var KEYWORD = 'keyword'; var DOCTYPE = 'meta'; @@ -585,6 +585,7 @@ CodeMirror.defineMode('jade', function (config) { }; }, 'javascript', 'css', 'htmlmixed'); -CodeMirror.defineMIME('text/x-jade', 'jade'); +CodeMirror.defineMIME('text/x-pug', 'pug'); +CodeMirror.defineMIME('text/x-jade', 'pug'); }); -- GitLab