16 | <% end %>
17 | <%= renderMenu @menuItems %>
--------------------------------------------------------------------------------
/src/documents/actions/merge-lines/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Merge Lines
4 | menuOrder: 9
5 | ---
6 | Many editors have similar action: it merges selected lines into a single one. But when there’s no selection, Emmet will match context HTML tag.
7 |
8 |
18 |
--------------------------------------------------------------------------------
/src/documents/actions/split-join-tag/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Split/Join Tag
4 | menuOrder: 7
5 | ---
6 | This action splits and joins tag definition, e.g. converts from `` to `` and vice versa. Very useful for XML/XSL developers.
7 |
18 |
19 | ----------------
20 |
21 | “Split/Join Tag” action uses “[HTML Matcher](/actions/match-pair/)” internally so it may work in non-HTML syntaxes too.
22 |
--------------------------------------------------------------------------------
/src/documents/customization/preferences/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: "preferences.json"
4 | menuOrder: 2
5 | ---
6 | The `preferences.json` file is used to modify behavior of some actions and resolvers of Emmet. This file contains a simple dictionary of key–value pairs.
7 |
8 | For example, on “[CSS Gradients](/css-abbreviations/gradients/)” there’s description of `css.gradient.fallback` option which enables fallback `background-color` value when definition is expanded. To enable it, simply add this key to `preferences.json` file:
9 |
10 | {
11 | "css.gradient.fallback": true
12 | }
13 |
14 | Here’s a list of currently available options:
15 |
16 |
17 |
--------------------------------------------------------------------------------
/js/lib/preferences.js:
--------------------------------------------------------------------------------
1 | import {template, delegate} from './utils';
2 | import {emmet} from './movie';
3 |
4 | function generatePreferencesTable() {
5 | var prefs = emmet.preferences.list();
6 | var row = template(`
7 |
8 | <%= name %>
9 |
<%= description %>
10 |
11 |
12 | <%- value %>
13 |
14 |
`);
15 |
16 | return `
${prefs.map(item => row(item)).join('')}
`;
17 | }
18 |
19 | export default function(elem) {
20 | elem.innerHTML = generatePreferencesTable();
21 | delegate(elem, '.emmet-preferences__value', evt => elem.classList.toggle('emmet-preferences__value_full'))
22 | }
--------------------------------------------------------------------------------
/css/assets/_preferences.css:
--------------------------------------------------------------------------------
1 | .emmet-preferences table {
2 | margin: 0;
3 | }
4 |
5 | .emmet-preferences td {
6 | vertical-align: top;
7 | }
8 |
9 | .emmet-preferences__name {
10 | font-weight: bold;
11 | }
12 |
13 | .emmet-preferences__desc {
14 | font-size: 0.85em;
15 | }
16 |
17 | .emmet-preferences__value {
18 | white-space: pre;
19 | text-overflow: ellipsis;
20 | overflow: hidden;
21 | display: inline-block;
22 | max-width: 16em;
23 | font-size: 0.85em;
24 | cursor: default;
25 | padding: 0 5px;
26 | border: 1px solid #eaeaea;
27 | background: #f8f8f8;
28 | font-family: Monaco, Bitstream Vera Sans Mono, "Lucida Console", Terminal;
29 | -webkit-border-radius: 5px;
30 | -moz-border-radius: 5px;
31 | border-radius: 5px;
32 | }
33 |
34 | .emmet-preferences__value_full {
35 | white-space: normal;
36 | }
--------------------------------------------------------------------------------
/src/documents/actions/evaluate-math/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Evaluate Math Expression
4 | menuOrder: 11
5 | ---
6 | Evaluates simple math expression like `2*4` or `10/2` and outputs its result. You can use `\` operator which is equivalent to `round(a/b)`.
7 |
8 | Very useful in CSS where numeric values should be modified frequently.
9 |
10 |
--------------------------------------------------------------------------------
/plugins/highlight.js/ini.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | return {
3 | case_insensitive: true,
4 | defaultMode: {
5 | illegal: '[^\\s]',
6 | contains: [
7 | {
8 | className: 'comment',
9 | begin: ';', end: '$'
10 | },
11 | {
12 | className: 'title',
13 | begin: '^\\[', end: '\\]'
14 | },
15 | {
16 | className: 'setting',
17 | begin: '^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*', end: '$',
18 | contains: [
19 | {
20 | className: 'value',
21 | endsWithParent: true,
22 | keywords: 'on off true false yes no',
23 | contains: [hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE]
24 | }
25 | ]
26 | }
27 | ]
28 | }
29 | };
30 | };
--------------------------------------------------------------------------------
/src/documents/actions/inc-dec-number/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Increment/Decrement Number
4 | menuOrder: 12
5 | ---
6 | This action, as name says, increments or decrements number under caret with different steps: 0.1, 1 or 10.
7 |
--------------------------------------------------------------------------------
/src/documents/actions/go-to-pair/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Go to Matching Pair
4 | menuOrder: 2.5
5 | ---
6 | In HTML, allows you to quickly traverse between opening and closing tag:
7 |
8 |
20 |
21 | ----------------
22 |
23 | “Go to Matching Pair” action uses “[HTML Matcher](/actions/match-pair/)” internally so it may work in non-HTML syntaxes too.
24 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "emmetio-docs",
3 | "description": "Emmet Docs & Tutorials",
4 | "version": "1.1.0",
5 | "private": true,
6 | "scripts": {
7 | "start": "docpad run"
8 | },
9 | "devDependencies": {
10 | "docpad": "^6.73.5",
11 | "docpad-plugin-eco": "^2.1.0",
12 | "docpad-plugin-frontend": "^2.0.1",
13 | "docpad-plugin-marked": "^2.3.0",
14 | "docpad-plugin-menu": "^2.1.0",
15 | "docpad-plugin-partials": "^2.9.2",
16 | "gulp": "^3.8.11",
17 | "gulp-gzip": "^1.0.0",
18 | "gulp-minify-css": "^1.0.0",
19 | "html-transform": "git+https://github.com/sergeche/html-transform.git#v1.1.0",
20 | "js-bundler": "git+https://github.com/sergeche/js-bundler.git#v1.0.0",
21 | "safeps": "^2.2.13"
22 | },
23 | "dependencies": {
24 | "codemirror": "^5.0.0",
25 | "codemirror-movie": "^1.2.1",
26 | "emmet-codemirror": "^1.2.4",
27 | "through2": "^2.0.0"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/documents/actions/reflect-css-value/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Reflect CSS Value
4 | menuOrder: 13
5 | ---
6 | A very useful action for CSS developers: it takes value of CSS property under caret and copies it into vendor-prefixed variations with additional transformations, if required.
7 |
--------------------------------------------------------------------------------
/src/documents/actions/remove-tag/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Remove Tag
4 | menuOrder: 8
5 | ---
6 | Quickly removes tag, found by “[Balance](/actions/match-pair/)” action from current caret position, and adjusts indentation.
7 |
8 |
23 |
24 | ----------------
25 |
26 | “Remove Tag” action uses “[HTML Matcher](/actions/match-pair/)” internally so it may work in non-HTML syntaxes too.
27 |
28 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - '0.10'
4 | env:
5 | global:
6 | - secure: sNJQXWkB//P8JhsdLQKhFbKeCcJ2sb6FiEDpqK5UwFGMt9NRnqFCxDHVxpmr61uPB2XmJr5WdhpeOH6TXttEM31QRuBWg02XbXLEhCgQESh/wg5Ro76OSRZ71iAYXLwFxlkdJ3qgVm0hnLjLTKmYuKu7C1E5bH9/wma1S8Y4PLM=
7 | - secure: kez8ylnc99MwHpXNBvUZ3iweAbiXO04NBxB/mRxpl/KF3ZBPwokmd23yoGztm5SRuBTKdpQAXSEryDF2VbE4Pqz94kxxJKqizahGRJJt9JOThZZHhdNoUt44wLz6YLh5RmiYQe/3JFwBxbdyBeEE5Vud2I8Yy7o+dR+c7aztSSk=
8 | - secure: tcFLn8fgP/gxtZQC2iO70tABBOrqB/CFvAfWj9sr069mc6STaVahVol7Wo77cDr4WkrtvpMVXe/laeqsKyMe7vUVbGSuby8tJOrOK5LNuTfgmvS3OFmXCRYsyCa806ft/CLv4nw9Ld8IQGRMXUQCK1wAm6xhRLQF5MMTDQkiqiQ=
9 | addons:
10 | ssh_known_hosts:
11 | - 128.199.54.7
12 | script: ./node_modules/.bin/docpad generate --silent --env production
13 | branches:
14 | only:
15 | - master
16 | after_success:
17 | - sudo apt-get -y -qq install sshpass
18 | - rsync -arlptzO --delete --stats --rsh="sshpass -p $DEPLOY_PASSWORD ssh -l $DEPLOY_USER" ./out/ 128.199.54.7:$DEPLOY_DEST
19 |
--------------------------------------------------------------------------------
/plugins/highlight.js/dos.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | return {
3 | case_insensitive: true,
4 | defaultMode: {
5 | keywords: {
6 | flow: 'if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq',
7 | keyword: 'shift cd dir echo setlocal endlocal set pause copy',
8 | stream: 'prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux',
9 | winutils: 'ping net ipconfig taskkill xcopy ren del'
10 | },
11 | contains: [
12 | {
13 | className: 'envvar', begin: '%%[^ ]'
14 | },
15 | {
16 | className: 'envvar', begin: '%[^ ]+?%'
17 | },
18 | {
19 | className: 'envvar', begin: '![^ ]+?!'
20 | },
21 | {
22 | className: 'number', begin: '\\b\\d+',
23 | relevance: 0
24 | },
25 | {
26 | className: 'comment',
27 | begin: '@?rem', end: '$'
28 | }
29 | ]
30 | }
31 | };
32 | };
--------------------------------------------------------------------------------
/src/documents/actions/base64/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: "Encode/Decode Image to data:URL"
4 | menuOrder: 14
5 | ---
6 | HTML and CSS allows you to embed external resources right into base using [data:URL](http://en.wikipedia.org/wiki/Data_URI_scheme) scheme. Usually, image conversion to base64 is done with external on-line services or third-party assets builder.
7 |
8 | But these tools have downsides: you have to spend extra time on on-line tools or lose control on images that should or should not be converted to base64.
9 |
10 | With Emmet, you can convert image to data:URL right in your editor, as well as convert it _back to external file_.
11 |
12 |
26 |
--------------------------------------------------------------------------------
/src/documents/actions/go-to-edit-point/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Go to Edit Point
4 | menuOrder: 4
5 | ---
6 | This action works for HTML code blocks and allows you to quickly traverse between important code points:
7 |
8 | * between tags
9 | * empty attributes
10 | * newlines with indentation
11 |
12 |
34 |
--------------------------------------------------------------------------------
/plugins/highlight.js/http.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | return {
3 | defaultMode: {
4 | illegal: '\\S',
5 | contains: [
6 | {
7 | className: 'status',
8 | begin: '^HTTP/[0-9\\.]+', end: '$',
9 | contains: [{className: 'number', begin: '\\b\\d{3}\\b'}]
10 | },
11 | {
12 | className: 'request',
13 | begin: '^[A-Z]+ (.*?) HTTP/[0-9\\.]+$', returnBegin: true, end: '$',
14 | contains: [
15 | {
16 | className: 'string',
17 | begin: ' ', end: ' ',
18 | excludeBegin: true, excludeEnd: true
19 | }
20 | ]
21 | },
22 | {
23 | className: 'attribute',
24 | begin: '^\\w', end: ': ', excludeEnd: true,
25 | illegal: '\\n',
26 | starts: {className: 'string', end: '$'}
27 | },
28 | {
29 | begin: '\\n\\n',
30 | starts: {subLanguage: '', endsWithParent: true}
31 | }
32 | ]
33 | }
34 | };
35 | };
--------------------------------------------------------------------------------
/src/documents/actions/expand-abbreviation/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Expand Abbreviation
4 | menuOrder: 1
5 | ---
6 | Expands [CSS-like abbreviations](/abbreviations/) into HTML/XML/CSS code, depending on current document’s syntax. Also performs other context actions, for example, transforms [CSS Gradient](/css-abbreviations/gradients/).
7 |
8 |
24 |
25 | Generated output contains a number of _tabstops_ and if your editor supports them (Eclipse, Sublime Text 2, Espresso etc) you can quickly traverse between them with Tab key.
26 |
27 | In some editors (Eclipse, Sublime Text 2, CodeMirror) “Expand Abbreviation” can be invoked with Tab key.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Official documentation site for Emmet toolkit
2 |
3 | Currently, the main web-site skeleton is finished (maybe a few bugs out there), and I’m currently writing documentation for Emmet toolkit. Documentation itself is located in `src/documents` folder.
4 |
5 | The web-site uses [DocPad](https://github.com/bevry/docpad) for static site generation.
6 |
7 | ## Local setup
8 |
9 | To run this web-site locally, you need the following dependencies:
10 |
11 | 1. Node.JS >= v0.6
12 | 2. NPM
13 | 3. DocPad installed globally: `npm install -g docpad`
14 |
15 | ### Running local web-site instance
16 |
17 | 1. Clone this repo (note that this project uses submodules, please use --recursive option) and go to the cloned folder
18 | 2. Run `npm install` to install all project local dependencies
19 | 3. Run `docpad run`. This command will build all JS & CSS assets, generate static HTML-page and set-up local web-server (usually http://localhost:9778/) where generated web-site can be viewed.
20 |
21 | Note that you should view the web-site _only_ with local web-server since generated pages contains absolute, cache-busted references to CSS and JS files.
22 |
--------------------------------------------------------------------------------
/src/documents/customization/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Customization
4 | menuOrder: 5
5 | ---
6 | Emmet offers wide range of tweaks you can use to fine-tune your plugin experience. Almost all officially developed editor plugins (except PSPad and browser-based) has **extensions support**: a special folder where you can put `json` and `js` files to extend Emmet. Please refer to README file bundled with your editor’s plugin to find out where Emmet looks for extensions.
7 |
8 | Each `.js` file located in extensions folder will be loaded and executed on plugin start-up. Use `js` files to create your own [filters](/filters/) or [actions](/actions/): you can use Emmet modules and bindings to script your editor with JavaScript.
9 |
10 | With `.json` files you can fine-tune different parts of Emmet toolkit:
11 |
12 |
13 |
[snippets.json](./snippets/)
14 |
Add your own or update existing snippets
15 |
[preferences.json](./preferences/)
16 |
Change behavior of some Emmet filters and actions
17 |
[syntaxProfiles.json](./syntax-profiles/)
18 |
Define how generated HTML/XML should look.
19 |
--------------------------------------------------------------------------------
/css/assets/_movie.css:
--------------------------------------------------------------------------------
1 | /* Simpe UI for CodeMirror Movie */
2 | @import url(../bootstrap/css/bootstrap.css);
3 |
4 | /* Splash screen */
5 | .CodeMirror-movie__splash {
6 | position: absolute;
7 | width: 100%;
8 | height: 100%;
9 | top: 0;
10 | left: 0;
11 | color: #000;
12 | background: #dfdfdf;
13 | background: rgba(215, 215, 215, 0.9);
14 | z-index: 10;
15 | cursor: pointer;
16 | }
17 |
18 | .CodeMirror-movie__splash:hover {
19 | color: #0088cc;
20 | }
21 |
22 | .CodeMirror-movie__splash-text {
23 | font-size: 4em;
24 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
25 | position: absolute;
26 | width: 100%;
27 | text-align: center;
28 | top: 50%;
29 | margin-top: -1.2em;
30 | line-height: 1em;
31 | }
32 |
33 | .CodeMirror-movie__splash-play-btn {
34 | display: inline-block;
35 | font-size: 1.5em;
36 | line-height: 1em;
37 | width: 1em;
38 | height: 1em;
39 | padding: 0.33em 0.2em 0.27em 0.4em;
40 | background: #fff;
41 | border-radius: 100%;
42 | vertical-align: middle;
43 | }
44 |
45 | /* Toolbar */
46 | .CodeMirror-movie__toolbar {
47 | margin-bottom: 10px;
48 | }
49 |
50 | .CodeMirror-movie__btn-try {
51 | float: right;
52 | }
--------------------------------------------------------------------------------
/src/documents/actions/toggle-comment/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Toggle Comment
4 | menuOrder: 6
5 | ---
6 | This action, as name says, toggle comment on selection. Almost all programmer’s text editors have such action, but this one works differently. When there’s no selection, editor’s action toggles comment on current line while Emmet’s one do this on _current context_. For HTML it’s a full tag, for CSS it’s a rule or full property.
7 |
8 |
28 |
--------------------------------------------------------------------------------
/src/documents/css-abbreviations/fuzzy-search/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Fuzzy search
4 | menuOrder: 3
5 | ---
6 | If you take a look at [Cheat Sheet](/cheat-sheet/), you’ll find that there are too many CSS snippets to remember. Also, some of them might be a bit lengthy for sake of logical separation.
7 |
8 | To make CSS writing a bit easier, Emmet implement _fuzzy search_ logic for CSS snippets: every time you enter unknown abbreviation, Emmet will try to find a closest snippet definition.
9 |
10 | For example, instead of writing `ov:h` (`overflow: hidden;`) abbreviation, you can write `ov-h`, `ovh` or even `oh`. You can play around with the fuzzy search in text editor below. Try to find as many variations as possible (use Tab key to expand abbreviations) for `bxz:cb`, `ovx:h` and `pos:a` snippets.
11 |
12 |
13 |
14 | The fuzzy search is performed against _predefined snippet names_, not snippet values or CSS properties. This results in more predictable and controllable matches. Remember that you can always [create your own snippets or redefine existing ones](/customization/) to fine-tune fuzzy search experience.
--------------------------------------------------------------------------------
/plugins/highlight.js/json.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | var LITERALS = {literal: 'true false null'};
3 | var TYPES = [
4 | hljs.QUOTE_STRING_MODE,
5 | hljs.C_NUMBER_MODE
6 | ];
7 | var VALUE_CONTAINER = {
8 | className: 'value',
9 | end: ',', endsWithParent: true, excludeEnd: true,
10 | contains: TYPES,
11 | keywords: LITERALS
12 | };
13 | var OBJECT = {
14 | begin: '{', end: '}',
15 | contains: [
16 | {
17 | className: 'attribute',
18 | begin: '\\s*"', end: '"\\s*:\\s*', excludeBegin: true, excludeEnd: true,
19 | contains: [hljs.BACKSLASH_ESCAPE],
20 | illegal: '\\n',
21 | starts: VALUE_CONTAINER
22 | }
23 | ],
24 | illegal: '\\S'
25 | };
26 | var ARRAY = {
27 | begin: '\\[', end: '\\]',
28 | contains: [hljs.inherit(VALUE_CONTAINER, {className: null})], // inherit is also a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents
29 | illegal: '\\S'
30 | };
31 | TYPES.splice(TYPES.length, 0, OBJECT, ARRAY);
32 | return {
33 | defaultMode: {
34 | contains: TYPES,
35 | keywords: LITERALS,
36 | illegal: '\\S'
37 | }
38 | };
39 | };
--------------------------------------------------------------------------------
/plugins/highlight.js/parser3.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | return {
3 | defaultMode: {
4 | subLanguage: 'xml',
5 | contains: [
6 | {
7 | className: 'comment',
8 | begin: '^#', end: '$'
9 | },
10 | {
11 | className: 'comment',
12 | begin: '\\^rem{', end: '}',
13 | relevance: 10,
14 | contains: [
15 | {
16 | begin: '{', end: '}',
17 | contains: ['self']
18 | }
19 | ]
20 | },
21 | {
22 | className: 'preprocessor',
23 | begin: '^@(?:BASE|USE|CLASS|OPTIONS)$',
24 | relevance: 10
25 | },
26 | {
27 | className: 'title',
28 | begin: '@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$'
29 | },
30 | {
31 | className: 'variable',
32 | begin: '\\$\\{?[\\w\\-\\.\\:]+\\}?'
33 | },
34 | {
35 | className: 'keyword',
36 | begin: '\\^[\\w\\-\\.\\:]+'
37 | },
38 | {
39 | className: 'number',
40 | begin: '\\^#[0-9a-fA-F]+'
41 | },
42 | hljs.C_NUMBER_MODE
43 | ]
44 | }
45 | };
46 | };
--------------------------------------------------------------------------------
/src/documents/actions/update-image-size/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Update Image Size
4 | menuOrder: 10
5 | ---
6 | Many web-developers forget to write _width_ and _height_ attributes for `` tags which leads to poor UX. This action helps you to automate this process: simply place caret inside `` tag and run this action to add/update width and height attributes.
7 |
8 | In CSS, place caret inside property value with `url()` function to add/update width and height properties for current rule.
9 |
10 |
28 |
29 | Note that this action also works for absolute URLs: it will start searching for requested file from host file’s folder and then will traverse up the tree.
--------------------------------------------------------------------------------
/js/lib/movie.js:
--------------------------------------------------------------------------------
1 | import EmmetCodemirror from 'emmet-codemirror';
2 | import CodeMirrorMovie from 'codemirror-movie';
3 | import CodeMirror from 'codemirror';
4 |
5 | import 'codemirror/mode/css/css.js';
6 | import 'codemirror/mode/xml/xml.js';
7 | import 'codemirror/mode/javascript/javascript.js';
8 | import 'codemirror/mode/htmlmixed/htmlmixed.js';
9 | import 'codemirror/addon/selection/active-line.js';
10 |
11 | var emmet = EmmetCodemirror.emmet;
12 | var EmmetEditor = EmmetCodemirror.EmmetEditor;
13 |
14 | EmmetCodemirror.setup(CodeMirror);
15 | window.CodeMirror = CodeMirror;
16 | window.emmet = emmet;
17 | // add 'revert' action to CodeMirror to restore original text and position
18 | CodeMirror.commands.revert = function(editor) {
19 | if (editor.__initial) {
20 | editor.setValue(editor.__initial.content);
21 | editor.setCursor(editor.__initial.pos);
22 | }
23 | };
24 |
25 | CodeMirror.commands.wrapWithAbbreviation = function(editor, abbr) {
26 | emmet.run('wrap_with_abbreviation', new EmmetEditor(editor), abbr);
27 | };
28 |
29 | EmmetCodemirror.defaultKeymap['Shift-Cmd-U'] = 'emmet.update_image_size';
30 | EmmetCodemirror.defaultKeymap['Shift-Cmd-I'] = 'emmet.encode_decode_data_url';
31 |
32 | export {CodeMirror, CodeMirrorMovie, EmmetCodemirror, emmet};
--------------------------------------------------------------------------------
/src/documents/abbreviations/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Abbreviations
4 | menuOrder: 1
5 | ---
6 | Abbreviations are the heart of the Emmet toolkit: these special expressions are parsed in runtime and transformed into structured code block, HTML for example. The abbreviation’s syntax looks like CSS selectors with a few extensions specific to code generation. So every web-developer already knows how to use it.
7 |
8 | Here’s an example: this abbreviation
9 |
10 | #page>div.logo+ul#navigation>li*5>a{Item $}
11 |
12 | ...can be transformed into
13 |
14 |
'`;
--------------------------------------------------------------------------------
/src/documents/abbreviations/implicit-names/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Implicit tag names
4 | menuOrder: 3
5 | ---
6 | Even with such a powerful abbreviation engine, which can expand large HTML structures from short abbreviation, writing tag names may be very tedious.
7 |
8 | In many cases you can skip typing tag names and Emmet will substitute it for you. For example, instead of `div.content` you can simply write `.content` and expand it into ``.
9 |
10 | ## How it works
11 |
12 | When you expand abbreviation, Emmet tries to grab parent context, e.g. the HTML element, inside which you’re expanding the abbreviation. If the context was grabbed successfully, Emmet uses its name to resolve implicit names:
13 |
14 |
43 |
44 | As you can see from the example above, Emmet looks at the parent tag name every time you’re expanding the abbreviation with an implicit name. Here’s how it resolves the names for some parent elements:
45 |
46 | * `li` for `ul` and `ol`
47 | * `tr` for `table`, `tbody`, `thead` and `tfoot`
48 | * `td` for `tr`
49 | * `option` for `select` and `optgroup`
50 |
51 | Take a look at some abbreviations equivalents with implicit and explicit tag names:
52 |
53 |
54 |
55 |
`.wrap>.content`
56 |
`div.wrap>div.content`
57 |
58 |
59 |
`em>.info`
60 |
`em>span.info`
61 |
62 |
63 |
`ul>.item*3`
64 |
`ul>li.item*3`
65 |
66 |
67 |
`table>#row$*4>[colspan=2]`
68 |
`table>tr#row$*4>td[colspan=2]`
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/plugins/highlight.js/python.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | var STRINGS = [
3 | {
4 | className: 'string',
5 | begin: '(u|b)?r?\'\'\'', end: '\'\'\'',
6 | relevance: 10
7 | },
8 | {
9 | className: 'string',
10 | begin: '(u|b)?r?"""', end: '"""',
11 | relevance: 10
12 | },
13 | {
14 | className: 'string',
15 | begin: '(u|r|ur)\'', end: '\'',
16 | contains: [hljs.BACKSLASH_ESCAPE],
17 | relevance: 10
18 | },
19 | {
20 | className: 'string',
21 | begin: '(u|r|ur)"', end: '"',
22 | contains: [hljs.BACKSLASH_ESCAPE],
23 | relevance: 10
24 | },
25 | {
26 | className: 'string',
27 | begin: '(b|br)\'', end: '\'',
28 | contains: [hljs.BACKSLASH_ESCAPE]
29 | },
30 | {
31 | className: 'string',
32 | begin: '(b|br)"', end: '"',
33 | contains: [hljs.BACKSLASH_ESCAPE]
34 | }
35 | ].concat([
36 | hljs.APOS_STRING_MODE,
37 | hljs.QUOTE_STRING_MODE
38 | ]);
39 | var TITLE = {
40 | className: 'title', begin: hljs.UNDERSCORE_IDENT_RE
41 | };
42 | var PARAMS = {
43 | className: 'params',
44 | begin: '\\(', end: '\\)',
45 | contains: ['self', hljs.C_NUMBER_MODE].concat(STRINGS)
46 | };
47 | var FUNC_CLASS_PROTO = {
48 | beginWithKeyword: true, end: ':',
49 | illegal: '[${=;\\n]',
50 | contains: [TITLE, PARAMS],
51 | relevance: 10
52 | };
53 |
54 | return {
55 | defaultMode: {
56 | keywords: {
57 | keyword:
58 | 'and elif is global as in if from raise for except finally print import pass return ' +
59 | 'exec else break not with class assert yield try while continue del or def lambda ' +
60 | 'nonlocal|10',
61 | built_in:
62 | 'None True False Ellipsis NotImplemented'
63 | },
64 | illegal: '(|->|\\?)',
65 | contains: STRINGS.concat([
66 | hljs.HASH_COMMENT_MODE,
67 | hljs.inherit(FUNC_CLASS_PROTO, {className: 'function', keywords: 'def'}),
68 | hljs.inherit(FUNC_CLASS_PROTO, {className: 'class', keywords: 'class'}),
69 | hljs.C_NUMBER_MODE,
70 | {
71 | className: 'decorator',
72 | begin: '@', end: '$'
73 | },
74 | {
75 | begin: '\\b(print|exec)\\(' // don’t highlight keywords-turned-functions in Python 3
76 | }
77 | ])
78 | }
79 | };
80 | };
--------------------------------------------------------------------------------
/plugins/highlight.js/lisp.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*';
3 | var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?';
4 | var LITERAL = {
5 | className: 'literal',
6 | begin: '\\b(t{1}|nil)\\b'
7 | };
8 | var NUMBERS = [
9 | {
10 | className: 'number', begin: LISP_SIMPLE_NUMBER_RE
11 | },
12 | {
13 | className: 'number', begin: '#b[0-1]+(/[0-1]+)?'
14 | },
15 | {
16 | className: 'number', begin: '#o[0-7]+(/[0-7]+)?'
17 | },
18 | {
19 | className: 'number', begin: '#x[0-9a-f]+(/[0-9a-f]+)?'
20 | },
21 | {
22 | className: 'number', begin: '#c\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'
23 | }
24 | ]
25 | var STRING = {
26 | className: 'string',
27 | begin: '"', end: '"',
28 | contains: [hljs.BACKSLASH_ESCAPE],
29 | relevance: 0
30 | };
31 | var COMMENT = {
32 | className: 'comment',
33 | begin: ';', end: '$'
34 | };
35 | var VARIABLE = {
36 | className: 'variable',
37 | begin: '\\*', end: '\\*'
38 | };
39 | var KEYWORD = {
40 | className: 'keyword',
41 | begin: '[:&]' + LISP_IDENT_RE
42 | };
43 | var QUOTED_LIST = {
44 | begin: '\\(', end: '\\)',
45 | contains: ['self', LITERAL, STRING].concat(NUMBERS)
46 | };
47 | var QUOTED1 = {
48 | className: 'quoted',
49 | begin: '[\'`]\\(', end: '\\)',
50 | contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
51 | };
52 | var QUOTED2 = {
53 | className: 'quoted',
54 | begin: '\\(quote ', end: '\\)',
55 | keywords: {title: 'quote'},
56 | contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
57 | };
58 | var LIST = {
59 | className: 'list',
60 | begin: '\\(', end: '\\)'
61 | };
62 | var BODY = {
63 | className: 'body',
64 | endsWithParent: true, excludeEnd: true
65 | };
66 | LIST.contains = [{className: 'title', begin: LISP_IDENT_RE}, BODY];
67 | BODY.contains = [QUOTED1, QUOTED2, LIST, LITERAL].concat(NUMBERS).concat([STRING, COMMENT, VARIABLE, KEYWORD]);
68 |
69 | return {
70 | case_insensitive: true,
71 | defaultMode: {
72 | illegal: '[^\\s]',
73 | contains: NUMBERS.concat([
74 | LITERAL,
75 | STRING,
76 | COMMENT,
77 | QUOTED1, QUOTED2,
78 | LIST
79 | ])
80 | }
81 | };
82 | };
--------------------------------------------------------------------------------
/src/documents/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: default
3 | title: Emmet Documentation
4 | ---
5 | # Emmet — the essential toolkit for web-developers #
6 |
7 | Emmet is a web-developer’s toolkit that can greatly improve your HTML & CSS workflow:
8 |
9 |
43 |
44 | Basically, most text editors out there allow you to store and re-use commonly used code chunks, called _“snippets”_. While snippets are a good way to boost your productivity, all implementations have common pitfalls: you have to define the snippet first and you can’t extend them in runtime.
45 |
46 | Emmet takes the snippets idea to a whole new level: you can type _CSS-like_ expressions that can be dynamically parsed, and produce output depending on what you type in the abbreviation. Emmet is developed and optimised for web-developers whose workflow depends on HTML/XML and CSS, but can be used with programming languages too.
47 |
48 | Start learning Emmet with the [abbreviation syntax](/abbreviations/) and available [actions](/actions/).
49 |
50 | Download plugin for your favourite editor
51 |
--------------------------------------------------------------------------------
/plugins/highlight.js/haskell.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | var TYPE = {
3 | className: 'type',
4 | begin: '\\b[A-Z][\\w\']*',
5 | relevance: 0
6 | };
7 | var CONTAINER = {
8 | className: 'container',
9 | begin: '\\(', end: '\\)',
10 | contains: [
11 | {className: 'type', begin: '\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?'},
12 | {className: 'title', begin: '[_a-z][\\w\']*'}
13 | ]
14 | };
15 | var CONTAINER2 = {
16 | className: 'container',
17 | begin: '{', end: '}',
18 | contains: CONTAINER.contains
19 | }
20 |
21 | return {
22 | defaultMode: {
23 | keywords:
24 | 'let in if then else case of where do module import hiding qualified type data ' +
25 | 'newtype deriving class instance not as foreign ccall safe unsafe',
26 | contains: [
27 | {
28 | className: 'comment',
29 | begin: '--', end: '$'
30 | },
31 | {
32 | className: 'preprocessor',
33 | begin: '{-#', end: '#-}'
34 | },
35 | {
36 | className: 'comment',
37 | contains: ['self'],
38 | begin: '{-', end: '-}'
39 | },
40 | {
41 | className: 'string',
42 | begin: '\\s+\'', end: '\'',
43 | contains: [hljs.BACKSLASH_ESCAPE],
44 | relevance: 0
45 | },
46 | hljs.QUOTE_STRING_MODE,
47 | {
48 | className: 'import',
49 | begin: '\\bimport', end: '$',
50 | keywords: 'import qualified as hiding',
51 | contains: [CONTAINER],
52 | illegal: '\\W\\.|;'
53 | },
54 | {
55 | className: 'module',
56 | begin: '\\bmodule', end: 'where',
57 | keywords: 'module where',
58 | contains: [CONTAINER],
59 | illegal: '\\W\\.|;'
60 | },
61 | {
62 | className: 'class',
63 | begin: '\\b(class|instance)', end: 'where',
64 | keywords: 'class where instance',
65 | contains: [TYPE]
66 | },
67 | {
68 | className: 'typedef',
69 | begin: '\\b(data|(new)?type)', end: '$',
70 | keywords: 'data type newtype deriving',
71 | contains: [TYPE, CONTAINER, CONTAINER2]
72 | },
73 | hljs.C_NUMBER_MODE,
74 | {
75 | className: 'shebang',
76 | begin: '#!\\/usr\\/bin\\/env\ runhaskell', end: '$'
77 | },
78 | TYPE,
79 | {
80 | className: 'title', begin: '^[_a-z][\\w\']*'
81 | }
82 | ]
83 | }
84 | };
85 | };
--------------------------------------------------------------------------------
/src/documents/css-abbreviations/gradients/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Gradients
4 | menuOrder: 2
5 | ---
6 | Another hard-to-write CSS3 feature is a gradient. You have to repeat long gradient definition multiple times with different vendor prefixes. Also, if you want to cover all gradient-supported browsers, you have to use three different notations: old Webkit, currently supported (`linear-gradient(top, ...)`) and W3C-proposed (`linear-gradient(to bottom, ...)`).
7 |
8 | Usually, users prefere to use third-party GUIs to generate gradients definitions, but you can do the very same thing much faster right in your editor.
9 |
10 | Emmet has a CSS3 Gradient Generator that can do all the hard work for you:
11 |
12 |
41 |
42 | As you can see from the example above, you can type regular gradient definition as `lg(...)` (or `linear-gradient(...)`) function and expand it as an abbreviation. If you write the gradient definition as a property value, Emmet will parse it and use its name as a reference for new CSS properties.
43 |
44 | ## Fallback value
45 |
46 | In preferences, you can enable `css.gradient.fallback` option to produce a fallback `background-color` CSS property whenever a gradient definition for `background-*` CSS property is expanded. This fallback property will contain a first color from gradient definition.
47 |
48 | This option is off by default because it produces a `background-color` value that almost certainly needs to be manually updated to make sure that content is readable on this background. If you don’t really care about old browsers, you can enable this option.
--------------------------------------------------------------------------------
/gulpfile.js:
--------------------------------------------------------------------------------
1 | var fs = require('fs');
2 | var path = require('path');
3 | var gulp = require('gulp');
4 | var through = require('through2');
5 | var jsBundler = require('js-bundler');
6 | var minifyCSS = require('gulp-minify-css');
7 | var gzip = require('gulp-gzip');
8 | var htmlTransform = require('html-transform');
9 |
10 | var srcOptions = {base: './'};
11 | var outPath = './out';
12 | var production = process.argv.indexOf('--production') !== -1;
13 |
14 | function np(file) {
15 | return path.resolve(path.join('node_modules', file));
16 | }
17 |
18 | gulp.task('js', function() {
19 | return gulp.src('./js/*.js', srcOptions)
20 | .pipe(jsBundler({
21 | uglify: production,
22 | sourceMap: !production,
23 | noParse: [
24 | np('codemirror-movie/dist/movie.js'),
25 | np('emmet-codemirror/dist/emmet.js'),
26 | np('codemirror/lib/codemirror.js')
27 | ]
28 | }))
29 | .pipe(gulp.dest(outPath));
30 | });
31 |
32 | gulp.task('css', function() {
33 | return gulp.src('./css/*.css', srcOptions)
34 | .pipe(minifyCSS({processImport: true}))
35 | .pipe(gulp.dest(outPath))
36 | });
37 |
38 | gulp.task('html', ['static'], function(next) {
39 | return gulp.src('./out/**/*.html')
40 | .pipe(htmlTransform({
41 | transformUrl: function(url, file, ctx) {
42 | if (ctx.stats) {
43 | url = '/-/' + ctx.stats.hash + url;
44 | }
45 | return url;
46 | },
47 | mode: 'xhtml',
48 | transform: function() {
49 | return through.obj(function(file, enc, next) {
50 | findScripNodes(file.dom).forEach(function(node) {
51 | // replace & with & since CarbonAds can’t hane entities
52 | node.attribs.src = node.attribs.src.replace(/&/g, '&');
53 | });
54 | next(null, file);
55 | });
56 | }
57 | }))
58 | .pipe(gulp.dest('./out'));
59 | });
60 |
61 | gulp.task('full', ['html'], function() {
62 | return gulp.src('./out/**/*.{html,css,js,ico}')
63 | .pipe(gzip({
64 | threshold: '1kb',
65 | gzipOptions: {level: 7}
66 | }))
67 | .pipe(gulp.dest(outPath));
68 | });
69 |
70 | gulp.task('watch', function() {
71 | jsBundler.watch({sourceMap: true, uglify: false});
72 | gulp.watch('./css/**/*.css', ['css']);
73 | gulp.watch('./js/**/*.js', ['js']);
74 | });
75 |
76 | gulp.task('static', ['css', 'js']);
77 | gulp.task('default', ['static']);
78 |
79 | function findScripNodes(nodes, out) {
80 | out = out || [];
81 | nodes.forEach(function(node) {
82 | if (/^script$/i.test(node.name || '') && node.attribs.src) {
83 | out.push(node)
84 | }
85 |
86 | if (node.children) {
87 | findScripNodes(node.children, out);
88 | }
89 | });
90 |
91 | return out;
92 | }
--------------------------------------------------------------------------------
/plugins/highlight.js/actionscript.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
3 | var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
4 |
5 | var AS3_REST_ARG_MODE = {
6 | className: 'rest_arg',
7 | begin: '[.]{3}', end: IDENT_RE,
8 | relevance: 10
9 | };
10 | var TITLE_MODE = {className: 'title', begin: IDENT_RE};
11 |
12 | return {
13 | defaultMode: {
14 | keywords: {
15 | keyword: 'as break case catch class const continue default delete do dynamic each ' +
16 | 'else extends final finally for function get if implements import in include ' +
17 | 'instanceof interface internal is namespace native new override package private ' +
18 | 'protected public return set static super switch this throw try typeof use var void ' +
19 | 'while with',
20 | literal: 'true false null undefined'
21 | },
22 | contains: [
23 | hljs.APOS_STRING_MODE,
24 | hljs.QUOTE_STRING_MODE,
25 | hljs.C_LINE_COMMENT_MODE,
26 | hljs.C_BLOCK_COMMENT_MODE,
27 | hljs.C_NUMBER_MODE,
28 | {
29 | className: 'package',
30 | beginWithKeyword: true, end: '{',
31 | keywords: 'package',
32 | contains: [TITLE_MODE]
33 | },
34 | {
35 | className: 'class',
36 | beginWithKeyword: true, end: '{',
37 | keywords: 'class interface',
38 | contains: [
39 | {
40 | beginWithKeyword: true,
41 | keywords: 'extends implements'
42 | },
43 | TITLE_MODE
44 | ]
45 | },
46 | {
47 | className: 'preprocessor',
48 | beginWithKeyword: true, end: ';',
49 | keywords: 'import include'
50 | },
51 | {
52 | className: 'function',
53 | beginWithKeyword: true, end: '[{;]',
54 | keywords: 'function',
55 | illegal: '\\S',
56 | contains: [
57 | TITLE_MODE,
58 | {
59 | className: 'params',
60 | begin: '\\(', end: '\\)',
61 | contains: [
62 | hljs.APOS_STRING_MODE,
63 | hljs.QUOTE_STRING_MODE,
64 | hljs.C_LINE_COMMENT_MODE,
65 | hljs.C_BLOCK_COMMENT_MODE,
66 | AS3_REST_ARG_MODE
67 | ]
68 | },
69 | {
70 | className: 'type',
71 | begin: ':',
72 | end: IDENT_FUNC_RETURN_TYPE_RE,
73 | relevance: 10
74 | }
75 | ]
76 | }
77 | ]
78 | }
79 | }
80 | };
--------------------------------------------------------------------------------
/css/main.css:
--------------------------------------------------------------------------------
1 | @import url(assets/_normalize.css);
2 | @import url(assets/_highlight.css);
3 | @import url(assets/_preferences.css);
4 |
5 | /* CodeMirror Movie */
6 | @import url(assets/_movie.css);
7 | @import url(../node_modules/codemirror/lib/codemirror.css);
8 | @import url(../node_modules/codemirror-movie/dist/movie.css);
9 |
10 | @import url(assets/_layout.css);
11 |
12 | .CodeMirror {
13 | font-size: 12px;
14 | background: #f5f5f5;
15 | border: 1px solid #e3e3e3;
16 | }
17 |
18 | .CodeMirror-movie {
19 | margin-bottom: 20px;
20 | position: relative;
21 | }
22 |
23 | .CodeMirror-scroll {
24 | background: #fff;
25 | }
26 |
27 | .CodeMirror-activeline-background {
28 | right: -30px;
29 | }
30 |
31 | .CodeMirror-movie_with-outline .CodeMirror-scroll {
32 | margin-right: 25%;
33 | }
34 |
35 | .CodeMirror-movie_with-outline .CodeMirror-vscrollbar {
36 | right: 25%;
37 | }
38 |
39 | .CodeMirror-outline {
40 | width: 25%;
41 | font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
42 | }
43 |
44 | .CodeMirror-tooltip strong {
45 | color: #fff;
46 | }
47 |
48 | .bsa-cpc {
49 | position: absolute;
50 | top: 15px;
51 | width: 100%;
52 | }
53 |
54 | .bsa-cpc #_default_ {
55 | position: relative;
56 | margin-bottom: 1em;
57 | padding: .5em 1em;
58 | border: dashed 1px hsl(0, 0%, 90%);
59 | background-color: #f8f8f8;
60 | font-size: 13px;
61 | line-height: 1.5;
62 | }
63 |
64 | .bsa-cpc a {
65 | font-weight: 400;
66 | }
67 |
68 | .bsa-cpc .default-ad {
69 | display: none;
70 | }
71 |
72 | .bsa-cpc ._default_ {
73 | display: inline;
74 | overflow: hidden;
75 | line-height: 1.5;
76 | }
77 |
78 | .bsa-cpc ._default_> * {
79 | vertical-align: middle;
80 | }
81 |
82 | .bsa-cpc a {
83 | color: inherit;
84 | text-decoration: none;
85 | }
86 |
87 | .bsa-cpc a:hover {
88 | color: inherit;
89 | }
90 |
91 | .bsa-cpc .default-image {
92 | display: none;
93 | }
94 |
95 | .bsa-cpc .default-title:after {
96 | content: " — ";
97 | }
98 |
99 | .bsa-cpc .default-title,
100 | .bsa-cpc .default-description {
101 | display: inline;
102 | }
103 |
104 | .bsa-cpc .default-title {
105 | position: relative;
106 | margin-left: 8px;
107 | }
108 |
109 | .bsa-cpc .default-title:before {
110 | position: relative;
111 | top: -1px;
112 | left: -8px;
113 | padding: 2px 5px;
114 | background: #4caf50;
115 | border-radius: 3px;
116 | color: #ffffff;
117 | content: "Sponsor";
118 | text-transform: uppercase;
119 | font-size: 10px;
120 | font-family: Verdana, sans-serif;
121 | line-height: 1;
122 | }
123 |
124 |
--------------------------------------------------------------------------------
/plugins/highlight.js/matlab.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | return {
3 | defaultMode: {
4 | keywords: {
5 | keyword:
6 | 'break case catch classdef continue else elseif end enumerated events for function ' +
7 | 'global if methods otherwise parfor persistent properties return spmd switch try while',
8 | built_in:
9 | 'sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan ' +
10 | 'atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot ' +
11 | 'cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog ' +
12 | 'realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal ' +
13 | 'cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli ' +
14 | 'besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma ' +
15 | 'gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms ' +
16 | 'nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones ' +
17 | 'eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ' +
18 | 'ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril ' +
19 | 'triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute ' +
20 | 'shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan ' +
21 | 'isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal ' +
22 | 'rosser toeplitz vander wilkinson'
23 | },
24 | illegal: '(//|"|#|/\\*|\\s+/\\w+)',
25 | contains: [
26 | {
27 | className: 'function',
28 | beginWithKeyword: true, end: '$',
29 | keywords: 'function',
30 | contains: [
31 | {
32 | className: 'title',
33 | begin: hljs.UNDERSCORE_IDENT_RE
34 | },
35 | {
36 | className: 'params',
37 | begin: '\\(', end: '\\)'
38 | },
39 | {
40 | className: 'params',
41 | begin: '\\[', end: '\\]'
42 | }
43 | ]
44 | },
45 | {
46 | className: 'string',
47 | begin: '\'', end: '\'',
48 | contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
49 | relevance: 0
50 | },
51 | {
52 | className: 'comment',
53 | begin: '\\%', end: '$'
54 | },
55 | hljs.C_NUMBER_MODE
56 | ]
57 | }
58 | };
59 | };
--------------------------------------------------------------------------------
/src/documents/actions/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: Actions
4 | menuOrder: 3
5 | ---
6 | Emmet allows you to write large HTML code blocks at speed of light using well-known CSS selectors. But it’s not the only thing that every web-developer needs: occasionally you have to _edit_ your HTML and CSS code to fix bugs and add new features.
7 |
8 | Emmet offers very unique tools that can greatly improve your editing experience:
9 |
10 |
11 |
[Expand Abbreviation](./expand-abbreviation/)
12 |
Yep, this is _the_ action that expands CSS-like abbreviations into HTML code.
13 |
14 |
[Match Tag Pair](./match-pair/)
15 |
Selects content, and/or opening and closing HTML tag name from current caret position (a.k.a “balancing”). Super-awesome implementation that _works even in non-HTML syntaxes_! Implicitly used by many Emmet actions.
16 |
17 |
[Go to Matching Pair](./go-to-pair/)
18 |
Quickly traverses between opening and closing HTML tag.
19 |
20 |
[Wrap with Abbreviation](./wrap-with-abbreviation/)
21 |
Same as “Expand Abbreviation” action but intelligently wraps selected content.
22 |
23 |
[Go to Edit Point](./go-to-edit-point/)
24 |
Quickly traverse between important HTML code points.
25 |
26 |
[Select Item](./select-item/)
27 |
Quickly select important HTML and CSS code parts.
28 |
29 |
[Toggle Comment](./toggle-comment/)
30 |
Toggles comment. Unlike basic editor’s implementations, matches HTML tag, CSS property or rule when there’s no selection.
31 |
32 |
[Split/Join Tag](./split-join-tag/)
33 |
Splits (`` → ``) or joins (`` → ``) HTML/XML tag under current caret position.
34 |
35 |
[Remove Tag](./remove-tag/)
36 |
Gracefully removes HTML/XML tag under current caret position.
37 |
38 |
[Merge Lines](./merge-lines/)
39 |
Merges selected lines into single one. With no selection, automatically matches nearest HTML tag.
40 |
41 |
[Update Image Size](./update-image-size/)
42 |
Updates matched HTML tag or CSS rule with image size, located under caret.
43 |
44 |
[Evaluate Math Expression](./evaluate-math/)
45 |
Evaluates simple math expression
46 |
47 |
[Increment/Decrement Number](./inc-dec-number/)
48 |
Increments or decrements number under current caret position with given step.
49 |
50 |
[Reflect CSS Value](./reflect-css-value/)
51 |
Automatically copies CSS value under current caret position to all vendor-prefixed variants.
52 |
53 |
[Encode/Decode Image to data:URL](./base64/)
54 |
Encodes image under caret to data:URL format and vice versa.
55 |
56 |
--------------------------------------------------------------------------------
/plugins/highlight.js/nginx.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | var VARS = [
3 | {
4 | className: 'variable', begin: '\\$\\d+'
5 | },
6 | {
7 | className: 'variable', begin: '\\${', end: '}'
8 | },
9 | {
10 | className: 'variable', begin: '[\\$\\@]' + hljs.UNDERSCORE_IDENT_RE
11 | }
12 | ];
13 | var DEFAULT = {
14 | endsWithParent: true,
15 | lexems: '[a-z/_]+',
16 | keywords: {
17 | built_in:
18 | 'on off yes no true false none blocked debug info notice warn error crit ' +
19 | 'select break last permanent redirect kqueue rtsig epoll poll /dev/poll'
20 | },
21 | relevance: 0,
22 | illegal: '=>',
23 | contains: [
24 | hljs.HASH_COMMENT_MODE,
25 | {
26 | className: 'string',
27 | begin: '"', end: '"',
28 | contains: [hljs.BACKSLASH_ESCAPE].concat(VARS),
29 | relevance: 0
30 | },
31 | {
32 | className: 'string',
33 | begin: "'", end: "'",
34 | contains: [hljs.BACKSLASH_ESCAPE].concat(VARS),
35 | relevance: 0
36 | },
37 | {
38 | className: 'url',
39 | begin: '([a-z]+):/', end: '\\s', endsWithParent: true, excludeEnd: true
40 | },
41 | {
42 | className: 'regexp',
43 | begin: "\\s\\^", end: "\\s|{|;", returnEnd: true,
44 | contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
45 | },
46 | // regexp locations (~, ~*)
47 | {
48 | className: 'regexp',
49 | begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: true,
50 | contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
51 | },
52 | // *.example.com
53 | {
54 | className: 'regexp',
55 | begin: "\\*(\\.[a-z\\-]+)+",
56 | contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
57 | },
58 | // sub.example.*
59 | {
60 | className: 'regexp',
61 | begin: "([a-z\\-]+\\.)+\\*",
62 | contains: [hljs.BACKSLASH_ESCAPE].concat(VARS)
63 | },
64 | // IP
65 | {
66 | className: 'number',
67 | begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b'
68 | },
69 | // units
70 | {
71 | className: 'number',
72 | begin: '\\b\\d+[kKmMgGdshdwy]*\\b',
73 | relevance: 0
74 | }
75 | ].concat(VARS)
76 | };
77 |
78 | return {
79 | defaultMode: {
80 | contains: [
81 | hljs.HASH_COMMENT_MODE,
82 | {
83 | begin: hljs.UNDERSCORE_IDENT_RE + '\\s', end: ';|{', returnBegin: true,
84 | contains: [
85 | {
86 | className: 'title',
87 | begin: hljs.UNDERSCORE_IDENT_RE,
88 | starts: DEFAULT
89 | }
90 | ]
91 | }
92 | ],
93 | illegal: '[^\\s\\}]'
94 | }
95 | };
96 | };
--------------------------------------------------------------------------------
/src/documents/abbreviations/lorem-ipsum/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: page
3 | title: “Lorem Ipsum” generator
4 | menuOrder: 4
5 | ---
6 | [“Lorem ipsum”](http://www.lipsum.com) dummy text is used by many web-developers to test how their HTML templates will look with real data. Often, developers use third-party services to generate “Lorem ipsum” text, but now you can do that right in your editor. Just expand `lorem` or `lipsum` abbreviations to get the following snippet:
7 |
8 | Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eligendi non quis exercitationem culpa nesciunt nihil aut nostrum explicabo reprehenderit optio amet ab temporibus asperiores quasi cupiditate. Voluptatum ducimus voluptates voluptas?
9 |
10 | `lorem` is not just a normal snippet—it’s actually a _generator_. Every time you expand it, it will generate a 30-words dummy text, splitted into a few sentences.
11 |
12 | You can specify how many words should be generated right in the abbreviation. For example, `lorem100` will generate a 100-words dummy text.
13 |
14 | ## Repeated “Lorem ipsum”
15 |
16 | You can use `lorem` generator inside repeated elements to create tags filled with completely random sentences. For example, `p*4>lorem` abbreviation would generate something like this:
17 |
18 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Qui dicta minus molestiae vel beatae natus eveniet ratione temporibus aperiam harum alias officiis assumenda officia quibusdam deleniti eos cupiditate dolore doloribus!
19 |
Ad dolore dignissimos asperiores dicta facere optio quod commodi nam tempore recusandae. Rerum sed nulla eum vero expedita ex delectus voluptates rem at neque quos facere sequi unde optio aliquam!
20 |
Tenetur quod quidem in voluptatem corporis dolorum dicta sit pariatur porro quaerat autem ipsam odit quam beatae tempora quibusdam illum! Modi velit odio nam nulla unde amet odit pariatur at!
21 |
Consequatur rerum amet fuga expedita sunt et tempora saepe? Iusto nihil explicabo perferendis quos provident delectus ducimus necessitatibus reiciendis optio tempora unde earum doloremque commodi laudantium ad nulla vel odio?
22 |
23 | Also, `lorem` generator utilizes the [implicit tag name resolver](/abbreviations/implicit-names/) when `lorem` element is self-repeated so you can shorten your abbreviations:
24 |
25 | `ul.generic-list>lorem10.item*4`
26 |
27 | ...will produce
28 |
29 |
30 |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam vero.
31 |
Laboriosam quaerat sapiente minima nam minus similique illum architecto et!
32 |
Incidunt vitae quae facere ducimus nostrum aliquid dolorum veritatis dicta!
33 |
Tenetur laborum quod cum excepturi recusandae porro sint quas soluta!