├── AsciiDoc.tmLanguage ├── Default (Linux).sublime-keymap ├── Default (OSX).sublime-keymap ├── Default (Windows).sublime-keymap ├── Default.tmPreferences ├── ReadMe.md ├── asciidoc.sublime-build └── snippets ├── Anchor.sublime-snippet ├── Article.sublime-snippet ├── Bold.sublime-snippet ├── Comment Block.sublime-snippet ├── Definition Link.sublime-snippet ├── Definition.sublime-snippet ├── Example Block.sublime-snippet ├── Heading 0 (one-liner).sublime-snippet ├── Heading 0.sublime-snippet ├── Heading 1 (one-liner).sublime-snippet ├── Heading 1.sublime-snippet ├── Heading 2 (one-liner).sublime-snippet ├── Heading 2.sublime-snippet ├── Heading 3 (one-liner).sublime-snippet ├── Heading 3.sublime-snippet ├── Heading 4 (one-liner).sublime-snippet ├── Heading 4.sublime-snippet ├── Italic.sublime-snippet ├── Listing Block.sublime-snippet ├── Literal Block.sublime-snippet ├── Passthrough Block.sublime-snippet ├── Quote Block.sublime-snippet ├── Quoted.sublime-snippet ├── Sidebar Block.sublime-snippet ├── Subscript.sublime-snippet ├── Superscript.sublime-snippet └── Table.sublime-snippet /AsciiDoc.tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | comment 6 | 7 | A very early hack. Mostly ripped from other syntaxes. 8 | Only the very basic stuff is working. 9 | 10 | fileTypes 11 | 12 | adoc 13 | asciidoc 14 | asc 15 | 16 | foldingStartMarker 17 | (?x) 18 | (([/+-.*_=]){4,} 19 | |<!--(?!.*-->) 20 | ) 21 | foldingStopMarker 22 | (?x) 23 | (([/+-.*_=]){4,} 24 | |^\s*--> 25 | ) 26 | keyEquivalent 27 | ^~A 28 | name 29 | AsciiDoc 30 | patterns 31 | 32 | 33 | include 34 | #heading_inline 35 | 36 | 37 | include 38 | #heading-block 39 | 40 | 41 | include 42 | #heading-blockattr 43 | 44 | 45 | begin 46 | \$\$(?!\$) 47 | end 48 | \$\$(?!\$) 49 | name 50 | comment.block.passthrough.macro.doubledollar.asciidoc 51 | 52 | 53 | begin 54 | \+\+\+(?!\+) 55 | end 56 | \+\+\+(?!\+) 57 | name 58 | comment.block.passthrough.macro.tripeplus.asciidoc 59 | 60 | 61 | match 62 | (//).*$\n? 63 | name 64 | comment.line.double-slash.asciidoc 65 | 66 | 67 | begin 68 | (?x)^ 69 | (?= ([/+-.*_=]{4,})\s*$ 70 | | ([ \t]{1,}) 71 | | [=]{1,6}\s*+ 72 | | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ 73 | ) 74 | end 75 | (?x)^ 76 | (?! \1 77 | | ([ \t]{1,}) 78 | | [=]{1,6}\s*+ 79 | | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$ 80 | ) 81 | name 82 | meta.block-level.asciidoc 83 | patterns 84 | 85 | 86 | include 87 | #block_quote 88 | 89 | 90 | include 91 | #block_raw 92 | 93 | 94 | include 95 | #heading_inline 96 | 97 | 98 | include 99 | #heading-block 100 | 101 | 102 | include 103 | #separator 104 | 105 | 106 | 107 | 108 | begin 109 | ^[ ]{0,3}([*+-])(?=\s) 110 | captures 111 | 112 | 1 113 | 114 | name 115 | punctuation.definition.list_item.asciidoc 116 | 117 | 118 | end 119 | ^(?=\S) 120 | name 121 | markup.list.unnumbered.asciidoc 122 | patterns 123 | 124 | 125 | include 126 | #list-paragraph 127 | 128 | 129 | 130 | 131 | begin 132 | ^[ ]{0,3}[0-9]+(\.)(?=\s) 133 | captures 134 | 135 | 1 136 | 137 | name 138 | punctuation.definition.list_item.asciidoc 139 | 140 | 141 | end 142 | ^(?=\S) 143 | name 144 | markup.list.numbered.asciidoc 145 | patterns 146 | 147 | 148 | include 149 | #list-paragraph 150 | 151 | 152 | 153 | 154 | begin 155 | ^([/+-.*_=]){4,}\s*$ 156 | end 157 | ^\1{4,}\s*$ 158 | name 159 | comment.block.asciidoc 160 | 161 | 162 | begin 163 | ^([/+.]){4,}\s*$ 164 | comment 165 | 166 | asciidoc formatting is disabled inside certain blocks. 167 | 168 | end 169 | ^[/+.]{4,}\s*$ 170 | name 171 | meta.disable-asciidoc 172 | 173 | 174 | begin 175 | ^(?=\S)(?![=-]{3,}(?=$))(?!\.\S+) 176 | end 177 | ^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n 178 | name 179 | meta.paragraph.asciidoc 180 | patterns 181 | 182 | 183 | include 184 | #inline 185 | 186 | 187 | include 188 | text.html.basic 189 | 190 | 191 | captures 192 | 193 | 1 194 | 195 | name 196 | punctuation.definition.heading.asciidoc 197 | 198 | 199 | match 200 | ^(={3,})(?=[ \t]*$) 201 | name 202 | markup.heading.0.asciidoc 203 | 204 | 205 | captures 206 | 207 | 1 208 | 209 | name 210 | punctuation.definition.heading.asciidoc 211 | 212 | 213 | match 214 | ^(-{3,})(?=[ \t]*$) 215 | name 216 | markup.heading.1.asciidoc 217 | 218 | 219 | captures 220 | 221 | 1 222 | 223 | name 224 | punctuation.definition.heading.asciidoc 225 | 226 | 227 | match 228 | ^(~{3,})(?=[ \t]*$) 229 | name 230 | markup.heading.2.asciidoc 231 | 232 | 233 | captures 234 | 235 | 1 236 | 237 | name 238 | punctuation.definition.heading.asciidoc 239 | 240 | 241 | match 242 | ^(\^{3,})(?=[ \t]*$) 243 | name 244 | markup.heading.3.asciidoc 245 | 246 | 247 | captures 248 | 249 | 1 250 | 251 | name 252 | punctuation.definition.heading.asciidoc 253 | 254 | 255 | match 256 | ^(\+{3,})(?=[ \t]*$) 257 | name 258 | markup.heading.4.asciidoc 259 | 260 | 261 | 262 | 263 | repository 264 | 265 | attribute-entry 266 | 267 | match 268 | ^:[-_. A-Za-z0-9]+:\s*(.*)\s*$ 269 | name 270 | variable.other 271 | 272 | attribute-reference 273 | 274 | match 275 | {[-_. A-Za-z0-9]+} 276 | name 277 | variable.other 278 | 279 | attribute-reference-predefined 280 | 281 | match 282 | {(?i:amp|asciidoc-dir|asciidoc-file|asciidoc-version|author|authored|authorinitials|backend-docbook|backend-xhtml11|backend-html4|docbook-article|xhtml11-article|html4-article|docbook-book|xhtml11-book|html4-book|docbook-manpage|xhtml11-manpage|html4-manpage|backend|backslash|basebackend|brvbar|date|docdate|doctime|docname|docfile|docdir|doctitle|doctype-article|doctype-book|doctype-manpage|doctype|email|empty|encoding|filetype|firstname|gt|id|indir|infile|lastname|level|listindex|localdate|localtime|lt|manname|manpurpose|mantitle|manvolnum|middlename|nbsp|outdir|outfile|reftext|revision|sectnum|showcomments|title|two_colons|two_semicolons|user-dir|verbose)} 283 | name 284 | support.variable 285 | 286 | block_quote 287 | 288 | begin 289 | ^([/+-.*_=]){4,}\s*$ 290 | end 291 | ^\1{4,}\s*$ 292 | name 293 | comment.block.asciidoc 294 | 295 | block_raw 296 | 297 | match 298 | \G([ ]{4}|\t).*$\n? 299 | name 300 | markup.raw.block.asciidoc 301 | 302 | bracket 303 | 304 | comment 305 | 306 | asciidoc will convert this for us. We match it so that the 307 | HTML grammar will not mark it up as invalid. 308 | 309 | match 310 | <(?![a-z/?\$!]) 311 | name 312 | meta.other.valid-bracket.asciidoc 313 | 314 | character-replacements 315 | 316 | match 317 | \(C\)|\(R\)|\(TM\)|--(?!-)|\.\.\.(?!\.)|->|<-|=>|<= 318 | name 319 | constant.character.asciidoc 320 | 321 | escape 322 | 323 | match 324 | \\[-`*_#+.!(){}\[\]\\>:] 325 | name 326 | constant.character.escape.asciidoc 327 | 328 | heading 329 | 330 | captures 331 | 332 | 1 333 | 334 | name 335 | punctuation.definition.heading.asciidoc 336 | 337 | 338 | contentName 339 | entity.name.section.asciidoc 340 | match 341 | (?m)^(\S+)$([=-~^+])+\s*$ 342 | name 343 | markup.heading.asciidoc 344 | 345 | heading-block 346 | 347 | captures 348 | 349 | 1 350 | 351 | name 352 | punctuation.definition.heading.asciidoc 353 | 354 | 355 | match 356 | ^\.(\w.*)$ 357 | name 358 | markup.heading.asciidoc 359 | 360 | heading-blockattr 361 | 362 | captures 363 | 364 | 1 365 | 366 | name 367 | punctuation.definition.heading.asciidoc 368 | 369 | 370 | match 371 | ^\[\[?(\w.*)\]$ 372 | name 373 | markup.heading.asciidoc 374 | 375 | heading_inline 376 | 377 | begin 378 | \G(={1,6})(?!=)\s*(?=\S) 379 | captures 380 | 381 | 1 382 | 383 | name 384 | punctuation.definition.heading.asciidoc 385 | 386 | 387 | contentName 388 | entity.name.section.asciidoc 389 | end 390 | \s*(=*)$\n? 391 | name 392 | markup.heading.asciidoc 393 | patterns 394 | 395 | 396 | include 397 | #inline 398 | 399 | 400 | 401 | inline 402 | 403 | patterns 404 | 405 | 406 | include 407 | #line-break 408 | 409 | 410 | include 411 | #line-page-break 412 | 413 | 414 | include 415 | #line-ruler 416 | 417 | 418 | include 419 | #escape 420 | 421 | 422 | include 423 | #passthrough-macro-trippleplus-inline 424 | 425 | 426 | include 427 | #passthrough-macro-doubledollar-inline 428 | 429 | 430 | include 431 | #character-replacements 432 | 433 | 434 | include 435 | #bracket 436 | 437 | 438 | include 439 | #raw 440 | 441 | 442 | include 443 | #text-quote-single 444 | 445 | 446 | include 447 | #text-quote-double 448 | 449 | 450 | include 451 | #text-quote-other 452 | 453 | 454 | include 455 | #text-bold-unconstrained 456 | 457 | 458 | include 459 | #text-italic-unconstrained 460 | 461 | 462 | include 463 | #text-monospace-unconstrained 464 | 465 | 466 | include 467 | #text-unquoted-unconstrained 468 | 469 | 470 | include 471 | #text-bold 472 | 473 | 474 | include 475 | #text-italic 476 | 477 | 478 | include 479 | #text-monospace 480 | 481 | 482 | include 483 | #text-unquoted 484 | 485 | 486 | include 487 | #attribute-entry 488 | 489 | 490 | include 491 | #attribute-reference-predefined 492 | 493 | 494 | include 495 | #attribute-reference 496 | 497 | 498 | 499 | line-break 500 | 501 | match 502 | (?<=\S)\s+\+$ 503 | name 504 | constant.character.escape.asciidoc 505 | 506 | line-page-break 507 | 508 | match 509 | ^<{3,}$ 510 | name 511 | constant.character.escape.asciidoc 512 | 513 | line-ruler 514 | 515 | match 516 | ^'{3,}$ 517 | name 518 | constant.character.escape.asciidoc 519 | 520 | list-paragraph 521 | 522 | patterns 523 | 524 | 525 | begin 526 | \G\s+(?=\S) 527 | end 528 | ^\s*$ 529 | name 530 | meta.paragraph.list.asciidoc 531 | patterns 532 | 533 | 534 | include 535 | #inline 536 | 537 | 538 | 539 | 540 | 541 | passthrough-macro-doubledollar-inline 542 | 543 | match 544 | (?:\[.*\])?\$\$(?!\$).+\$\$(?!\$) 545 | name 546 | comment.block.passthrough.asciidoc 547 | 548 | passthrough-macro-trippleplus-inline 549 | 550 | match 551 | (?:\[.*\])?\+\+\+(?!\+).+\+\+\+(?!\+) 552 | name 553 | comment.block.passthrough.asciidoc 554 | 555 | raw 556 | 557 | captures 558 | 559 | 1 560 | 561 | name 562 | punctuation.definition.raw.asciidoc 563 | 564 | 2 565 | 566 | name 567 | punctuation.definition.raw.asciidoc 568 | 569 | 570 | match 571 | (`+)(?:[^`]|(?!(?<!`)\1(?!`))`)*+(\1) 572 | name 573 | markup.raw.inline.asciidoc 574 | 575 | separator 576 | 577 | match 578 | \G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n? 579 | name 580 | meta.separator.asciidoc 581 | 582 | text-bold 583 | 584 | begin 585 | (?<!\w)(\*)(?=\S) 586 | captures 587 | 588 | 1 589 | 590 | name 591 | punctuation.definition.bold.asciidoc 592 | 593 | 594 | end 595 | (?<=\S)(\1)(?!\w) 596 | name 597 | markup.bold.asciidoc 598 | 599 | text-bold-unconstrained 600 | 601 | begin 602 | (\*\*)(?=\S) 603 | captures 604 | 605 | 1 606 | 607 | name 608 | punctuation.definition.bold.asciidoc 609 | 610 | 611 | end 612 | (?<=\S)(\1) 613 | name 614 | markup.bold.asciidoc 615 | 616 | text-italic 617 | 618 | begin 619 | (?<!\w)('|_)(?=\S) 620 | captures 621 | 622 | 1 623 | 624 | name 625 | punctuation.definition.italic.asciidoc 626 | 627 | 628 | end 629 | (?<=\S)(\1)((?!\1)|(?=\1\1))(?!\w) 630 | name 631 | markup.italic.asciidoc 632 | 633 | text-italic-unconstrained 634 | 635 | begin 636 | (__)(?=\S) 637 | captures 638 | 639 | 1 640 | 641 | name 642 | punctuation.definition.italic.asciidoc 643 | 644 | 645 | end 646 | (?<=\S)(\1) 647 | name 648 | markup.italic.asciidoc 649 | 650 | text-monospace 651 | 652 | match 653 | (?<!\w)([\+`])[^\+]*(\1)(?!\w) 654 | name 655 | string.interpolated.asciidoc 656 | 657 | text-monospace-unconstrained 658 | 659 | match 660 | (\+\+).*(\1) 661 | name 662 | string.interpolated.asciidoc 663 | 664 | text-quote-double 665 | 666 | match 667 | (?<!\w)(?:\[.*\])?``(?!`).*''(?!')(?!\w) 668 | name 669 | string.quoted.double.asciidoc 670 | 671 | text-quote-other 672 | 673 | match 674 | (?<!\w)(?:\[.*\])?([~^]).*(\1)(?!\w) 675 | name 676 | string.quoted.single.asciidoc 677 | 678 | text-quote-single 679 | 680 | comment 681 | TODO: Sub- and Superscript are really unconstrained 682 | match 683 | (?<!\w)(?:\[.*\])?`(?!`).*'(?!')(?!\w) 684 | name 685 | string.quoted.single.asciidoc 686 | 687 | text-unquoted 688 | 689 | match 690 | (?<!\w)(#).*(\1)(?!\w) 691 | name 692 | string.unquoted.asciidoc 693 | 694 | text-unquoted-unconstrained 695 | 696 | match 697 | (##).*(\1) 698 | name 699 | string.unquoted.asciidoc 700 | 701 | 702 | scopeName 703 | text.html.asciidoc 704 | uuid 705 | 090F38B8-2CEB-4956-A627-E24C7AA16ED6 706 | 707 | 708 | -------------------------------------------------------------------------------- /Default (Linux).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { "keys": ["ctrl+b"], "command": "insert_snippet", "args": {"contents": "*${0:$SELECTION}*"}, "context": 3 | [ 4 | {"key": "selection_empty", "operator": "equal", "operand": false}, 5 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 6 | ] 7 | }, 8 | { "keys": ["ctrl+i"], "command": "insert_snippet", "args": {"contents": "_${0:$SELECTION}_"}, "context": 9 | [ 10 | {"key": "selection_empty", "operator": "equal", "operand": false}, 11 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 12 | ] 13 | }, 14 | { "keys": ["ctrl+k", "ctrl+k"], "command": "insert_snippet", "args": {"contents": "+${0:$SELECTION}+"}, "context": 15 | [ 16 | {"key": "selection_empty", "operator": "equal", "operand": false}, 17 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 18 | ] 19 | }, 20 | { "keys": ["ctrl+k", "ctrl+f"], "command": "insert_snippet", "args": {"contents": "[role=\"filename\"]`${0:$SELECTION}`"}, "context": 21 | [ 22 | {"key": "selection_empty", "operator": "equal", "operand": false}, 23 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 24 | ] 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /Default (OSX).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { "keys": ["super+b"], "command": "insert_snippet", "args": {"contents": "*${0:$SELECTION}*"}, "context": 3 | [ 4 | {"key": "selection_empty", "operator": "equal", "operand": false}, 5 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 6 | ] 7 | }, 8 | { "keys": ["super+i"], "command": "insert_snippet", "args": {"contents": "_${0:$SELECTION}_"}, "context": 9 | [ 10 | {"key": "selection_empty", "operator": "equal", "operand": false}, 11 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 12 | ] 13 | }, 14 | { "keys": ["super+k", "super+k"], "command": "insert_snippet", "args": {"contents": "+${0:$SELECTION}+"}, "context": 15 | [ 16 | {"key": "selection_empty", "operator": "equal", "operand": false}, 17 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 18 | ] 19 | }, 20 | { "keys": ["super+k", "super+f"], "command": "insert_snippet", "args": {"contents": "[role=\"filename\"]`${0:$SELECTION}`"}, "context": 21 | [ 22 | {"key": "selection_empty", "operator": "equal", "operand": false}, 23 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 24 | ] 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /Default (Windows).sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { "keys": ["ctrl+b"], "command": "insert_snippet", "args": {"contents": "*${0:$SELECTION}*"}, "context": 3 | [ 4 | {"key": "selection_empty", "operator": "equal", "operand": false}, 5 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 6 | ] 7 | }, 8 | { "keys": ["ctrl+i"], "command": "insert_snippet", "args": {"contents": "_${0:$SELECTION}_"}, "context": 9 | [ 10 | {"key": "selection_empty", "operator": "equal", "operand": false}, 11 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 12 | ] 13 | }, 14 | { "keys": ["ctrl+k", "ctrl+k"], "command": "insert_snippet", "args": {"contents": "+${0:$SELECTION}+"}, "context": 15 | [ 16 | {"key": "selection_empty", "operator": "equal", "operand": false}, 17 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 18 | ] 19 | }, 20 | { "keys": ["ctrl+k", "ctrl+f"], "command": "insert_snippet", "args": {"contents": "[role=\"filename\"]`${0:$SELECTION}`"}, "context": 21 | [ 22 | {"key": "selection_empty", "operator": "equal", "operand": false}, 23 | {"key": "selector", "operator": "equal", "operand": "text.html.asciidoc"} 24 | ] 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /Default.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Globals 7 | scope 8 | 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_FULLNAME 16 | value 17 | 18 | 19 | 20 | name 21 | TM_EMAIL 22 | value 23 | 24 | 25 | 26 | name 27 | TM_ORGANIZATION_NAME 28 | value 29 | 30 | 31 | 32 | name 33 | TM_YEAR 34 | value 35 | 36 | 37 | 38 | 39 | uuid 40 | 0ef292cd-943a-4fb0-b43d-65959c5e6b06 41 | 42 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | AsciiDoc Package for Sublime Text 2 | =================================== 3 | 4 | **Currently looking for a maintainer!** 5 | 6 | This is an [AsciiDoc][] package for [Sublime Text][st]. It adds syntax highlighting and snippets for the AsciiDoc language to Sublime Text. 7 | 8 | Sublime Text is compatible with the TextMate editor for OS X snippets, preferences and languages files. However, even though Sublime can recognize the Textmate snippets, some features such as tab completion and shortcut commands do not work out of the box. This package overcomes these limitations. 9 | 10 | 11 | Installation 12 | ------------ 13 | 14 | ### Package Control 15 | Find the package on Package Control under the name [`AsciiDoc`][pkg]. 16 | 17 | 18 | ### Manual 19 | To install the package manually, follow these steps: 20 | 21 | - Download the zip containing src files. 22 | - Extract the files to an *AsciiDoc* folder (create this folder if not present already) under: 23 | - Windows: *%APPDATA%\Sublime Text\Packages* 24 | - OS X: *~/Library/Application Support/Sublime Text/Packages* 25 | - Linux: *~/.config/sublime-text/Packages* 26 | - Portable Installation: *Sublime Text/Data* 27 | - Close all instances of Sublime Text and relaunch the editor. 28 | 29 | If successful, you should see an **AsciiDoc** entry under **View > Syntax** and under **Tools > Snippets**. 30 | 31 | **Note**: Snippets may take few seconds to load under Windows. 32 | 33 | 34 | Configure Variables: `TM_FULLNAME`, `TM_EMAIL`, etc. 35 | ------------------------------------------------ 36 | The Article snippet refers to certain variables that are styled after the TextMate standard for environment variables (as do other features of Sublime). These variables are configured via the Default.tmPreferences file. 37 | 38 | 1. Edit *Default.tmPreferences* 39 | 2. Replace "My Full Name", "My Email", and "My Company" with your actual name, email address, and company name. 40 | 3. Update the defintion of `TM_YEAR` (currently 2013) if necessary. 41 | 4. Test the Article snippet (create a new AsciiDoc file, type `ar` and hit Tab). 42 | 43 | 44 | Configure the AsciiDoc Build System 45 | ----------------------------------- 46 | Sublime has a build system for compiling source code like AsciiDoc source. A file called *asciidoc.sublime-build* is provided here to allow you to take advantage of the build system, but it needs to be told where you have installed Python and AsciiDoc: 47 | 48 | 1. Edit *asciidoc.sublime-build* 49 | 2. Change the `working_dir` from */path/to/asciidoc-8.6.8* to the actual location where you have AsciiDoc installed (e.g. *C:\prgs\asciidoc-8.6.8*) 50 | 3. Change the first parameter of `cmd` from */path/to/python* to the actual name and location of your Python engine (e.g. *C:\Python39\python.exe*) 51 | 4. Note: See below about Ctrl+B no longer being the shortcut key for the build system. 52 | 53 | 54 | Usage 55 | ----- 56 | - Create a new file, save it as *\.asc* 57 | - Start typing AsciiDoc! 58 | 59 | 60 | Snippets 61 | -------- 62 | Snippets can be inserted anywhere by using the menu command **Tools > Snippets > AsciiDoc** or by typing two initial characters and hitting tab to complete. 63 | A few tab completion examples are: 64 | 65 | - Start a new article (type `ar TAB`) 66 | - Comments (type `// TAB`) 67 | - Headings (type `h1 TAB` to `h4 TAB` for one-liner versions) 68 | - Table generation (type `|= TAB`) 69 | - Tab expansion for blocks (type `== TAB`) 70 | - Sidebar block (type `** TAB`) 71 | - Add a definition to a glossary (type `:: TAB`) 72 | - Refer to a glossary definition elsewhere (type `<< TAB`) 73 | 74 | ### Article 75 | When you first invoke the Article snippet, "Title" will be highlighted. Type over it with the actual title you want. (Notice that the new title will be automatically underlined to length.) Hit tab to move off the title, and the backend choices will be highlighted. These are only the 3 most popular backends. Either delete 2 of them, or type over the whole thing with a 4th choice (e.g. manpage). Hit tab to move to the end. 76 | 77 | ### Definition and Definition Link 78 | Use these to create glossary definitions with anchors and corresponding references to them. Note how the anchor tags will be automatically composed as you type the name of the term being defined, and also how any non-alphanumeric characters are automatically left out of the tag. 79 | 80 | 81 | Keyboard Shortcuts 82 | ------------------ 83 | Basic support for some handy shortcuts are now available: 84 | 85 | - **Bold** selection: Select some text and then press Ctrl+B 86 | - *Italic*ize selection: Select some text and then press Ctrl+I 87 | - Mark selection as Code literal: Select some text and then press Ctrl+K, Ctrl+K 88 | - Mark selection as filename: Select some text and then press Ctrl+K, Ctrl+F 89 | 90 | **Note**: Ctrl+B overrides the standard key binding of `Tools > Build System`. If this bothers you, you can edit the `.sublime-keymap` files (based on your OS) under `Packages\AsciiDoc` folder. 91 | 92 | Time permitting, I'll add more shortcuts but meanwhile if you come upon something useful, feel free to submit a patch! 93 | 94 | 95 | Enhancements 96 | ------------ 97 | 98 | Following are planned enhancements for the package: 99 | 100 | - ~~Add keyboard shortcuts for various commands such bold text, italics, blocks etc.~~ 101 | - ~~Adding Build system to preview as HTML or PDF.~~ 102 | 103 | Your suggestions are welcome. 104 | 105 | 106 | Author & Credits 107 | ---------------- 108 | Created by Hrusikesh Panda. Copy left or right, as you wish. 109 | 110 | Credit goes to Christian Zuckschwerdt for his original work on [AsciiDoc TextMate bundle][adoc-tm]. 111 | 112 | The Article, Definition, and Definition Link snippets were written by Craig Jones. 113 | 114 | [asciidoc]: https://asciidoc.org 115 | [st]: https://www.sublimetext.com 116 | [pkg]: https://packagecontrol.io/packages/AsciiDoc 117 | [adoc-tm]: https://github.com/zuckschwerdt/asciidoc.tmbundle 118 | -------------------------------------------------------------------------------- /asciidoc.sublime-build: -------------------------------------------------------------------------------- 1 | { 2 | "working_dir": "/path/to/asciidoc-8.6.8", 3 | "cmd": ["/path/to/python", "asciidoc.py", "$file"], 4 | "selector": "text.html.asciidoc", 5 | "shell":true 6 | } 7 | -------------------------------------------------------------------------------- /snippets/Anchor.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Anchor 3 | 4 | text.html.asciidoc 5 | -------------------------------------------------------------------------------- /snippets/Article.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | AsciiDoc Article Start 3 | 6 | v1.0, $TM_YEAR 7 | :copyright: (c) $TM_ORGANIZATION_NAME, $TM_YEAR. All rights Reserved. 8 | :backend: ${2:html5|wordpress|slidy} 9 | :theme: flask 10 | 11 | $0 12 | ]]> 13 | ar 14 | text.html.asciidoc 15 | -------------------------------------------------------------------------------- /snippets/Bold.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Bold 3 | 4 | * 5 | text.html.asciidoc 6 | -------------------------------------------------------------------------------- /snippets/Comment Block.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Comment Block 3 | 7 | // 8 | text.html.asciidoc 9 | -------------------------------------------------------------------------------- /snippets/Definition Link.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Definition Link 3 | >]]> 4 | << 5 | text.html.asciidoc 6 | -------------------------------------------------------------------------------- /snippets/Definition.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Definition 3 | 5 | :: 6 | text.html.asciidoc 7 | -------------------------------------------------------------------------------- /snippets/Example Block.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Example Block 3 | 7 | == 8 | text.html.asciidoc 9 | -------------------------------------------------------------------------------- /snippets/Heading 0 (one-liner).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 0 (one-liner) 3 | 5 | v1.0, `date` 6 | 7 | $0]]> 8 | h0 9 | text.html.asciidoc 10 | -------------------------------------------------------------------------------- /snippets/Heading 0.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 0 3 | 6 | v1.0, `date` 7 | 8 | ]]> 9 | = 10 | text.html.asciidoc 11 | -------------------------------------------------------------------------------- /snippets/Heading 1 (one-liner).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 1 (one-liner) 3 | 6 | h1 7 | text.html.asciidoc 8 | -------------------------------------------------------------------------------- /snippets/Heading 1.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 1 3 | 6 | - 7 | text.html.asciidoc 8 | -------------------------------------------------------------------------------- /snippets/Heading 2 (one-liner).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 2 (one-liner) 3 | 6 | h2 7 | text.html.asciidoc 8 | -------------------------------------------------------------------------------- /snippets/Heading 2.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 2 3 | 6 | ~ 7 | text.html.asciidoc 8 | -------------------------------------------------------------------------------- /snippets/Heading 3 (one-liner).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 3 (one-liner) 3 | 6 | h3 7 | text.html.asciidoc 8 | -------------------------------------------------------------------------------- /snippets/Heading 3.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 3 3 | 6 | ^ 7 | text.html.asciidoc 8 | -------------------------------------------------------------------------------- /snippets/Heading 4 (one-liner).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 4 (one-liner) 3 | 6 | h4 7 | text.html.asciidoc 8 | -------------------------------------------------------------------------------- /snippets/Heading 4.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Heading 4 3 | 6 | + 7 | text.html.asciidoc 8 | -------------------------------------------------------------------------------- /snippets/Italic.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Italic 3 | 4 | _ 5 | text.html.asciidoc 6 | -------------------------------------------------------------------------------- /snippets/Listing Block.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Listing Block 3 | 8 | -- 9 | text.html.asciidoc 10 | -------------------------------------------------------------------------------- /snippets/Literal Block.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Literal Block 3 | 7 | .. 8 | text.html.asciidoc 9 | -------------------------------------------------------------------------------- /snippets/Passthrough Block.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Passthrough Block 3 | 7 | ++ 8 | text.html.asciidoc 9 | -------------------------------------------------------------------------------- /snippets/Quote Block.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Quote Block 3 | 8 | "" 9 | text.html.asciidoc 10 | -------------------------------------------------------------------------------- /snippets/Quoted.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Quoted 3 | 4 | `` 5 | text.html.asciidoc 6 | -------------------------------------------------------------------------------- /snippets/Sidebar Block.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Sidebar Block 3 | 7 | ** 8 | text.html.asciidoc 9 | -------------------------------------------------------------------------------- /snippets/Subscript.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Subscript 3 | 4 | ~$ 5 | text.html.asciidoc 6 | -------------------------------------------------------------------------------- /snippets/Superscript.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Superscript 3 | 4 | ^ 5 | text.html.asciidoc 6 | -------------------------------------------------------------------------------- /snippets/Table.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | Table 3 | 8 | |= 9 | text.html.asciidoc 10 | --------------------------------------------------------------------------------