Skip to content

Commit cd347a6

Browse files
committed
Added language and snippets
0 parents  commit cd347a6

26 files changed

+259
-0
lines changed

Anchor.sublime-snippet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<description>Anchor</description>
3+
<content><![CDATA[[[${1:name}]]]]></content>
4+
<tabTrigger>[[</tabTrigger>
5+
<scope>text.html.asciidoc</scope>
6+
</snippet>

AsciiDoc.tmLanguage

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

Bold.sublime-snippet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<description>Bold</description>
3+
<content><![CDATA[*${0:${TM_SELECTED_TEXT}}*]]></content>
4+
<tabTrigger>*$</tabTrigger>
5+
<scope>text.html.asciidoc</scope>
6+
</snippet>

Comment Block.sublime-snippet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<description>Comment Block</description>
3+
<content><![CDATA[////////////////////////////////////////////////////////////////////////////
4+
$1
5+
////////////////////////////////////////////////////////////////////////////
6+
$0]]></content>
7+
<tabTrigger>//</tabTrigger>
8+
<scope>text.html.asciidoc</scope>
9+
</snippet>

Example Block.sublime-snippet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<description>Example Block</description>
3+
<content><![CDATA[============================================================================
4+
$1
5+
============================================================================
6+
$0]]></content>
7+
<tabTrigger>==</tabTrigger>
8+
<scope>text.html.asciidoc</scope>
9+
</snippet>

Heading 0 (one-liner).sublime-snippet

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<snippet>
2+
<description>Heading 0 (one-liner)</description>
3+
<content><![CDATA[= $1 =
4+
${2:Author Name} <${3:mail@address.com}>
5+
v1.0, `date`
6+
7+
$0]]></content>
8+
<tabTrigger>h0</tabTrigger>
9+
<scope>text.html.asciidoc</scope>
10+
</snippet>

Heading 0.sublime-snippet

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<snippet>
2+
<description>Heading 0</description>
3+
<content><![CDATA[
4+
${TM_CURRENT_LINE/./=/g}
5+
${1:Author Name} <${2:mail@address.com}>
6+
v1.0, `date`
7+
8+
]]></content>
9+
<tabTrigger>$</tabTrigger>
10+
<scope>text.html.asciidoc</scope>
11+
</snippet>

Heading 1 (one-liner).sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<description>Heading 1 (one-liner)</description>
3+
<content><![CDATA[== $1 ==
4+
5+
$0]]></content>
6+
<tabTrigger>h1</tabTrigger>
7+
<scope>text.html.asciidoc</scope>
8+
</snippet>

Heading 1.sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<description>Heading 1</description>
3+
<content><![CDATA[
4+
${TM_CURRENT_LINE/./-/g}
5+
]]></content>
6+
<tabTrigger>$</tabTrigger>
7+
<scope>text.html.asciidoc</scope>
8+
</snippet>

Heading 2 (one-liner).sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<description>Heading 2 (one-liner)</description>
3+
<content><![CDATA[=== $1 ===
4+
5+
$0]]></content>
6+
<tabTrigger>h2</tabTrigger>
7+
<scope>text.html.asciidoc</scope>
8+
</snippet>

Heading 2.sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<description>Heading 2</description>
3+
<content><![CDATA[
4+
${TM_CURRENT_LINE/./~/g}
5+
]]></content>
6+
<tabTrigger>$</tabTrigger>
7+
<scope>text.html.asciidoc</scope>
8+
</snippet>

Heading 3 (one-liner).sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<description>Heading 3 (one-liner)</description>
3+
<content><![CDATA[==== $1 ====
4+
5+
$0]]></content>
6+
<tabTrigger>h3</tabTrigger>
7+
<scope>text.html.asciidoc</scope>
8+
</snippet>

Heading 3.sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<description>Heading 3</description>
3+
<content><![CDATA[
4+
${TM_CURRENT_LINE/./^/g}
5+
]]></content>
6+
<tabTrigger>$</tabTrigger>
7+
<scope>text.html.asciidoc</scope>
8+
</snippet>

Heading 4 (one-liner).sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<description>Heading 4 (one-liner)</description>
3+
<content><![CDATA[===== $1 =====
4+
5+
$0]]></content>
6+
<tabTrigger>h4</tabTrigger>
7+
<scope>text.html.asciidoc</scope>
8+
</snippet>

Heading 4.sublime-snippet

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<snippet>
2+
<description>Heading 4</description>
3+
<content><![CDATA[
4+
${TM_CURRENT_LINE/./+/g}
5+
]]></content>
6+
<tabTrigger>$</tabTrigger>
7+
<scope>text.html.asciidoc</scope>
8+
</snippet>

Italic.sublime-snippet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<description>Italic</description>
3+
<content><![CDATA[_${0:${TM_SELECTED_TEXT}}_]]></content>
4+
<tabTrigger>_$</tabTrigger>
5+
<scope>text.html.asciidoc</scope>
6+
</snippet>

Listing Block.sublime-snippet

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<snippet>
2+
<description>Listing Block</description>
3+
<content><![CDATA[[source,scala]
4+
----------------------------------------------------------------------
5+
$1
6+
----------------------------------------------------------------------
7+
$0]]></content>
8+
<tabTrigger>--</tabTrigger>
9+
<scope>text.html.asciidoc</scope>
10+
</snippet>

Literal Block.sublime-snippet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<description>Literal Block</description>
3+
<content><![CDATA[............................................................................
4+
$1
5+
............................................................................
6+
$0]]></content>
7+
<tabTrigger>..</tabTrigger>
8+
<scope>text.html.asciidoc</scope>
9+
</snippet>

Passthrough Block.sublime-snippet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<description>Passthrough Block</description>
3+
<content><![CDATA[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4+
$1
5+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6+
$0]]></content>
7+
<tabTrigger>++</tabTrigger>
8+
<scope>text.html.asciidoc</scope>
9+
</snippet>

Quote Block.sublime-snippet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<description>Quote Block</description>
3+
<content><![CDATA[____________________________________________________________________________
4+
$1
5+
____________________________________________________________________________
6+
$0]]></content>
7+
<tabTrigger>__</tabTrigger>
8+
<scope>text.html.asciidoc</scope>
9+
</snippet>

Quoted.sublime-snippet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<description>Quoted</description>
3+
<content><![CDATA[\`\`${0:${TM_SELECTED_TEXT}}'']]></content>
4+
<tabTrigger>\`</tabTrigger>
5+
<scope>text.html.asciidoc</scope>
6+
</snippet>

ReadMe.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
AsciiDoc Package for Sublime Text 2
2+
===================================
3+
This is an [AsciiDoc](http://www.methods.co.nz/asciidoc/) package for [Sublime Text 2 editor](http://www.sublimetext.com/).
4+
5+
It adds syntax highlighting and snippets for AsciiDoc language to Sublime Text 2 editor.
6+
7+
My work is based on the Christian Zuckschwerdt's [AsciiDoc TextMate bundle](https://github.com/zuckschwerdt/asciidoc.tmbundle).
8+
9+
Sublime Text 2 is compatible with Textmate editor for OS X snippets, preferences and languages file.
10+
However, even though it can recognize the Textmate snippets, some features such as tab completion, shortcut commands do not work out of the box.
11+
12+
My work is to overcome these limitations.
13+
14+
All the files provided here are tested in Windows 7 and OS X Lion.
15+
16+
Installation
17+
------------
18+
To install the package, follow these steps:
19+
20+
- Download the zip containing src files.
21+
- Extract the files to *AsciiDoc* folder (create this folder if not present already) under:
22+
- Windows: `%APPDATA%\Sublime Text 2\Packages\`
23+
- OS X: `~/Library/Application Support/Sublime Text 2/Packages`
24+
- Linux: `~/.config/sublime-text-2`
25+
- Portable Installation: `Sublime Text 2/Data`
26+
- Close all instances of Sublime Text 2 editor and relaunch the editor.
27+
28+
If successful, you should see **AsciiDoc** entry under `View > Syntax` and under `Tools > Snippets`.
29+
30+
**Note**: Snippets may take few seconds to load under Windows.
31+
32+
Usage
33+
-----
34+
- Create a new file, save it as `<filename>.asc`
35+
- Start typing AsciiDoc!
36+
37+
Snippets
38+
--------
39+
Snippets can be inserted anywhere by using the menu command `Tools > Snippets > AsciiDoc` or by typing two initial characters and hitting tab to complete.
40+
Few tab completion examples are:
41+
42+
- Comments (type `// TAB`)
43+
- Headings (type `h1 TAB` to `h4 TAB` for one-liner versions)
44+
- Table generation (type `|= TAB`)
45+
- Tab expansion for blocks (type `== TAB`)
46+
- Sidebar block (type `** TAB`)
47+
48+
Enhancements
49+
------------
50+
51+
Following are planned enhancements for the package:
52+
53+
- Add keyboard shortcuts for various commands such bold text, italics, blocks etc.
54+
- Adding Build system to preview as HTML or PDF.
55+
56+
Your suggestions are welcome.
57+
58+
Author & Credits
59+
----------------
60+
61+
Created by Hrusikesh Panda. Copy left or right, as you wish.
62+
63+
Credit goes to Christian Zuckschwerdt for his original work on AsciiDoc TextMate bundle.

Sidebar Block.sublime-snippet

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<snippet>
2+
<description>Sidebar Block</description>
3+
<content><![CDATA[****************************************************************************
4+
$1
5+
****************************************************************************
6+
$0]]></content>
7+
<tabTrigger>**</tabTrigger>
8+
<scope>text.html.asciidoc</scope>
9+
</snippet>

Subscript.sublime-snippet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<description>Subscript</description>
3+
<content><![CDATA[~${0:${TM_SELECTED_TEXT}}~]]></content>
4+
<tabTrigger>~$</tabTrigger>
5+
<scope>text.html.asciidoc</scope>
6+
</snippet>

Superscript.sublime-snippet

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<snippet>
2+
<description>Superscript</description>
3+
<content><![CDATA[^${0:${TM_SELECTED_TEXT}}^]]></content>
4+
<tabTrigger>^$</tabTrigger>
5+
<scope>text.html.asciidoc</scope>
6+
</snippet>

Table.sublime-snippet

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<snippet>
2+
<description>Table</description>
3+
<content><![CDATA[.${1:Legend}
4+
[width="${2:100%}",cols="$3",options="$4"]
5+
|===
6+
|$5
7+
|===]]></content>
8+
<tabTrigger>|=</tabTrigger>
9+
<scope>text.html.asciidoc</scope>
10+
</snippet>

0 commit comments

Comments
 (0)