├── LICENSE ├── README.md ├── asciidoc.css ├── asciidoc.js ├── cm ├── LICENSE ├── lib │ ├── codemirror.css │ └── codemirror.js └── mode │ └── asciidoc │ └── asciidoc.js ├── index.html └── opal.js /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (C) 2014 Thaddée Tyl . 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Parts from . 24 | 25 | Copyright (C) 2013 Dan Allen 26 | 27 | Permission is hereby granted, free of charge, to any person obtaining a copy 28 | of this software and associated documentation files (the "Software"), to deal 29 | in the Software without restriction, including without limitation the rights 30 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 31 | copies of the Software, and to permit persons to whom the Software is 32 | furnished to do so, subject to the following conditions: 33 | 34 | The above copyright notice and this permission notice shall be included in 35 | all copies or substantial portions of the Software. 36 | 37 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 39 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 40 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 42 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 43 | THE SOFTWARE. 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Live AsciiDoc Editor 2 | 3 | Edit AsciiDoc live in your browser. 4 | 5 | This project is front-end only, so that all you need to do is open `index.html` 6 | in your browser and start writing! 7 | 8 | Released under the MIT license. 9 | 10 | Parts from . 11 | Portions of the ace2cm project used to provide the CodeMirror mode are covered 12 | by the BSD license of the Ace project. 13 | Find the license here: . 14 | -------------------------------------------------------------------------------- /asciidoc.css: -------------------------------------------------------------------------------- 1 | /* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */ 2 | article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } 3 | audio, canvas, video { display: inline-block; } 4 | audio:not([controls]) { display: none; height: 0; } 5 | [hidden], template { display: none; } 6 | script { display: none !important; } 7 | html { font-family: sans-serif; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } 8 | body { margin: 0; } 9 | a { background: transparent; } 10 | a:focus { outline: thin dotted; } 11 | a:active, a:hover { outline: 0; } 12 | h1 { font-size: 2em; margin: 0.67em 0; } 13 | abbr[title] { border-bottom: 1px dotted; } 14 | b, strong { font-weight: bold; } 15 | dfn { font-style: italic; } 16 | hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; } 17 | mark { background: #ff0; color: #000; } 18 | code, kbd, pre, samp { font-family: monospace, serif; font-size: 1em; } 19 | pre { white-space: pre-wrap; } 20 | q { quotes: "\201C" "\201D" "\2018" "\2019"; } 21 | small { font-size: 80%; } 22 | sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } 23 | sup { top: -0.5em; } 24 | sub { bottom: -0.25em; } 25 | img { border: 0; } 26 | svg:not(:root) { overflow: hidden; } 27 | figure { margin: 0; } 28 | fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } 29 | legend { border: 0; padding: 0; } 30 | button, input, select, textarea { font-family: inherit; font-size: 100%; margin: 0; } 31 | button, input { line-height: normal; } 32 | button, select { text-transform: none; } 33 | button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; cursor: pointer; } 34 | button[disabled], html input[disabled] { cursor: default; } 35 | input[type="checkbox"], input[type="radio"] { box-sizing: border-box; padding: 0; } 36 | input[type="search"] { -webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box; } 37 | input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } 38 | button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } 39 | textarea { overflow: auto; vertical-align: top; } 40 | table { border-collapse: collapse; border-spacing: 0; } 41 | meta.foundation-mq-small { font-family: "only screen and (min-width: 768px)"; width: 768px; } 42 | meta.foundation-mq-medium { font-family: "only screen and (min-width:1280px)"; width: 1280px; } 43 | meta.foundation-mq-large { font-family: "only screen and (min-width:1440px)"; width: 1440px; } 44 | *, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } 45 | html, body { font-size: 100%; } 46 | body { background: white; color: #222222; padding: 0; margin: 0; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-weight: normal; font-style: normal; line-height: 1; position: relative; cursor: auto; } 47 | a:hover { cursor: pointer; } 48 | img, object, embed { max-width: 100%; height: auto; } 49 | object, embed { height: 100%; } 50 | img { -ms-interpolation-mode: bicubic; } 51 | #map_canvas img, #map_canvas embed, #map_canvas object, .map_canvas img, .map_canvas embed, .map_canvas object { max-width: none !important; } 52 | .left { float: left !important; } 53 | .right { float: right !important; } 54 | .text-left { text-align: left !important; } 55 | .text-right { text-align: right !important; } 56 | .text-center { text-align: center !important; } 57 | .text-justify { text-align: justify !important; } 58 | .hide { display: none; } 59 | .antialiased, body { -webkit-font-smoothing: antialiased; } 60 | img { display: inline-block; vertical-align: middle; } 61 | textarea { height: auto; min-height: 50px; } 62 | select { width: 100%; } 63 | p.lead, .paragraph.lead > p, #preamble > .sectionbody > .paragraph:first-of-type p { font-size: 1.21875em; line-height: 1.6; } 64 | .subheader, #content #toctitle, .admonitionblock td.content > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .mathblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, .sidebarblock > .title, .tableblock > .title, .verseblock > .title, .videoblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title, .tableblock > caption { line-height: 1.4; color: #7a2518; font-weight: 300; margin-top: 0.2em; margin-bottom: 0.5em; } 65 | div, dl, dt, dd, ul, ol, li, h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6, pre, form, p, blockquote, th, td { margin: 0; padding: 0; direction: ltr; } 66 | a { color: #005498; text-decoration: underline; line-height: inherit; } 67 | a:hover, a:focus { color: #00467f; } 68 | a img { border: none; } 69 | p { font-family: inherit; font-weight: normal; font-size: 1em; line-height: 1.6; margin-bottom: 1.25em; text-rendering: optimizeLegibility; } 70 | p aside { font-size: 0.875em; line-height: 1.35; font-style: italic; } 71 | h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { font-family: Georgia, "URW Bookman L", Helvetica, Arial, sans-serif; font-weight: normal; font-style: normal; color: #ba3925; text-rendering: optimizeLegibility; margin-top: 1em; margin-bottom: 0.5em; line-height: 1.2125em; } 72 | h1 small, h2 small, h3 small, #toctitle small, .sidebarblock > .content > .title small, h4 small, h5 small, h6 small { font-size: 60%; color: #e99b8f; line-height: 0; } 73 | h1 { font-size: 2.125em; } 74 | h2 { font-size: 1.6875em; } 75 | h3, #toctitle, .sidebarblock > .content > .title { font-size: 1.375em; } 76 | h4 { font-size: 1.125em; } 77 | h5 { font-size: 1.125em; } 78 | h6 { font-size: 1em; } 79 | hr { border: solid #dddddd; border-width: 1px 0 0; clear: both; margin: 1.25em 0 1.1875em; height: 0; } 80 | em, i { font-style: italic; line-height: inherit; } 81 | strong, b { font-weight: bold; line-height: inherit; } 82 | small { font-size: 60%; line-height: inherit; } 83 | code { font-family: Consolas, "Liberation Mono", Courier, monospace; font-weight: normal; color: #6d180b; } 84 | ul, ol, dl { font-size: 1em; line-height: 1.6; margin-bottom: 1.25em; list-style-position: outside; font-family: inherit; } 85 | ul, ol { margin-left: 1.5em; } 86 | ul.no-bullet, ol.no-bullet { margin-left: 1.5em; } 87 | ul li ul, ul li ol { margin-left: 1.25em; margin-bottom: 0; font-size: 1em; } 88 | ul.square li ul, ul.circle li ul, ul.disc li ul { list-style: inherit; } 89 | ul.square { list-style-type: square; } 90 | ul.circle { list-style-type: circle; } 91 | ul.disc { list-style-type: disc; } 92 | ul.no-bullet { list-style: none; } 93 | ol li ul, ol li ol { margin-left: 1.25em; margin-bottom: 0; } 94 | dl dt { margin-bottom: 0.3125em; font-weight: bold; } 95 | dl dd { margin-bottom: 1.25em; } 96 | abbr, acronym { text-transform: uppercase; font-size: 90%; color: #222222; border-bottom: 1px dotted #dddddd; cursor: help; } 97 | abbr { text-transform: none; } 98 | blockquote { margin: 0 0 1.25em; padding: 0.5625em 1.25em 0 1.1875em; border-left: 1px solid #dddddd; } 99 | blockquote cite { display: block; font-size: inherit; color: #555555; } 100 | blockquote cite:before { content: "\2014 \0020"; } 101 | blockquote cite a, blockquote cite a:visited { color: #555555; } 102 | blockquote, blockquote p { line-height: 1.6; color: #6f6f6f; } 103 | .vcard { display: inline-block; margin: 0 0 1.25em 0; border: 1px solid #dddddd; padding: 0.625em 0.75em; } 104 | .vcard li { margin: 0; display: block; } 105 | .vcard .fn { font-weight: bold; font-size: 0.9375em; } 106 | .vevent .summary { font-weight: bold; } 107 | .vevent abbr { cursor: auto; text-decoration: none; font-weight: bold; border: none; padding: 0 0.0625em; } 108 | @media only screen and (min-width: 768px) { h1, h2, h3, #toctitle, .sidebarblock > .content > .title, h4, h5, h6 { line-height: 1.4; } 109 | h1 { font-size: 2.75em; } 110 | h2 { font-size: 2.3125em; } 111 | h3, #toctitle, .sidebarblock > .content > .title { font-size: 1.6875em; } 112 | h4 { font-size: 1.4375em; } } 113 | .print-only { display: none !important; } 114 | @media print { * { background: transparent !important; color: #000 !important; box-shadow: none !important; text-shadow: none !important; } 115 | a, a:visited { text-decoration: underline; } 116 | a[href]:after { content: " (" attr(href) ")"; } 117 | abbr[title]:after { content: " (" attr(title) ")"; } 118 | .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } 119 | pre, blockquote { border: 1px solid #999; page-break-inside: avoid; } 120 | thead { display: table-header-group; } 121 | tr, img { page-break-inside: avoid; } 122 | img { max-width: 100% !important; } 123 | @page { margin: 0.5cm; } 124 | p, h2, h3, #toctitle, .sidebarblock > .content > .title { orphans: 3; widows: 3; } 125 | h2, h3, #toctitle, .sidebarblock > .content > .title { page-break-after: avoid; } 126 | .hide-on-print { display: none !important; } 127 | .print-only { display: block !important; } 128 | .hide-for-print { display: none !important; } 129 | .show-for-print { display: inherit !important; } } 130 | table { background: white; margin-bottom: 1.25em; border: solid 1px #dddddd; } 131 | table thead, table tfoot { background: whitesmoke; font-weight: bold; } 132 | table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td { padding: 0.5em 0.625em 0.625em; font-size: inherit; color: #222222; text-align: left; } 133 | table tr th, table tr td { padding: 0.5625em 0.625em; font-size: inherit; color: #222222; } 134 | table tr.even, table tr.alt, table tr:nth-of-type(even) { background: #f9f9f9; } 135 | table thead tr th, table tfoot tr th, table tbody tr td, table tr td, table tfoot tr td { display: table-cell; line-height: 1.6; } 136 | .clearfix:before, .clearfix:after, .float-group:before, .float-group:after { content: " "; display: table; } 137 | .clearfix:after, .float-group:after { clear: both; } 138 | *:not(pre) > code { font-size: 0.9375em; padding: 1px 3px 0; white-space: nowrap; background-color: #f2f2f2; border: 1px solid #cccccc; -webkit-border-radius: 4px; border-radius: 4px; text-shadow: none; } 139 | pre, pre > code { line-height: 1.4; color: inherit; font-family: Consolas, "Liberation Mono", Courier, monospace; font-weight: normal; } 140 | kbd.keyseq { color: #555555; } 141 | kbd:not(.keyseq) { display: inline-block; color: #222222; font-size: 0.75em; line-height: 1.4; background-color: #F7F7F7; border: 1px solid #ccc; -webkit-border-radius: 3px; border-radius: 3px; -webkit-box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 0 2px white inset; margin: -0.15em 0.15em 0 0.15em; padding: 0.2em 0.6em 0.2em 0.5em; vertical-align: middle; white-space: nowrap; } 142 | kbd kbd:first-child { margin-left: 0; } 143 | kbd kbd:last-child { margin-right: 0; } 144 | .menuseq, .menu { color: #090909; } 145 | b.button:before { content: '[ '; } 146 | b.button:after { content: ' ]'; } 147 | p a > code:hover { color: #561309; } 148 | #header, #content, #footnotes, #footer { width: 100%; margin-left: auto; margin-right: auto; margin-top: 0; margin-bottom: 0; max-width: 62.5em; *zoom: 1; position: relative; padding-left: 0.9375em; padding-right: 0.9375em; } 149 | #header:before, #header:after, #content:before, #content:after, #footnotes:before, #footnotes:after, #footer:before, #footer:after { content: " "; display: table; } 150 | #header:after, #content:after, #footnotes:after, #footer:after { clear: both; } 151 | #header { margin-bottom: 2.5em; } 152 | #header > h1 { color: black; font-weight: normal; border-bottom: 1px solid #dddddd; margin-bottom: -28px; padding-bottom: 32px; } 153 | #header span { color: #6f6f6f; } 154 | #header #revnumber { text-transform: capitalize; } 155 | #header br { display: none; } 156 | #header br + span { padding-left: 3px; } 157 | #header br + span:before { content: "\2013 \0020"; } 158 | #header br + span.author { padding-left: 0; } 159 | #header br + span.author:before { content: ", "; } 160 | #toc { border-bottom: 3px double #ebebeb; padding-bottom: 1.25em; } 161 | #toc > ul { margin-left: 0.25em; } 162 | #toc ul.sectlevel0 > li > a { font-style: italic; } 163 | #toc ul.sectlevel0 ul.sectlevel1 { margin-left: 0; margin-top: 0.5em; margin-bottom: 0.5em; } 164 | #toc ul { list-style-type: none; } 165 | #toctitle { color: #7a2518; } 166 | @media only screen and (min-width: 768px) { body.toc2 { padding-left: 15em; padding-right: 0; } 167 | #toc.toc2 { position: fixed; width: 15em; left: 0; top: 0; border-right: 1px solid #ebebeb; border-bottom: 0; z-index: 1000; padding: 1em; height: 100%; overflow: auto; } 168 | #toc.toc2 #toctitle { margin-top: 0; font-size: 1.2em; } 169 | #toc.toc2 > ul { font-size: .90em; } 170 | #toc.toc2 ul ul { margin-left: 0; padding-left: 1em; } 171 | #toc.toc2 ul.sectlevel0 ul.sectlevel1 { padding-left: 0; margin-top: 0.5em; margin-bottom: 0.5em; } 172 | body.toc2.toc-right { padding-left: 0; padding-right: 15em; } 173 | body.toc2.toc-right #toc.toc2 { border-right: 0; border-left: 1px solid #ebebeb; left: auto; right: 0; } } 174 | @media only screen and (min-width: 1280px) { body.toc2 { padding-left: 20em; padding-right: 0; } 175 | #toc.toc2 { width: 20em; } 176 | #toc.toc2 #toctitle { font-size: 1.375em; } 177 | #toc.toc2 > ul { font-size: 0.95em; } 178 | #toc.toc2 ul ul { padding-left: 1.25em; } 179 | body.toc2.toc-right { padding-left: 0; padding-right: 20em; } } 180 | #content #toc { border-style: solid; border-width: 1px; border-color: #d9d9d9; margin-bottom: 1.25em; padding: 1.25em; background: #f2f2f2; border-width: 0; -webkit-border-radius: 4px; border-radius: 4px; } 181 | #content #toc > :first-child { margin-top: 0; } 182 | #content #toc > :last-child { margin-bottom: 0; } 183 | #content #toc a { text-decoration: none; } 184 | #content #toctitle { font-weight: bold; font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif; font-size: 1em; padding-left: 0.125em; } 185 | #footer { max-width: 100%; background-color: #222222; padding: 1.25em; } 186 | #footer-text { color: #dddddd; line-height: 1.44; } 187 | .sect1 { padding-bottom: 1.25em; } 188 | .sect1 + .sect1 { border-top: 3px double #ebebeb; } 189 | #content h1 > a.anchor, h2 > a.anchor, h3 > a.anchor, #toctitle > a.anchor, .sidebarblock > .content > .title > a.anchor, h4 > a.anchor, h5 > a.anchor, h6 > a.anchor { position: absolute; width: 1em; margin-left: -1em; display: block; text-decoration: none; visibility: hidden; text-align: center; font-weight: normal; } 190 | #content h1 > a.anchor:before, h2 > a.anchor:before, h3 > a.anchor:before, #toctitle > a.anchor:before, .sidebarblock > .content > .title > a.anchor:before, h4 > a.anchor:before, h5 > a.anchor:before, h6 > a.anchor:before { content: '\00A7'; font-size: .85em; vertical-align: text-top; display: block; margin-top: 0.05em; } 191 | #content h1:hover > a.anchor, #content h1 > a.anchor:hover, h2:hover > a.anchor, h2 > a.anchor:hover, h3:hover > a.anchor, #toctitle:hover > a.anchor, .sidebarblock > .content > .title:hover > a.anchor, h3 > a.anchor:hover, #toctitle > a.anchor:hover, .sidebarblock > .content > .title > a.anchor:hover, h4:hover > a.anchor, h4 > a.anchor:hover, h5:hover > a.anchor, h5 > a.anchor:hover, h6:hover > a.anchor, h6 > a.anchor:hover { visibility: visible; } 192 | #content h1 > a.link, h2 > a.link, h3 > a.link, #toctitle > a.link, .sidebarblock > .content > .title > a.link, h4 > a.link, h5 > a.link, h6 > a.link { color: #ba3925; text-decoration: none; } 193 | #content h1 > a.link:hover, h2 > a.link:hover, h3 > a.link:hover, #toctitle > a.link:hover, .sidebarblock > .content > .title > a.link:hover, h4 > a.link:hover, h5 > a.link:hover, h6 > a.link:hover { color: #a53221; } 194 | .imageblock, .literalblock, .listingblock, .mathblock, .verseblock, .videoblock { margin-bottom: 1.25em; } 195 | .admonitionblock td.content > .title, .exampleblock > .title, .imageblock > .title, .listingblock > .title, .literalblock > .title, .mathblock > .title, .openblock > .title, .paragraph > .title, .quoteblock > .title, .sidebarblock > .title, .tableblock > .title, .verseblock > .title, .videoblock > .title, .dlist > .title, .olist > .title, .ulist > .title, .qlist > .title, .hdlist > .title { text-align: left; font-weight: bold; } 196 | .tableblock > caption { text-align: left; font-weight: bold; white-space: nowrap; overflow: visible; max-width: 0; } 197 | table.tableblock #preamble > .sectionbody > .paragraph:first-of-type p { font-size: inherit; } 198 | .admonitionblock > table { border: 0; background: none; width: 100%; } 199 | .admonitionblock > table td.icon { text-align: center; width: 80px; } 200 | .admonitionblock > table td.icon img { max-width: none; } 201 | .admonitionblock > table td.icon .title { font-weight: bold; text-transform: uppercase; } 202 | .admonitionblock > table td.content { padding-left: 1.125em; padding-right: 1.25em; border-left: 1px solid #dddddd; color: #6f6f6f; } 203 | .admonitionblock > table td.content > :last-child > :last-child { margin-bottom: 0; } 204 | .exampleblock > .content { border-style: solid; border-width: 1px; border-color: #e6e6e6; margin-bottom: 1.25em; padding: 1.25em; background: white; -webkit-border-radius: 4px; border-radius: 4px; } 205 | .exampleblock > .content > :first-child { margin-top: 0; } 206 | .exampleblock > .content > :last-child { margin-bottom: 0; } 207 | .exampleblock > .content h1, .exampleblock > .content h2, .exampleblock > .content h3, .exampleblock > .content #toctitle, .sidebarblock.exampleblock > .content > .title, .exampleblock > .content h4, .exampleblock > .content h5, .exampleblock > .content h6, .exampleblock > .content p { color: #333333; } 208 | .exampleblock > .content h1, .exampleblock > .content h2, .exampleblock > .content h3, .exampleblock > .content #toctitle, .sidebarblock.exampleblock > .content > .title, .exampleblock > .content h4, .exampleblock > .content h5, .exampleblock > .content h6 { line-height: 1; margin-bottom: 0.625em; } 209 | .exampleblock > .content h1.subheader, .exampleblock > .content h2.subheader, .exampleblock > .content h3.subheader, .exampleblock > .content .subheader#toctitle, .sidebarblock.exampleblock > .content > .subheader.title, .exampleblock > .content h4.subheader, .exampleblock > .content h5.subheader, .exampleblock > .content h6.subheader { line-height: 1.4; } 210 | .exampleblock.result > .content { -webkit-box-shadow: 0 1px 8px #d9d9d9; box-shadow: 0 1px 8px #d9d9d9; } 211 | .sidebarblock { border-style: solid; border-width: 1px; border-color: #d9d9d9; margin-bottom: 1.25em; padding: 1.25em; background: #f2f2f2; -webkit-border-radius: 4px; border-radius: 4px; } 212 | .sidebarblock > :first-child { margin-top: 0; } 213 | .sidebarblock > :last-child { margin-bottom: 0; } 214 | .sidebarblock h1, .sidebarblock h2, .sidebarblock h3, .sidebarblock #toctitle, .sidebarblock > .content > .title, .sidebarblock h4, .sidebarblock h5, .sidebarblock h6, .sidebarblock p { color: #333333; } 215 | .sidebarblock h1, .sidebarblock h2, .sidebarblock h3, .sidebarblock #toctitle, .sidebarblock > .content > .title, .sidebarblock h4, .sidebarblock h5, .sidebarblock h6 { line-height: 1; margin-bottom: 0.625em; } 216 | .sidebarblock h1.subheader, .sidebarblock h2.subheader, .sidebarblock h3.subheader, .sidebarblock .subheader#toctitle, .sidebarblock > .content > .subheader.title, .sidebarblock h4.subheader, .sidebarblock h5.subheader, .sidebarblock h6.subheader { line-height: 1.4; } 217 | .sidebarblock > .content > .title { color: #7a2518; margin-top: 0; line-height: 1.6; } 218 | .exampleblock > .content > :last-child > :last-child, .exampleblock > .content .olist > ol > li:last-child > :last-child, .exampleblock > .content .ulist > ul > li:last-child > :last-child, .exampleblock > .content .qlist > ol > li:last-child > :last-child, .sidebarblock > .content > :last-child > :last-child, .sidebarblock > .content .olist > ol > li:last-child > :last-child, .sidebarblock > .content .ulist > ul > li:last-child > :last-child, .sidebarblock > .content .qlist > ol > li:last-child > :last-child { margin-bottom: 0; } 219 | .literalblock pre:not([class]), .listingblock pre:not([class]) { background: none; } 220 | .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { border-width: 1px 0; border-style: dotted; border-color: #bfbfbf; -webkit-border-radius: 4px; border-radius: 4px; padding: 0.75em 0.75em 0.5em 0.75em; word-wrap: break-word; } 221 | .literalblock pre.nowrap, .literalblock pre[class].nowrap, .listingblock pre.nowrap, .listingblock pre[class].nowrap { overflow-x: auto; white-space: pre; word-wrap: normal; } 222 | .literalblock pre > code, .literalblock pre[class] > code, .listingblock pre > code, .listingblock pre[class] > code { display: block; } 223 | @media only screen { .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { font-size: 0.8em; } } 224 | @media only screen and (min-width: 768px) { .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { font-size: 0.9em; } } 225 | @media only screen and (min-width: 1280px) { .literalblock pre, .literalblock pre[class], .listingblock pre, .listingblock pre[class] { font-size: 1em; } } 226 | .listingblock pre.highlight { padding: 0; } 227 | .listingblock pre.highlight > code { padding: 0.75em 0.75em 0.5em 0.75em; } 228 | .listingblock > .content { position: relative; } 229 | .listingblock:hover code[class*=" language-"]:before { text-transform: uppercase; font-size: 0.9em; color: #999; position: absolute; top: 0.375em; right: 0.375em; } 230 | .listingblock:hover code.asciidoc:before { content: "asciidoc"; } 231 | .listingblock:hover code.clojure:before { content: "clojure"; } 232 | .listingblock:hover code.css:before { content: "css"; } 233 | .listingblock:hover code.groovy:before { content: "groovy"; } 234 | .listingblock:hover code.html:before { content: "html"; } 235 | .listingblock:hover code.java:before { content: "java"; } 236 | .listingblock:hover code.javascript:before { content: "javascript"; } 237 | .listingblock:hover code.python:before { content: "python"; } 238 | .listingblock:hover code.ruby:before { content: "ruby"; } 239 | .listingblock:hover code.sass:before { content: "sass"; } 240 | .listingblock:hover code.scss:before { content: "scss"; } 241 | .listingblock:hover code.xml:before { content: "xml"; } 242 | .listingblock:hover code.yaml:before { content: "yaml"; } 243 | .listingblock.terminal pre .command:before { content: attr(data-prompt); padding-right: 0.5em; color: #999; } 244 | .listingblock.terminal pre .command:not([data-prompt]):before { content: '$'; } 245 | table.pyhltable { border: 0; margin-bottom: 0; } 246 | table.pyhltable td { vertical-align: top; padding-top: 0; padding-bottom: 0; } 247 | table.pyhltable td.code { padding-left: .75em; padding-right: 0; } 248 | .highlight.pygments .lineno, table.pyhltable td:not(.code) { color: #999; padding-left: 0; padding-right: .5em; border-right: 1px solid #dddddd; } 249 | .highlight.pygments .lineno { display: inline-block; margin-right: .25em; } 250 | table.pyhltable .linenodiv { background-color: transparent !important; padding-right: 0 !important; } 251 | .quoteblock { margin: 0 0 1.25em; padding: 0.5625em 1.25em 0 1.1875em; border-left: 1px solid #dddddd; } 252 | .quoteblock blockquote { margin: 0 0 1.25em 0; padding: 0 0 0.5625em 0; border: 0; } 253 | .quoteblock blockquote > .paragraph:last-child p { margin-bottom: 0; } 254 | .quoteblock .attribution { margin-top: -.25em; padding-bottom: 0.5625em; font-size: inherit; color: #555555; } 255 | .quoteblock .attribution br { display: none; } 256 | .quoteblock .attribution cite { display: block; margin-bottom: 0.625em; } 257 | table thead th, table tfoot th { font-weight: bold; } 258 | table.tableblock.grid-all { border-collapse: separate; border-spacing: 1px; -webkit-border-radius: 4px; border-radius: 4px; border-top: 1px solid #dddddd; border-bottom: 1px solid #dddddd; } 259 | table.tableblock.frame-topbot, table.tableblock.frame-none { border-left: 0; border-right: 0; } 260 | table.tableblock.frame-sides, table.tableblock.frame-none { border-top: 0; border-bottom: 0; } 261 | table.tableblock td .paragraph:last-child p > p:last-child, table.tableblock th > p:last-child, table.tableblock td > p:last-child { margin-bottom: 0; } 262 | th.tableblock.halign-left, td.tableblock.halign-left { text-align: left; } 263 | th.tableblock.halign-right, td.tableblock.halign-right { text-align: right; } 264 | th.tableblock.halign-center, td.tableblock.halign-center { text-align: center; } 265 | th.tableblock.valign-top, td.tableblock.valign-top { vertical-align: top; } 266 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { vertical-align: bottom; } 267 | th.tableblock.valign-middle, td.tableblock.valign-middle { vertical-align: middle; } 268 | tbody tr th { display: table-cell; line-height: 1.6; background: whitesmoke; } 269 | tbody tr th, tbody tr th p, tfoot tr th, tfoot tr th p { color: #222222; font-weight: bold; } 270 | td > div.verse { white-space: pre; } 271 | ol { margin-left: 1.75em; } 272 | ul li ol { margin-left: 1.5em; } 273 | dl dd { margin-left: 1.125em; } 274 | dl dd:last-child, dl dd:last-child > :last-child { margin-bottom: 0; } 275 | ol > li p, ul > li p, ul dd, ol dd, .olist .olist, .ulist .ulist, .ulist .olist, .olist .ulist { margin-bottom: 0.625em; } 276 | ul.unstyled, ol.unnumbered, ul.checklist, ul.none { list-style-type: none; } 277 | ul.unstyled, ol.unnumbered, ul.checklist { margin-left: 0.625em; } 278 | ul.checklist li > p:first-child > i[class^="icon-check"]:first-child, ul.checklist li > p:first-child > input[type="checkbox"]:first-child { margin-right: 0.25em; } 279 | ul.checklist li > p:first-child > input[type="checkbox"]:first-child { position: relative; top: 1px; } 280 | ul.inline { margin: 0 auto 0.625em auto; margin-left: -1.375em; margin-right: 0; padding: 0; list-style: none; overflow: hidden; } 281 | ul.inline > li { list-style: none; float: left; margin-left: 1.375em; display: block; } 282 | ul.inline > li > * { display: block; } 283 | .unstyled dl dt { font-weight: normal; font-style: normal; } 284 | ol.arabic { list-style-type: decimal; } 285 | ol.decimal { list-style-type: decimal-leading-zero; } 286 | ol.loweralpha { list-style-type: lower-alpha; } 287 | ol.upperalpha { list-style-type: upper-alpha; } 288 | ol.lowerroman { list-style-type: lower-roman; } 289 | ol.upperroman { list-style-type: upper-roman; } 290 | ol.lowergreek { list-style-type: lower-greek; } 291 | .hdlist > table, .colist > table { border: 0; background: none; } 292 | .hdlist > table > tbody > tr, .colist > table > tbody > tr { background: none; } 293 | td.hdlist1 { padding-right: .8em; font-weight: bold; } 294 | td.hdlist1, td.hdlist2 { vertical-align: top; } 295 | .literalblock + .colist, .listingblock + .colist { margin-top: -0.5em; } 296 | .colist > table tr > td:first-of-type { padding: 0 .8em; line-height: 1; } 297 | .colist > table tr > td:last-of-type { padding: 0.25em 0; } 298 | .qanda > ol > li > p > em:only-child { color: #00467f; } 299 | .thumb, .th { line-height: 0; display: inline-block; border: solid 4px white; -webkit-box-shadow: 0 0 0 1px #dddddd; box-shadow: 0 0 0 1px #dddddd; } 300 | .imageblock.left, .imageblock[style*="float: left"] { margin: 0.25em 0.625em 1.25em 0; } 301 | .imageblock.right, .imageblock[style*="float: right"] { margin: 0.25em 0 1.25em 0.625em; } 302 | .imageblock > .title { margin-bottom: 0; } 303 | .imageblock.thumb, .imageblock.th { border-width: 6px; } 304 | .imageblock.thumb > .title, .imageblock.th > .title { padding: 0 0.125em; } 305 | .image.left, .image.right { margin-top: 0.25em; margin-bottom: 0.25em; display: inline-block; line-height: 0; } 306 | .image.left { margin-right: 0.625em; } 307 | .image.right { margin-left: 0.625em; } 308 | a.image { text-decoration: none; } 309 | span.footnote, span.footnoteref { vertical-align: super; font-size: 0.875em; } 310 | span.footnote a, span.footnoteref a { text-decoration: none; } 311 | #footnotes { padding-top: 0.75em; padding-bottom: 0.75em; margin-bottom: 0.625em; } 312 | #footnotes hr { width: 20%; min-width: 6.25em; margin: -.25em 0 .75em 0; border-width: 1px 0 0 0; } 313 | #footnotes .footnote { padding: 0 0.375em; line-height: 1.3; font-size: 0.875em; margin-left: 1.2em; text-indent: -1.2em; margin-bottom: .2em; } 314 | #footnotes .footnote a:first-of-type { font-weight: bold; text-decoration: none; } 315 | #footnotes .footnote:last-of-type { margin-bottom: 0; } 316 | #content #footnotes { margin-top: -0.625em; margin-bottom: 0; padding: 0.75em 0; } 317 | .gist .file-data > table { border: none; background: #fff; width: 100%; margin-bottom: 0; } 318 | .gist .file-data > table td.line-data { width: 99%; } 319 | div.unbreakable { page-break-inside: avoid; } 320 | .big { font-size: larger; } 321 | .small { font-size: smaller; } 322 | .underline { text-decoration: underline; } 323 | .overline { text-decoration: overline; } 324 | .line-through { text-decoration: line-through; } 325 | .aqua { color: #00bfbf; } 326 | .aqua-background { background-color: #00fafa; } 327 | .black { color: black; } 328 | .black-background { background-color: black; } 329 | .blue { color: #0000bf; } 330 | .blue-background { background-color: #0000fa; } 331 | .fuchsia { color: #bf00bf; } 332 | .fuchsia-background { background-color: #fa00fa; } 333 | .gray { color: #606060; } 334 | .gray-background { background-color: #7d7d7d; } 335 | .green { color: #006000; } 336 | .green-background { background-color: #007d00; } 337 | .lime { color: #00bf00; } 338 | .lime-background { background-color: #00fa00; } 339 | .maroon { color: #600000; } 340 | .maroon-background { background-color: #7d0000; } 341 | .navy { color: #000060; } 342 | .navy-background { background-color: #00007d; } 343 | .olive { color: #606000; } 344 | .olive-background { background-color: #7d7d00; } 345 | .purple { color: #600060; } 346 | .purple-background { background-color: #7d007d; } 347 | .red { color: #bf0000; } 348 | .red-background { background-color: #fa0000; } 349 | .silver { color: #909090; } 350 | .silver-background { background-color: #bcbcbc; } 351 | .teal { color: #006060; } 352 | .teal-background { background-color: #007d7d; } 353 | .white { color: #bfbfbf; } 354 | .white-background { background-color: #fafafa; } 355 | .yellow { color: #bfbf00; } 356 | .yellow-background { background-color: #fafa00; } 357 | span.icon > [class^="icon-"], span.icon > [class*=" icon-"] { cursor: default; } 358 | .admonitionblock td.icon [class^="icon-"]:before { font-size: 2.5em; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); cursor: default; } 359 | .admonitionblock td.icon .icon-note:before { content: "\f05a"; color: #005498; color: #003f72; } 360 | .admonitionblock td.icon .icon-tip:before { content: "\f0eb"; text-shadow: 1px 1px 2px rgba(155, 155, 0, 0.8); color: #111; } 361 | .admonitionblock td.icon .icon-warning:before { content: "\f071"; color: #bf6900; } 362 | .admonitionblock td.icon .icon-caution:before { content: "\f06d"; color: #bf3400; } 363 | .admonitionblock td.icon .icon-important:before { content: "\f06a"; color: #bf0000; } 364 | .conum { display: inline-block; color: white !important; background-color: #222222; -webkit-border-radius: 100px; border-radius: 100px; text-align: center; width: 20px; height: 20px; font-size: 12px; font-weight: bold; line-height: 20px; font-family: Arial, sans-serif; font-style: normal; position: relative; top: -2px; letter-spacing: -1px; } 365 | .conum * { color: white !important; } 366 | .conum + b { display: none; } 367 | .conum:after { content: attr(data-value); } 368 | .conum:not([data-value]):empty { display: none; } 369 | .literalblock > .content > pre, .listingblock > .content > pre { -webkit-border-radius: 0; border-radius: 0; } 370 | 371 | -------------------------------------------------------------------------------- /cm/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 by Marijn Haverbeke and others 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /cm/lib/codemirror.css: -------------------------------------------------------------------------------- 1 | /* BASICS */ 2 | 3 | .CodeMirror { 4 | /* Set height, width, borders, and global font properties here */ 5 | font-family: monospace; 6 | height: 300px; 7 | } 8 | .CodeMirror-scroll { 9 | /* Set scrolling behaviour here */ 10 | overflow: auto; 11 | } 12 | 13 | /* PADDING */ 14 | 15 | .CodeMirror-lines { 16 | padding: 4px 0; /* Vertical padding around content */ 17 | } 18 | .CodeMirror pre { 19 | padding: 0 4px; /* Horizontal padding of content */ 20 | } 21 | 22 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 23 | background-color: white; /* The little square between H and V scrollbars */ 24 | } 25 | 26 | /* GUTTER */ 27 | 28 | .CodeMirror-gutters { 29 | border-right: 1px solid #ddd; 30 | background-color: #f7f7f7; 31 | white-space: nowrap; 32 | } 33 | .CodeMirror-linenumbers {} 34 | .CodeMirror-linenumber { 35 | padding: 0 3px 0 5px; 36 | min-width: 20px; 37 | text-align: right; 38 | color: #999; 39 | } 40 | 41 | /* CURSOR */ 42 | 43 | .CodeMirror div.CodeMirror-cursor { 44 | border-left: 1px solid black; 45 | z-index: 3; 46 | } 47 | /* Shown when moving in bi-directional text */ 48 | .CodeMirror div.CodeMirror-secondarycursor { 49 | border-left: 1px solid silver; 50 | } 51 | .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { 52 | width: auto; 53 | border: 0; 54 | background: #7e7; 55 | z-index: 1; 56 | } 57 | /* Can style cursor different in overwrite (non-insert) mode */ 58 | .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} 59 | 60 | .cm-tab { display: inline-block; } 61 | 62 | /* DEFAULT THEME */ 63 | 64 | .cm-s-default .cm-keyword {color: #708;} 65 | .cm-s-default .cm-atom {color: #219;} 66 | .cm-s-default .cm-number {color: #164;} 67 | .cm-s-default .cm-def {color: #00f;} 68 | .cm-s-default .cm-variable {color: black;} 69 | .cm-s-default .cm-variable-2 {color: #05a;} 70 | .cm-s-default .cm-variable-3 {color: #085;} 71 | .cm-s-default .cm-property {color: black;} 72 | .cm-s-default .cm-operator {color: black;} 73 | .cm-s-default .cm-comment {color: #a50;} 74 | .cm-s-default .cm-string {color: #a11;} 75 | .cm-s-default .cm-string-2 {color: #f50;} 76 | .cm-s-default .cm-meta {color: #555;} 77 | .cm-s-default .cm-qualifier {color: #555;} 78 | .cm-s-default .cm-builtin {color: #30a;} 79 | .cm-s-default .cm-bracket {color: #997;} 80 | .cm-s-default .cm-tag {color: #170;} 81 | .cm-s-default .cm-attribute {color: #00c;} 82 | .cm-s-default .cm-header {color: blue;} 83 | .cm-s-default .cm-quote {color: #090;} 84 | .cm-s-default .cm-hr {color: #999;} 85 | .cm-s-default .cm-link {color: #00c;} 86 | 87 | .cm-negative {color: #d44;} 88 | .cm-positive {color: #292;} 89 | .cm-header, .cm-strong {font-weight: bold;} 90 | .cm-em {font-style: italic;} 91 | .cm-link {text-decoration: underline;} 92 | 93 | .cm-s-default .cm-error {color: #f00;} 94 | .cm-invalidchar {color: #f00;} 95 | 96 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} 97 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} 98 | .CodeMirror-activeline-background {background: #e8f2ff;} 99 | 100 | /* STOP */ 101 | 102 | /* The rest of this file contains styles related to the mechanics of 103 | the editor. You probably shouldn't touch them. */ 104 | 105 | .CodeMirror { 106 | line-height: 1; 107 | position: relative; 108 | overflow: hidden; 109 | background: white; 110 | color: black; 111 | } 112 | 113 | .CodeMirror-scroll { 114 | /* 30px is the magic margin used to hide the element's real scrollbars */ 115 | /* See overflow: hidden in .CodeMirror */ 116 | margin-bottom: -30px; margin-right: -30px; 117 | padding-bottom: 30px; padding-right: 30px; 118 | height: 100%; 119 | outline: none; /* Prevent dragging from highlighting the element */ 120 | position: relative; 121 | -moz-box-sizing: content-box; 122 | box-sizing: content-box; 123 | } 124 | .CodeMirror-sizer { 125 | position: relative; 126 | } 127 | 128 | /* The fake, visible scrollbars. Used to force redraw during scrolling 129 | before actuall scrolling happens, thus preventing shaking and 130 | flickering artifacts. */ 131 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 132 | position: absolute; 133 | z-index: 6; 134 | display: none; 135 | } 136 | .CodeMirror-vscrollbar { 137 | right: 0; top: 0; 138 | overflow-x: hidden; 139 | overflow-y: scroll; 140 | } 141 | .CodeMirror-hscrollbar { 142 | bottom: 0; left: 0; 143 | overflow-y: hidden; 144 | overflow-x: scroll; 145 | } 146 | .CodeMirror-scrollbar-filler { 147 | right: 0; bottom: 0; 148 | } 149 | .CodeMirror-gutter-filler { 150 | left: 0; bottom: 0; 151 | } 152 | 153 | .CodeMirror-gutters { 154 | position: absolute; left: 0; top: 0; 155 | padding-bottom: 30px; 156 | z-index: 3; 157 | } 158 | .CodeMirror-gutter { 159 | white-space: normal; 160 | height: 100%; 161 | -moz-box-sizing: content-box; 162 | box-sizing: content-box; 163 | padding-bottom: 30px; 164 | margin-bottom: -32px; 165 | display: inline-block; 166 | /* Hack to make IE7 behave */ 167 | *zoom:1; 168 | *display:inline; 169 | } 170 | .CodeMirror-gutter-elt { 171 | position: absolute; 172 | cursor: default; 173 | z-index: 4; 174 | } 175 | 176 | .CodeMirror-lines { 177 | cursor: text; 178 | } 179 | .CodeMirror pre { 180 | /* Reset some styles that the rest of the page might have set */ 181 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; 182 | border-width: 0; 183 | background: transparent; 184 | font-family: inherit; 185 | font-size: inherit; 186 | margin: 0; 187 | white-space: pre; 188 | word-wrap: normal; 189 | line-height: inherit; 190 | color: inherit; 191 | z-index: 2; 192 | position: relative; 193 | overflow: visible; 194 | } 195 | .CodeMirror-wrap pre { 196 | word-wrap: break-word; 197 | white-space: pre-wrap; 198 | word-break: normal; 199 | } 200 | .CodeMirror-code pre { 201 | border-right: 30px solid transparent; 202 | width: -webkit-fit-content; 203 | width: -moz-fit-content; 204 | width: fit-content; 205 | } 206 | .CodeMirror-wrap .CodeMirror-code pre { 207 | border-right: none; 208 | width: auto; 209 | } 210 | .CodeMirror-linebackground { 211 | position: absolute; 212 | left: 0; right: 0; top: 0; bottom: 0; 213 | z-index: 0; 214 | } 215 | 216 | .CodeMirror-linewidget { 217 | position: relative; 218 | z-index: 2; 219 | overflow: auto; 220 | } 221 | 222 | .CodeMirror-widget {} 223 | 224 | .CodeMirror-wrap .CodeMirror-scroll { 225 | overflow-x: hidden; 226 | } 227 | 228 | .CodeMirror-measure { 229 | position: absolute; 230 | width: 100%; 231 | height: 0; 232 | overflow: hidden; 233 | visibility: hidden; 234 | } 235 | .CodeMirror-measure pre { position: static; } 236 | 237 | .CodeMirror div.CodeMirror-cursor { 238 | position: absolute; 239 | visibility: hidden; 240 | border-right: none; 241 | width: 0; 242 | } 243 | .CodeMirror-focused div.CodeMirror-cursor { 244 | visibility: visible; 245 | } 246 | 247 | .CodeMirror-selected { background: #d9d9d9; } 248 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } 249 | 250 | .cm-searching { 251 | background: #ffa; 252 | background: rgba(255, 255, 0, .4); 253 | } 254 | 255 | /* IE7 hack to prevent it from returning funny offsetTops on the spans */ 256 | .CodeMirror span { *vertical-align: text-bottom; } 257 | 258 | @media print { 259 | /* Hide the cursor when printing */ 260 | .CodeMirror div.CodeMirror-cursor { 261 | visibility: hidden; 262 | } 263 | } 264 | -------------------------------------------------------------------------------- /cm/mode/asciidoc/asciidoc.js: -------------------------------------------------------------------------------- 1 | // Parts from Ace; see 2 | CodeMirror.defineMode("asciidoc", function(cmCfg, modeCfg) { 3 | 4 | // Ace highlight rules function imported below. 5 | var HighlightRules = function() { 6 | var identifierRe = "[a-zA-Z\u00a1-\uffff]+\\b"; 7 | 8 | this.$rules = { 9 | "start": [ 10 | {token: "empty", regex: /$/}, 11 | {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, 12 | {token: "literal", regex: /^-{4,}\s*$/, next: "literalBlock"}, 13 | {token: "string", regex: /^\+{4,}\s*$/, next: "passthroughBlock"}, 14 | {token: "keyword", regex: /^={4,}\s*$/}, 15 | {token: "text", regex: /^\s*$/}, 16 | // immediately return to the start mode without matching anything 17 | {token: "empty", regex: "", next: "dissallowDelimitedBlock"} 18 | ], 19 | 20 | "dissallowDelimitedBlock": [ 21 | {include: "paragraphEnd"}, 22 | {token: "comment", regex: '^//.+$'}, 23 | {token: "keyword", regex: "^(?:NOTE|TIP|IMPORTANT|WARNING|CAUTION):"}, 24 | 25 | {include: "listStart"}, 26 | {token: "literal", regex: /^\s+.+$/, next: "indentedBlock"}, 27 | {token: "empty", regex: "", next: "text"} 28 | ], 29 | 30 | "paragraphEnd": [ 31 | {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "commentBlock"}, 32 | {token: "tableBlock", regex: /^\s*[|!]=+\s*$/, next: "tableBlock"}, 33 | // open block, ruller 34 | {token: "keyword", regex: /^(?:--|''')\s*$/, next: "start"}, 35 | {token: "option", regex: /^\[.*\]\s*$/, next: "start"}, 36 | {token: "pageBreak", regex: /^>{3,}$/, next: "start"}, 37 | {token: "literal", regex: /^\.{4,}\s*$/, next: "listingBlock"}, 38 | {token: "titleUnderline", regex: /^(?:={2,}|-{2,}|~{2,}|\^{2,}|\+{2,})\s*$/, next: "start"}, 39 | {token: "singleLineTitle", regex: /^={1,5}\s+\S.*$/, next: "start"}, 40 | 41 | {token: "otherBlock", regex: /^(?:\*{2,}|_{2,})\s*$/, next: "start"}, 42 | // .optional title 43 | {token: "optionalTitle", regex: /^\.[^.\s].+$/, next: "start"} 44 | ], 45 | 46 | "listStart": [ 47 | {token: "keyword", regex: /^\s*(?:\d+\.|[a-zA-Z]\.|[ixvmIXVM]+\)|\*{1,5}|-|\.{1,5})\s/, next: "listText"}, 48 | {token: "meta.tag", regex: /^.+(?::{2,4}|;;)(?: |$)/, next: "listText"}, 49 | {token: "support.function.list.callout", regex: /^(?:<\d+>|\d+>|>) /, next: "text"}, 50 | // continuation 51 | {token: "keyword", regex: /^\+\s*$/, next: "start"} 52 | ], 53 | 54 | "text": [ 55 | {token: ["link", "variable.language"], regex: /((?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+)(\[.*?\])/}, 56 | {token: "link", regex: /(?:https?:\/\/|ftp:\/\/|file:\/\/|mailto:|callto:)[^\s\[]+/}, 57 | {token: "link", regex: /\b[\w\.\/\-]+@[\w\.\/\-]+\b/}, 58 | {include: "macros"}, 59 | {include: "paragraphEnd"}, 60 | {token: "literal", regex:/\+{3,}/, next:"smallPassthrough"}, 61 | {token: "escape", regex: /\((?:C|TM|R)\)|\.{3}|->|<-|=>|<=|&#(?:\d+|x[a-fA-F\d]+);|(?: |^)--(?=\s+\S)/}, 62 | {token: "escape", regex: /\\[_*'`+#]|\\{2}[_*'`+#]{2}/}, 63 | {token: "keyword", regex: /\s\+$/}, 64 | // any word 65 | {token: "text", regex: identifierRe}, 66 | {token: ["keyword", "string", "keyword"], 67 | regex: /(<<[\w\d\-$]+,)(.*?)(>>|$)/}, 68 | {token: "keyword", regex: /<<[\w\d\-$]+,?|>>/}, 69 | {token: "constant.character", regex: /\({2,3}.*?\){2,3}/}, 70 | // Anchor 71 | {token: "keyword", regex: /\[\[.+?\]\]/}, 72 | // bibliography 73 | {token: "support", regex: /^\[{3}[\w\d =\-]+\]{3}/}, 74 | 75 | {include: "quotes"}, 76 | // text block end 77 | {token: "empty", regex: /^\s*$/, next: "start"} 78 | ], 79 | 80 | "listText": [ 81 | {include: "listStart"}, 82 | {include: "text"} 83 | ], 84 | 85 | "indentedBlock": [ 86 | {token: "literal", regex: /^[\s\w].+$/, next: "indentedBlock"}, 87 | {token: "literal", regex: "", next: "start"} 88 | ], 89 | 90 | "listingBlock": [ 91 | {token: "literal", regex: /^\.{4,}\s*$/, next: "dissallowDelimitedBlock"}, 92 | {token: "constant.numeric", regex: '<\\d+>'}, 93 | {token: "literal", regex: '[^<]+'}, 94 | {token: "literal", regex: '<'} 95 | ], 96 | "literalBlock": [ 97 | {token: "literal", regex: /^-{4,}\s*$/, next: "dissallowDelimitedBlock"}, 98 | {token: "constant.numeric", regex: '<\\d+>'}, 99 | {token: "literal", regex: '[^<]+'}, 100 | {token: "literal", regex: '<'} 101 | ], 102 | "passthroughBlock": [ 103 | {token: "literal", regex: /^\+{4,}\s*$/, next: "dissallowDelimitedBlock"}, 104 | {token: "literal", regex: identifierRe + "|\\d+"}, 105 | {include: "macros"}, 106 | {token: "literal", regex: "."} 107 | ], 108 | 109 | "smallPassthrough": [ 110 | {token: "literal", regex: /[+]{3,}/, next: "dissallowDelimitedBlock"}, 111 | {token: "literal", regex: /^\s*$/, next: "dissallowDelimitedBlock"}, 112 | {token: "literal", regex: identifierRe + "|\\d+"}, 113 | {include: "macros"} 114 | ], 115 | 116 | "commentBlock": [ 117 | {token: "doc.comment", regex: /^\/{4,}\s*$/, next: "dissallowDelimitedBlock"}, 118 | {token: "doc.comment", regex: '^.*$'} 119 | ], 120 | "tableBlock": [ 121 | {token: "tableBlock", regex: /^\s*\|={3,}\s*$/, next: "dissallowDelimitedBlock"}, 122 | {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "innerTableBlock"}, 123 | {token: "tableBlock", regex: /\|/}, 124 | {include: "text", noEscape: true} 125 | ], 126 | "innerTableBlock": [ 127 | {token: "tableBlock", regex: /^\s*!={3,}\s*$/, next: "tableBlock"}, 128 | {token: "tableBlock", regex: /^\s*|={3,}\s*$/, next: "dissallowDelimitedBlock"}, 129 | {token: "tableBlock", regex: /\!/} 130 | ], 131 | "macros": [ 132 | {token: "macro", regex: /{[\w\-$]+}/}, 133 | {token: ["text", "string", "text", "constant.character", "text"], regex: /({)([\w\-$]+)(:)?(.+)?(})/}, 134 | {token: ["text", "markup.list.macro", "keyword", "string"], regex: /(\w+)(footnote(?:ref)?::?)([^\s\[]+)?(\[.*?\])?/}, 135 | {token: ["markup.list.macro", "keyword", "string"], regex: /([a-zA-Z\-][\w\.\/\-]*::?)([^\s\[]+)(\[.*?\])?/}, 136 | {token: ["markup.list.macro", "keyword"], regex: /([a-zA-Z\-][\w\.\/\-]+::?)(\[.*?\])/}, 137 | {token: "keyword", regex: /^:.+?:(?= |$)/} 138 | ], 139 | 140 | "quotes": [ 141 | {token: "string.italic", regex: /__[^_\s].*?__/}, 142 | {token: "string.italic", regex: quoteRule("_")}, 143 | 144 | {token: "keyword.bold", regex: /\*\*[^*\s].*?\*\*/}, 145 | {token: "keyword.bold", regex: quoteRule("\\*")}, 146 | 147 | {token: "literal", regex: quoteRule("\\+")}, 148 | {token: "literal", regex: /\+\+[^+\s].*?\+\+/}, 149 | {token: "literal", regex: /\$\$.+?\$\$/}, 150 | {token: "literal", regex: quoteRule("`")}, 151 | 152 | {token: "keyword", regex: quoteRule("^")}, 153 | {token: "keyword", regex: quoteRule("~")}, 154 | {token: "keyword", regex: /##?/}, 155 | {token: "keyword", regex: /(?:\B|^)``|\b''/} 156 | ] 157 | 158 | }; 159 | 160 | function quoteRule(ch) { 161 | var prefix = /\w/.test(ch) ? "\\b" : "(?:\\B|^)"; 162 | return prefix + ch + "[^" + ch + "].*?" + ch + "(?![\\w*])"; 163 | } 164 | 165 | //addQuoteBlock("text") 166 | 167 | var tokenMap = { 168 | macro: "constant.character", 169 | tableBlock: "doc.comment", 170 | titleUnderline: "markup.heading", 171 | singleLineTitle: "markup.heading", 172 | pageBreak: "string", 173 | option: "string.regexp", 174 | otherBlock: "markup.list", 175 | literal: "support.function", 176 | optionalTitle: "constant.numeric", 177 | escape: "constant.language.escape", 178 | link: "markup.underline.list" 179 | }; 180 | 181 | for (var state in this.$rules) { 182 | var stateRules = this.$rules[state]; 183 | for (var i = stateRules.length; i--; ) { 184 | var rule = stateRules[i]; 185 | if (rule.include || typeof rule == "string") { 186 | var args = [i, 1].concat(this.$rules[rule.include || rule]); 187 | if (rule.noEscape) { 188 | args = args.filter(function(x) { 189 | return !x.next; 190 | }); 191 | } 192 | stateRules.splice.apply(stateRules, args); 193 | } else if (rule.token in tokenMap) { 194 | rule.token = tokenMap[rule.token]; 195 | } 196 | } 197 | } 198 | }; 199 | 200 | 201 | 202 | 203 | 204 | 205 | // Ace's Syntax Tokenizer. 206 | 207 | // tokenizing lines longer than this makes editor very slow 208 | var MAX_TOKEN_COUNT = 1000; 209 | var Tokenizer = function(rules) { 210 | this.states = rules; 211 | 212 | this.regExps = {}; 213 | this.matchMappings = {}; 214 | for (var key in this.states) { 215 | var state = this.states[key]; 216 | var ruleRegExps = []; 217 | var matchTotal = 0; 218 | var mapping = this.matchMappings[key] = {defaultToken: "text"}; 219 | var flag = "g"; 220 | 221 | var splitterRurles = []; 222 | for (var i = 0; i < state.length; i++) { 223 | var rule = state[i]; 224 | if (rule.defaultToken) 225 | mapping.defaultToken = rule.defaultToken; 226 | if (rule.caseInsensitive) 227 | flag = "gi"; 228 | if (rule.regex == null) 229 | continue; 230 | 231 | if (rule.regex instanceof RegExp) 232 | rule.regex = rule.regex.toString().slice(1, -1); 233 | 234 | // Count number of matching groups. 2 extra groups from the full match 235 | // And the catch-all on the end (used to force a match); 236 | var adjustedregex = rule.regex; 237 | var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2; 238 | if (Array.isArray(rule.token)) { 239 | if (rule.token.length == 1 || matchcount == 1) { 240 | rule.token = rule.token[0]; 241 | } else if (matchcount - 1 != rule.token.length) { 242 | throw new Error("number of classes and regexp groups in '" + 243 | rule.token + "'\n'" + rule.regex + "' doesn't match\n" 244 | + (matchcount - 1) + "!=" + rule.token.length); 245 | } else { 246 | rule.tokenArray = rule.token; 247 | rule.token = null; 248 | rule.onMatch = this.$arrayTokens; 249 | } 250 | } else if (typeof rule.token == "function" && !rule.onMatch) { 251 | if (matchcount > 1) 252 | rule.onMatch = this.$applyToken; 253 | else 254 | rule.onMatch = rule.token; 255 | } 256 | 257 | if (matchcount > 1) { 258 | if (/\\\d/.test(rule.regex)) { 259 | // Replace any backreferences and offset appropriately. 260 | adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) { 261 | return "\\" + (parseInt(digit, 10) + matchTotal + 1); 262 | }); 263 | } else { 264 | matchcount = 1; 265 | adjustedregex = this.removeCapturingGroups(rule.regex); 266 | } 267 | if (!rule.splitRegex && typeof rule.token != "string") 268 | splitterRurles.push(rule); // flag will be known only at the very end 269 | } 270 | 271 | mapping[matchTotal] = i; 272 | matchTotal += matchcount; 273 | 274 | ruleRegExps.push(adjustedregex); 275 | 276 | // makes property access faster 277 | if (!rule.onMatch) 278 | rule.onMatch = null; 279 | } 280 | 281 | splitterRurles.forEach(function(rule) { 282 | rule.splitRegex = this.createSplitterRegexp(rule.regex, flag); 283 | }, this); 284 | 285 | this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag); 286 | } 287 | }; 288 | 289 | (function() { 290 | this.$setMaxTokenCount = function(m) { 291 | MAX_TOKEN_COUNT = m | 0; 292 | }; 293 | 294 | this.$applyToken = function(str) { 295 | var values = this.splitRegex.exec(str).slice(1); 296 | var types = this.token.apply(this, values); 297 | 298 | // required for compatibility with old modes 299 | if (typeof types === "string") 300 | return [{type: types, value: str}]; 301 | 302 | var tokens = []; 303 | for (var i = 0, l = types.length; i < l; i++) { 304 | if (values[i]) 305 | tokens[tokens.length] = { 306 | type: types[i], 307 | value: values[i] 308 | }; 309 | } 310 | return tokens; 311 | }, 312 | 313 | this.$arrayTokens = function(str) { 314 | if (!str) 315 | return []; 316 | var values = this.splitRegex.exec(str); 317 | if (!values) 318 | return "text"; 319 | var tokens = []; 320 | var types = this.tokenArray; 321 | for (var i = 0, l = types.length; i < l; i++) { 322 | if (values[i + 1]) 323 | tokens[tokens.length] = { 324 | type: types[i], 325 | value: values[i + 1] 326 | }; 327 | } 328 | return tokens; 329 | }; 330 | 331 | this.removeCapturingGroups = function(src) { 332 | var r = src.replace( 333 | /\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g, 334 | function(x, y) {return y ? "(?:" : x;} 335 | ); 336 | return r; 337 | }; 338 | 339 | this.createSplitterRegexp = function(src, flag) { 340 | if (src.indexOf("(?=") != -1) { 341 | var stack = 0; 342 | var inChClass = false; 343 | var lastCapture = {}; 344 | src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function( 345 | m, esc, parenOpen, parenClose, square, index 346 | ) { 347 | if (inChClass) { 348 | inChClass = square != "]"; 349 | } else if (square) { 350 | inChClass = true; 351 | } else if (parenClose) { 352 | if (stack == lastCapture.stack) { 353 | lastCapture.end = index+1; 354 | lastCapture.stack = -1; 355 | } 356 | stack--; 357 | } else if (parenOpen) { 358 | stack++; 359 | if (parenOpen.length != 1) { 360 | lastCapture.stack = stack 361 | lastCapture.start = index; 362 | } 363 | } 364 | return m; 365 | }); 366 | 367 | if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end))) 368 | src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end); 369 | } 370 | return new RegExp(src, (flag||"").replace("g", "")); 371 | }; 372 | 373 | /** 374 | * Returns an object containing two properties: `tokens`, which contains all the tokens; and `state`, the current state. 375 | * @returns {Object} 376 | **/ 377 | this.getLineTokens = function(line, startState) { 378 | if (startState && typeof startState != "string") { 379 | var stack = startState.slice(0); 380 | startState = stack[0]; 381 | } else 382 | var stack = []; 383 | 384 | var currentState = startState || "start"; 385 | var state = this.states[currentState]; 386 | if (!state) { 387 | currentState = "start"; 388 | state = this.states[currentState]; 389 | } 390 | var mapping = this.matchMappings[currentState]; 391 | var re = this.regExps[currentState]; 392 | re.lastIndex = 0; 393 | 394 | var match, tokens = []; 395 | var lastIndex = 0; 396 | 397 | var token = {type: null, value: ""}; 398 | 399 | while (match = re.exec(line)) { 400 | var type = mapping.defaultToken; 401 | var rule = null; 402 | var value = match[0]; 403 | var index = re.lastIndex; 404 | 405 | if (index - value.length > lastIndex) { 406 | var skipped = line.substring(lastIndex, index - value.length); 407 | if (token.type == type) { 408 | token.value += skipped; 409 | } else { 410 | if (token.type) 411 | tokens.push(token); 412 | token = {type: type, value: skipped}; 413 | } 414 | } 415 | 416 | for (var i = 0; i < match.length-2; i++) { 417 | if (match[i + 1] === undefined) 418 | continue; 419 | 420 | rule = state[mapping[i]]; 421 | 422 | if (rule.onMatch) 423 | type = rule.onMatch(value, currentState, stack); 424 | else 425 | type = rule.token; 426 | 427 | if (rule.next) { 428 | if (typeof rule.next == "string") 429 | currentState = rule.next; 430 | else 431 | currentState = rule.next(currentState, stack); 432 | 433 | state = this.states[currentState]; 434 | if (!state) { 435 | window.console && console.error && console.error(currentState, "doesn't exist"); 436 | currentState = "start"; 437 | state = this.states[currentState]; 438 | } 439 | mapping = this.matchMappings[currentState]; 440 | lastIndex = index; 441 | re = this.regExps[currentState]; 442 | re.lastIndex = index; 443 | } 444 | break; 445 | } 446 | 447 | if (value) { 448 | if (typeof type == "string") { 449 | if ((!rule || rule.merge !== false) && token.type === type) { 450 | token.value += value; 451 | } else { 452 | if (token.type) 453 | tokens.push(token); 454 | token = {type: type, value: value}; 455 | } 456 | } else if (type) { 457 | if (token.type) 458 | tokens.push(token); 459 | token = {type: null, value: ""}; 460 | for (var i = 0; i < type.length; i++) 461 | tokens.push(type[i]); 462 | } 463 | } 464 | 465 | if (lastIndex == line.length) 466 | break; 467 | 468 | lastIndex = index; 469 | 470 | if (tokens.length > MAX_TOKEN_COUNT) { 471 | // chrome doens't show contents of text nodes with very long text 472 | while (lastIndex < line.length) { 473 | if (token.type) 474 | tokens.push(token); 475 | token = { 476 | value: line.substring(lastIndex, lastIndex += 2000), 477 | type: "overflow" 478 | }; 479 | } 480 | currentState = "start"; 481 | stack = []; 482 | break; 483 | } 484 | } 485 | 486 | if (token.type) 487 | tokens.push(token); 488 | 489 | if (stack.length > 1) { 490 | if (stack[0] !== currentState) 491 | stack.unshift(currentState); 492 | } 493 | return { 494 | tokens : tokens, 495 | state : stack.length ? stack : currentState 496 | }; 497 | }; 498 | 499 | }).call(Tokenizer.prototype); 500 | 501 | // Token conversion. 502 | // See 503 | // This is not an exact match nor the best match that can be made. 504 | var tokenFromAceToken = { 505 | empty: null, 506 | text: null, 507 | 508 | // Keyword 509 | keyword: 'keyword', 510 | control: 'keyword', 511 | operator: 'operator', 512 | 513 | // Constants 514 | constant: 'atom', 515 | numeric: 'number', 516 | character: 'atom', 517 | escape: 'atom', 518 | 519 | // Variables 520 | variable: 'variable', 521 | parameter: 'variable-3', 522 | language: 'variable-2', // Python's `self` uses that. 523 | 524 | // Comments 525 | comment: 'comment', 526 | line: 'comment', 527 | 'double-slash': 'comment', 528 | 'double-dash': 'comment', 529 | 'number-sign': 'comment', 530 | percentage: 'comment', 531 | block: 'comment', 532 | documentation: 'comment', 533 | 534 | // String 535 | string: 'string', 536 | quoted: 'string', 537 | single: 'string', 538 | double: 'string', 539 | triple: 'string', 540 | unquoted: 'string', 541 | interpolated: 'string', 542 | regexp: 'string-2', 543 | 544 | meta: 'meta', 545 | literal: 'qualifier', 546 | support: 'builtin', 547 | 548 | // Markup 549 | markup: 'tag', 550 | underline: 'link', 551 | link: 'link', 552 | bold: 'strong', 553 | heading: 'header', 554 | italic: 'em', 555 | list: 'variable-2', 556 | numbered: 'variable-2', 557 | unnumbered: 'variable-2', 558 | quote: 'quote', 559 | raw: 'variable-2', // Markdown's raw block uses that. 560 | 561 | // Invalid 562 | invalid: 'error', 563 | illegal: 'invalidchar', 564 | deprecated: 'error' 565 | }; 566 | 567 | // Takes a list of Ace tokens, returns a (string) CodeMirror token. 568 | var cmTokenFromAceTokens = function(tokens) { 569 | var token = null; 570 | for (var i = 0; i < tokens.length; i++) { 571 | // Find the most specific token. 572 | if (tokenFromAceToken[tokens[i]] !== undefined) { 573 | token = tokenFromAceToken[tokens[i]]; 574 | } 575 | } 576 | return token; 577 | }; 578 | 579 | // Consume a token from plannedTokens. 580 | var consumeToken = function(stream, state) { 581 | var plannedToken = state.plannedTokens.shift(); 582 | if (plannedToken === undefined) { 583 | return null; 584 | } 585 | stream.match(plannedToken.value); 586 | var tokens = plannedToken.type.split('.'); 587 | return cmTokenFromAceTokens(tokens); 588 | }; 589 | 590 | var matchToken = function(stream, state) { 591 | // Anormal start: we already have planned tokens to consume. 592 | if (state.plannedTokens.length > 0) { 593 | return consumeToken(stream, state); 594 | } 595 | 596 | // Normal start. 597 | var currentState = state.current; 598 | var currentLine = stream.match(/.*$/, false)[0]; 599 | var tokenized = tokenizer.getLineTokens(currentLine, currentState); 600 | // We got a {tokens, state} object. 601 | // Each token is a {value, type} object. 602 | state.plannedTokens = tokenized.tokens; 603 | state.current = tokenized.state; 604 | 605 | // Consume a token. 606 | return consumeToken(stream, state); 607 | } 608 | 609 | // Initialize all state. 610 | var aceHighlightRules = new HighlightRules(); 611 | var tokenizer = new Tokenizer(aceHighlightRules.$rules); 612 | 613 | return { 614 | startState: function() { 615 | return { 616 | current: 'start', 617 | // List of {value, type}, with type being an Ace token string. 618 | plannedTokens: [] 619 | }; 620 | }, 621 | blankLine: function(state) { matchToken('', state); }, 622 | token: matchToken 623 | }; 624 | }); 625 | 626 | CodeMirror.defineMIME("text/x-asciidoc", "asciidoc"); 627 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | Try Asciidoc in your browser 2 | 3 | 4 | 49 | 50 | 51 |
52 | 53 |

 54 | 
55 |
56 |
57 |
58 | 62 | 63 | 64 | 65 | 66 | 67 | 117 | --------------------------------------------------------------------------------