commit
993df16bdb
8 changed files with 170 additions and 7 deletions
|
|
@ -27,7 +27,7 @@
|
||||||
<!-- load ace emmet extension -->
|
<!-- load ace emmet extension -->
|
||||||
<script src="../build/src-noconflict/ext-emmet.js"></script>
|
<script src="../build/src-noconflict/ext-emmet.js"></script>
|
||||||
<!-- load core emmet files -->
|
<!-- load core emmet files -->
|
||||||
<script src="http://nightwing.github.io/emmet-core/emmet.js"></script>
|
<script src="https://nightwing.github.io/emmet-core/emmet.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// trigger extension
|
// trigger extension
|
||||||
ace.require("ace/ext/emmet");
|
ace.require("ace/ext/emmet");
|
||||||
|
|
|
||||||
|
|
@ -548,7 +548,7 @@ new StatusBar(env.editor, cmdLine.container);
|
||||||
|
|
||||||
|
|
||||||
var Emmet = require("ace/ext/emmet");
|
var Emmet = require("ace/ext/emmet");
|
||||||
net.loadScript("http://nightwing.github.io/emmet-core/emmet.js", function() {
|
net.loadScript("https://nightwing.github.io/emmet-core/emmet.js", function() {
|
||||||
Emmet.setCore(window.emmet);
|
Emmet.setCore(window.emmet);
|
||||||
env.editor.setOption("enableEmmet", true);
|
env.editor.setOption("enableEmmet", true);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
53
demo/kitchen-sink/docs/Dockerfile
Normal file
53
demo/kitchen-sink/docs/Dockerfile
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
#
|
||||||
|
# example Dockerfile for http://docs.docker.io/en/latest/examples/postgresql_service/
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM ubuntu
|
||||||
|
MAINTAINER SvenDowideit@docker.com
|
||||||
|
|
||||||
|
# Add the PostgreSQL PGP key to verify their Debian packages.
|
||||||
|
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
|
||||||
|
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
|
||||||
|
|
||||||
|
# Add PostgreSQL's repository. It contains the most recent stable release
|
||||||
|
# of PostgreSQL, ``9.3``.
|
||||||
|
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
|
||||||
|
|
||||||
|
# Update the Ubuntu and PostgreSQL repository indexes
|
||||||
|
RUN apt-get update
|
||||||
|
|
||||||
|
# Install ``python-software-properties``, ``software-properties-common`` and PostgreSQL 9.3
|
||||||
|
# There are some warnings (in red) that show up during the build. You can hide
|
||||||
|
# them by prefixing each apt-get statement with DEBIAN_FRONTEND=noninteractive
|
||||||
|
RUN apt-get -y -q install python-software-properties software-properties-common
|
||||||
|
RUN apt-get -y -q install postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3
|
||||||
|
|
||||||
|
# Note: The official Debian and Ubuntu images automatically ``apt-get clean``
|
||||||
|
# after each ``apt-get``
|
||||||
|
|
||||||
|
# Run the rest of the commands as the ``postgres`` user created by the ``postgres-9.3`` package when it was ``apt-get installed``
|
||||||
|
USER postgres
|
||||||
|
|
||||||
|
# Create a PostgreSQL role named ``docker`` with ``docker`` as the password and
|
||||||
|
# then create a database `docker` owned by the ``docker`` role.
|
||||||
|
# Note: here we use ``&&\`` to run commands one after the other - the ``\``
|
||||||
|
# allows the RUN command to span multiple lines.
|
||||||
|
RUN /etc/init.d/postgresql start &&\
|
||||||
|
psql --command "CREATE USER docker WITH SUPERUSER PASSWORD 'docker';" &&\
|
||||||
|
createdb -O docker docker
|
||||||
|
|
||||||
|
# Adjust PostgreSQL configuration so that remote connections to the
|
||||||
|
# database are possible.
|
||||||
|
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/9.3/main/pg_hba.conf
|
||||||
|
|
||||||
|
# And add ``listen_addresses`` to ``/etc/postgresql/9.3/main/postgresql.conf``
|
||||||
|
RUN echo "listen_addresses='*'" >> /etc/postgresql/9.3/main/postgresql.conf
|
||||||
|
|
||||||
|
# Expose the PostgreSQL port
|
||||||
|
EXPOSE 5432
|
||||||
|
|
||||||
|
# Add VOLUMEs to allow backup of config, logs and databases
|
||||||
|
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
|
||||||
|
|
||||||
|
# Set the default command to run when starting the container
|
||||||
|
CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]
|
||||||
|
|
@ -13,13 +13,13 @@
|
||||||
|
|
||||||
<!--DEVEL-->
|
<!--DEVEL-->
|
||||||
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
<link rel="stylesheet" href="demo/kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||||
<script async="true" src="http://use.edgefonts.net/source-code-pro.js"></script>
|
<script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
|
||||||
<!--DEVEL-->
|
<!--DEVEL-->
|
||||||
|
|
||||||
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
|
<link href="./doc/site/images/favicon.ico" rel="icon" type="image/x-icon">
|
||||||
<!--PACKAGE
|
<!--PACKAGE
|
||||||
<link rel="stylesheet" href="kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
<link rel="stylesheet" href="kitchen-sink/styles.css" type="text/css" media="screen" charset="utf-8">
|
||||||
<script async="true" src="http://use.edgefonts.net/source-code-pro.js"></script>
|
<script async="true" src="https://use.edgefonts.net/source-code-pro.js"></script>
|
||||||
PACKAGE-->
|
PACKAGE-->
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ var supportedModes = {
|
||||||
D: ["d|di"],
|
D: ["d|di"],
|
||||||
Dart: ["dart"],
|
Dart: ["dart"],
|
||||||
Diff: ["diff|patch"],
|
Diff: ["diff|patch"],
|
||||||
|
Dockerfile: ["^Dockerfile"],
|
||||||
Dot: ["dot"],
|
Dot: ["dot"],
|
||||||
Erlang: ["erl|hrl"],
|
Erlang: ["erl|hrl"],
|
||||||
EJS: ["ejs"],
|
EJS: ["ejs"],
|
||||||
|
|
|
||||||
52
lib/ace/mode/dockerfile.js
Normal file
52
lib/ace/mode/dockerfile.js
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var oop = require("../lib/oop");
|
||||||
|
var ShMode = require("./sh").Mode;
|
||||||
|
var DockerfileHighlightRules = require("./dockerfile_highlight_rules").DockerfileHighlightRules;
|
||||||
|
var CStyleFoldMode = require("./folding/cstyle").FoldMode;
|
||||||
|
|
||||||
|
var Mode = function() {
|
||||||
|
ShMode.call(this);
|
||||||
|
|
||||||
|
this.HighlightRules = DockerfileHighlightRules;
|
||||||
|
this.foldingRules = new CStyleFoldMode();
|
||||||
|
};
|
||||||
|
oop.inherits(Mode, ShMode);
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
this.$id = "ace/mode/dockerfile";
|
||||||
|
}).call(Mode.prototype);
|
||||||
|
|
||||||
|
exports.Mode = Mode;
|
||||||
|
});
|
||||||
57
lib/ace/mode/dockerfile_highlight_rules.js
Normal file
57
lib/ace/mode/dockerfile_highlight_rules.js
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
/* ***** BEGIN LICENSE BLOCK *****
|
||||||
|
* Distributed under the BSD license:
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010, Ajax.org B.V.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Ajax.org B.V. nor the
|
||||||
|
* names of its contributors may be used to endorse or promote products
|
||||||
|
* derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
|
||||||
|
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
|
define(function(require, exports, module) {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var oop = require("../lib/oop");
|
||||||
|
var ShHighlightRules = require("./sh_highlight_rules").ShHighlightRules;
|
||||||
|
|
||||||
|
var DockerfileHighlightRules = function() {
|
||||||
|
ShHighlightRules.call(this);
|
||||||
|
|
||||||
|
var startRules = this.$rules.start;
|
||||||
|
for (var i = 0; i < startRules.length; i++) {
|
||||||
|
if (startRules[i].token == "variable.language") {
|
||||||
|
startRules.splice(i, 0, {
|
||||||
|
token: "variable.language",
|
||||||
|
regex: "(?:^(?:FROM|MAINTAINER|RUN|CMD|EXPOSE|ENV|ADD|ENTRYPOINT|VOLUME|USER|WORKDIR|ONBUILD)\\b)",
|
||||||
|
caseInsensitive: true
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
oop.inherits(DockerfileHighlightRules, ShHighlightRules);
|
||||||
|
|
||||||
|
exports.DockerfileHighlightRules = DockerfileHighlightRules;
|
||||||
|
});
|
||||||
|
|
@ -189,7 +189,7 @@ var TextHighlightRules = function() {
|
||||||
// skip included rules since they are already processed
|
// skip included rules since they are already processed
|
||||||
//i += args.length - 3;
|
//i += args.length - 3;
|
||||||
i--;
|
i--;
|
||||||
toInsert = null
|
toInsert = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rule.keywordMap) {
|
if (rule.keywordMap) {
|
||||||
|
|
@ -199,7 +199,7 @@ var TextHighlightRules = function() {
|
||||||
delete rule.defaultToken;
|
delete rule.defaultToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
Object.keys(rules).forEach(processState, this);
|
Object.keys(rules).forEach(processState, this);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -223,7 +223,7 @@ var TextHighlightRules = function() {
|
||||||
return ignoreCase
|
return ignoreCase
|
||||||
? function(value) {return keywords[value.toLowerCase()] || defaultToken }
|
? function(value) {return keywords[value.toLowerCase()] || defaultToken }
|
||||||
: function(value) {return keywords[value] || defaultToken };
|
: function(value) {return keywords[value] || defaultToken };
|
||||||
}
|
};
|
||||||
|
|
||||||
this.getKeywords = function() {
|
this.getKeywords = function() {
|
||||||
return this.$keywords;
|
return this.$keywords;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue