├── Support ├── bin │ ├── tidy │ └── tidy-license.txt ├── nibs │ └── Insert Entity.nib │ │ ├── keyedobjects.nib │ │ ├── classes.nib │ │ └── info.nib ├── entities.txt └── tminclude.rb ├── Templates ├── XHTML – 1.1 │ ├── index.html │ └── info.plist ├── XHTML – 1.0 Strict │ ├── index.html │ └── info.plist ├── XHTML – 1.0 Frameset │ ├── index.html │ └── info.plist ├── XHTML – 1.0 Transitional │ ├── index.html │ └── info.plist ├── HTML – 4.0 Strict │ ├── index.html │ └── info.plist └── HTML — 4.0 Transitional │ ├── index.html │ └── info.plist ├── Snippets ├── Wrap in .tmSnippet ├── Non-Breaking Space.tmSnippet ├── DocType HTML5.tmSnippet ├── Br.tmSnippet ├── Style.tmSnippet ├── Base.tmSnippet ├── Script.tmSnippet ├── Emphasize.tmSnippet ├── Meta.tmSnippet ├── Strong.tmSnippet ├── Wrap Selection In Tag.tmSnippet ├── Div.tmSnippet ├── Link.tmSnippet ├── Title.tmSnippet ├── Ordered List.tmSnippet ├── Heading.tmSnippet ├── Script With External Source.tmSnippet ├── Unordered List.tmSnippet ├── Body.tmSnippet ├── Text Area.tmSnippet ├── DocType HTML 4.tmSnippet ├── DocType XHTML 1.1.tmSnippet ├── Mail Anchor.tmSnippet ├── Input.tmSnippet ├── DocType XHTML 1.tmSnippet ├── DocType HTML 4 Transitional.tmSnippet ├── DocType XHTML 1 Frameset.tmSnippet ├── Description List.tmSnippet ├── Option.tmSnippet ├── DocType XHTML 1.1 Transitional.tmSnippet ├── Source.tmSnippet ├── Special Return Inside Empty Open Close Tags.tmSnippet ├── Form.tmSnippet ├── Fieldset.tmSnippet ├── Input with Label.tmSnippet ├── Head.tmSnippet ├── Video.tmSnippet ├── Select Box.tmSnippet ├── Audio.tmSnippet ├── Insert Boilerplate.tmSnippet └── Table.tmSnippet ├── Preferences ├── Indent Corrections.tmPreferences ├── Character Class Element Name.tmPreferences ├── Character Class Attribute.tmPreferences ├── Symbol List: ID.plist ├── Empty tag typing pairs.plist ├── Comments.plist ├── Indentation Script Tag Closure.tmPreferences ├── Folding.tmPreferences ├── Tag preferences.plist ├── Miscellaneous.plist ├── Tag Completions.tmPreferences └── Completions HTML Attributes.tmPreferences ├── Commands ├── Persistent Include.tmCommand ├── Update Includes.tmCommand ├── Update Project.tmCommand ├── Show Web Preview.tmCommand ├── Wrap Each Selected Line in Open:Close Tag.plist ├── Convert Line : Selection to URL Escapes.plist ├── Decode Numeric URL Escapes in Line : Selection.plist ├── Strip HTML tags.plist ├── Decode HTML Entities.plist ├── Convert to HTML Entities.plist ├── Encrypt Line : Selection (ROT 13).tmCommand ├── Validate Syntax.tmCommand ├── Insert Entity….plist ├── Insert Close Tag.plist ├── Open Document in Running Browsers.tmCommand ├── Convert to named entities excl tags.plist ├── Insert Tag Pair.plist ├── Tidy.plist ├── Refresh Running Browsers.tmCommand ├── About Persistent Includes.tmCommand └── Documentation for Tag.plist ├── DragCommands ├── Insert JS Link.tmDragCommand ├── Anchor Tag.plist ├── CSS Link.plist ├── Insert Anchor href.tmDragCommand ├── Insert Video.tmDragCommand ├── Insert Audio.tmDragCommand └── Image Tag.plist ├── README.mdown ├── Macros └── Delete whitespace between tags.plist ├── Syntaxes └── HTML (Derivative).tmLanguage ├── Tests └── Script Types.html └── info.plist /Support/bin/tidy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/html.tmbundle/HEAD/Support/bin/tidy -------------------------------------------------------------------------------- /Support/nibs/Insert Entity.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/textmate/html.tmbundle/HEAD/Support/nibs/Insert Entity.nib/keyedobjects.nib -------------------------------------------------------------------------------- /Support/nibs/Insert Entity.nib/classes.nib: -------------------------------------------------------------------------------- 1 | { 2 | IBClasses = ( 3 | {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, 4 | {ACTIONS = {performButtonClick = id; }; CLASS = NSObject; LANGUAGE = ObjC; } 5 | ); 6 | IBVersion = 1; 7 | } -------------------------------------------------------------------------------- /Templates/XHTML – 1.1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | ${TM_NEW_FILE_BASENAME} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Templates/XHTML – 1.0 Strict/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | ${TM_NEW_FILE_BASENAME} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Templates/XHTML – 1.0 Frameset/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | ${TM_NEW_FILE_BASENAME} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Templates/XHTML – 1.0 Transitional/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | ${TM_NEW_FILE_BASENAME} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Templates/HTML – 4.0 Strict/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | ${TM_NEW_FILE_BASENAME} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Templates/HTML — 4.0 Transitional/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | ${TM_NEW_FILE_BASENAME} 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /Snippets/Wrap in .tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <?= $TM_SELECTED_TEXT ?> 7 | name 8 | Wrap in <?= … ?> 9 | scope 10 | text.html string 11 | uuid 12 | 912906A0-9A29-434B-AE98-E9DFDE6E48B4 13 | 14 | 15 | -------------------------------------------------------------------------------- /Support/nibs/Insert Entity.nib/info.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IBDocumentLocation 6 | 69 14 356 240 0 0 1920 1178 7 | IBFramework Version 8 | 446.1 9 | IBOpenObjects 10 | 11 | 5 12 | 13 | IBSystem Version 14 | 8L127 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Non-Breaking Space.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | &nbsp; 7 | keyEquivalent 8 | ~ 9 | name 10 | Non-Breaking Space 11 | scope 12 | text.html 13 | uuid 14 | 73B40BAE-A295-11D9-87F7-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/DocType HTML5.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!DOCTYPE html> 7 | 8 | name 9 | HTML — 5 10 | scope 11 | text.html 12 | tabTrigger 13 | doctype 14 | uuid 15 | 08E4F47C-A570-4F9B-A6AE-DCAC0D2E2420 16 | 17 | 18 | -------------------------------------------------------------------------------- /Snippets/Br.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <br${TM_XHTML}> 7 | keyEquivalent 8 | ^ 9 | name 10 | Br 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | uuid 14 | 3E008E42-A5C9-11D9-9BCD-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Preferences/Indent Corrections.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Indent Corrections 7 | scope 8 | text.html - text.html source 9 | settings 10 | 11 | disableIndentCorrections 12 | emptyLines 13 | 14 | uuid 15 | 4120EC74-470E-4D23-9D21-08FC21ED0C0E 16 | 17 | 18 | -------------------------------------------------------------------------------- /Snippets/Style.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <style> 7 | $0 8 | </style> 9 | name 10 | Style 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | tabTrigger 14 | style 15 | uuid 16 | 3C518074-A088-11D9-A5A2-000D93C8BE28 17 | 18 | 19 | -------------------------------------------------------------------------------- /Preferences/Character Class Element Name.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Character Class: Element Name 7 | scope 8 | text.html entity.name.tag.html 9 | settings 10 | 11 | characterClass 12 | element 13 | 14 | uuid 15 | BB37555E-C904-4EFB-B26C-91088DF4D026 16 | 17 | 18 | -------------------------------------------------------------------------------- /Snippets/Base.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <base href="$1"${2: target="$3"}${TM_XHTML}> 7 | name 8 | Base 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | base 13 | uuid 14 | 4462A6B8-A08A-11D9-A5A2-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Script.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <script> 7 | $0 8 | </script> 9 | name 10 | Script 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | tabTrigger 14 | script 15 | uuid 16 | 6592050A-A087-11D9-A5A2-000D93C8BE28 17 | 18 | 19 | -------------------------------------------------------------------------------- /Preferences/Character Class Attribute.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Character Class: Attribute 7 | scope 8 | text.html entity.other.attribute-name.html 9 | settings 10 | 11 | characterClass 12 | attribute 13 | 14 | uuid 15 | AC911BC4-A1D2-46B5-80A8-4CAAD994CCAC 16 | 17 | 18 | -------------------------------------------------------------------------------- /Snippets/Emphasize.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${0:${TM_SELECTED_TEXT/\A<em>(.*)<\/em>\z|.*/(?1:$1:<em>$0</em>)/m}} 7 | keyEquivalent 8 | @i 9 | name 10 | Emphasize 11 | scope 12 | text.html 13 | uuid 14 | EBB98620-3292-4621-BA38-D8A9A65D9551 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Meta.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <meta name="${1:name}" content="${2:content}"${TM_XHTML}> 7 | name 8 | Meta 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | meta 13 | uuid 14 | DA99AC44-A083-11D9-A5A2-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Strong.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | ${0:${TM_SELECTED_TEXT/\A<strong>(.*)<\/strong>\z|.*/(?1:$1:<strong>$0</strong>)/m}} 7 | keyEquivalent 8 | @b 9 | name 10 | Strong 11 | scope 12 | text.html 13 | uuid 14 | 4117D930-B6FA-4022-97E7-ECCAF4E70F63 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Wrap Selection In Tag.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <${1:p}>${2:$TM_SELECTED_TEXT}</${1/\s.*//}> 7 | keyEquivalent 8 | ^W 9 | name 10 | Wrap Selection in Open/Close Tag 11 | scope 12 | text.html, 13 | uuid 14 | BC8B8AE2-5F16-11D9-B9C3-000D93589AF6 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Div.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <div${1: id="${2:name}"}> 7 | ${0:$TM_SELECTED_TEXT} 8 | </div> 9 | name 10 | Div 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | tabTrigger 14 | div 15 | uuid 16 | 576036C0-A60E-11D9-ABD6-000D93C8BE28 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Link.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <link rel="${1:stylesheet}" href="${2:/css/master.css}"${TM_XHTML}> 7 | name 8 | Link 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | link 13 | uuid 14 | 77BFD0C0-A08A-11D9-A5A2-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Title.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <title>${1:${TM_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/}}</title> 7 | name 8 | Title 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | title 13 | uuid 14 | B62ECABE-A086-11D9-A5A2-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Templates/XHTML – 1.1/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | [ -f "$TM_NEW_FILE" ] || perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' <index.html >"$TM_NEW_FILE" 7 | extension 8 | html 9 | name 10 | XHTML — 1.1 11 | scope 12 | text.html 13 | uuid 14 | CDE8EFD6-9DE2-4E8C-BB6A-52E8CCD2E977 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Ordered List.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <ol> 7 | <li>${1:first item}</li>$0 8 | </ol> 9 | name 10 | Ordered List 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | tabTrigger 14 | ol 15 | uuid 16 | DB9B4DA1-B050-48FC-8241-117F6897013B 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Heading.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <h1 id="${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}">${1:$TM_SELECTED_TEXT}</h1> 7 | name 8 | Heading 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | h1 13 | uuid 14 | 65BA66DC-A07F-11D9-A5A2-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Script With External Source.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <script src="$1"></script> 7 | name 8 | Script With External Source 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | scriptsrc 13 | uuid 14 | 7D676C4C-A087-11D9-A5A2-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Unordered List.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <ul> 7 | <li>${1:first item}</li>$0 8 | </ul> 9 | name 10 | Unordered List 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | tabTrigger 14 | ul 15 | uuid 16 | F4D90AE0-533A-493D-8949-DA9D5F4C53C8 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Body.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <body id="${1:${TM_FILENAME/(.*)\..*/\L$1/}}"${2: onload="$3"}> 7 | $0 8 | </body> 9 | name 10 | Body 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | tabTrigger 14 | body 15 | uuid 16 | 4905D47B-A08B-11D9-A5A2-000D93C8BE28 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Text Area.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">$0</textarea> 7 | name 8 | Text Area 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | textarea 13 | uuid 14 | AAC9D7B8-A12C-11D9-A5A2-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Templates/XHTML – 1.0 Strict/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | [ -f "$TM_NEW_FILE" ] || perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' <index.html >"$TM_NEW_FILE" 7 | extension 8 | html 9 | name 10 | XHTML — 1.0 Strict 11 | scope 12 | text.html 13 | uuid 14 | EBEE6B51-29C7-4362-818F-A190CACD5296 15 | 16 | 17 | -------------------------------------------------------------------------------- /Templates/XHTML – 1.0 Frameset/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | [ -f "$TM_NEW_FILE" ] || perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' <index.html >"$TM_NEW_FILE" 7 | extension 8 | html 9 | name 10 | XHTML — 1.0 Frameset 11 | scope 12 | text.html 13 | uuid 14 | 26068A55-4C84-409D-BA00-162B55AF6961 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/DocType HTML 4.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 7 | "http://www.w3.org/TR/html4/strict.dtd"> 8 | 9 | name 10 | HTML — 4.01 Strict 11 | scope 12 | text.html 13 | tabTrigger 14 | doctype 15 | uuid 16 | 944F1410-188C-4D70-8340-CECAA56FC7F2 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/DocType XHTML 1.1.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 7 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 8 | 9 | name 10 | XHTML — 1.1 11 | scope 12 | text.html 13 | tabTrigger 14 | doctype 15 | uuid 16 | 5CE8FC6E-A802-11D9-BFC8-000D93C8BE28 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Mail Anchor.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a> 7 | name 8 | Mail Anchor 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | mailto 13 | uuid 14 | 81DA4C74-A530-11D9-9BCD-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Templates/XHTML – 1.0 Transitional/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | [ -f "$TM_NEW_FILE" ] || perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' <index.html >"$TM_NEW_FILE" 7 | extension 8 | html 9 | name 10 | XHTML — 1.0 Transitional 11 | scope 12 | text.html 13 | uuid 14 | 65D38039-6B0A-48E9-9E49-43832ECC4107 15 | 16 | 17 | -------------------------------------------------------------------------------- /Snippets/Input.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <input type="${1|text,submit,hidden,button|}" name="${2:some_name}" value="$3"${4: id="${5:$2}"}${TM_XHTML}> 7 | name 8 | Input 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | input 13 | uuid 14 | 44180979-A08E-11D9-A5A2-000D93C8BE28 15 | 16 | 17 | -------------------------------------------------------------------------------- /Preferences/Symbol List: ID.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Symbol List: ID 7 | scope 8 | meta.attribute.id.html > string 9 | settings 10 | 11 | showInSymbolList 12 | 13 | symbolTransformation 14 | 15 | s/^"|"$//g 16 | s/^'|'$//g 17 | s/^/ID: / 18 | 19 | 20 | uuid 21 | E7C5859E-122D-4382-84BE-5AB584DC2409 22 | 23 | 24 | -------------------------------------------------------------------------------- /Snippets/DocType XHTML 1.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 7 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 8 | 9 | name 10 | XHTML — 1.0 Strict 11 | scope 12 | text.html 13 | tabTrigger 14 | doctype 15 | uuid 16 | C8B83564-A802-11D9-BFC8-000D93C8BE28 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/DocType HTML 4 Transitional.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 7 | "http://www.w3.org/TR/html4/loose.dtd"> 8 | 9 | name 10 | HTML — 4.01 Transitional 11 | scope 12 | text.html 13 | tabTrigger 14 | doctype 15 | uuid 16 | B2AAEE56-42D8-42C3-8F67-865473F50E8D 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/DocType XHTML 1 Frameset.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" 7 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> 8 | 9 | name 10 | XHTML — 1.0 Frameset 11 | scope 12 | text.html 13 | tabTrigger 14 | doctype 15 | uuid 16 | 9ED6ABBE-A802-11D9-BFC8-000D93C8BE28 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Description List.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <dl> 7 | <dt>{1:first item}</dt> 8 | <dd> 9 | {2:description} 10 | </dd>$0 11 | </dl> 12 | name 13 | Description List 14 | scope 15 | text.html - B:meta.tag - B:text.html meta.embedded 16 | tabTrigger 17 | dl 18 | uuid 19 | C6007DCF-3603-459A-B723-5A8582E77E89 20 | 21 | 22 | -------------------------------------------------------------------------------- /Snippets/Option.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleUUID 6 | 4676FC6D-6227-11D9-BFB1-000D93589AF6 7 | content 8 | <option${1: value="${2:option}"}>${3:$2}</option> 9 | name 10 | Option 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | tabTrigger 14 | opt 15 | uuid 16 | 5820372E-A093-4F38-B25C-B0CCC50A0FC4 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/DocType XHTML 1.1 Transitional.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 7 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 8 | 9 | name 10 | XHTML — 1.0 Transitional 11 | scope 12 | text.html 13 | tabTrigger 14 | doctype 15 | uuid 16 | 7D8C2F74-A802-11D9-BFC8-000D93C8BE28 17 | 18 | 19 | -------------------------------------------------------------------------------- /Snippets/Source.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <source src="${1:example.mp4}" type="video/${1/(?i).*?(?:\.((mp4)|(webm)|(og[gv])|(mov)))?$/(?2:mp4)(?3:webm)(?4:ogg)(?5:quicktime)(?1::unknown)/}"${TM_XHTML}> 7 | name 8 | Source 9 | scope 10 | text.html - B:meta.tag - B:text.html meta.embedded 11 | tabTrigger 12 | source 13 | uuid 14 | 2A98CB53-7B41-48BF-ADFD-EB701EE61F84 15 | 16 | 17 | -------------------------------------------------------------------------------- /Templates/HTML – 4.0 Strict/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | if [[ ! -f "$TM_NEW_FILE" ]]; then 7 | TM_DATE=`date +%Y-%m-%d` \ 8 | perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' \ 9 | < index.html > "$TM_NEW_FILE" 10 | fi 11 | extension 12 | html 13 | name 14 | HTML — 4.01 Strict 15 | scope 16 | text.html 17 | uuid 18 | 04332FA8-8157-46C4-9854-8C190FFD96C6 19 | 20 | 21 | -------------------------------------------------------------------------------- /Templates/HTML — 4.0 Transitional/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | if [[ ! -f "$TM_NEW_FILE" ]]; then 7 | TM_DATE=`date +%Y-%m-%d` \ 8 | perl -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' \ 9 | < index.html > "$TM_NEW_FILE" 10 | fi 11 | extension 12 | html 13 | name 14 | HTML — 4.01 Transitional 15 | scope 16 | text.html 17 | uuid 18 | E6F19171-F664-4B4F-92DA-3E15E6CAD35C 19 | 20 | 21 | -------------------------------------------------------------------------------- /Snippets/Special Return Inside Empty Open Close Tags.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | 7 | $0 8 | 9 | keyEquivalent 10 | 11 | name 12 | Special: Return Inside Empty Open/Close Tags 13 | scope 14 | L:meta.tag.*.*.*.start & R:meta.tag.*.*.*.end, L:meta.tag.*.*.start & R:meta.tag.*.*.end, L:meta.tag.*.start & R:meta.tag.*.end, meta.scope.between-tag-pair 15 | uuid 16 | 3C44EABE-8D6F-4B1B-AB91-F419FAD1A0AD 17 | 18 | 19 | -------------------------------------------------------------------------------- /Preferences/Empty tag typing pairs.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Typing Pairs: Empty Tag 7 | scope 8 | L:text.html invalid.illegal.bad-angle-bracket.html 9 | settings 10 | 11 | smartTypingPairs 12 | 13 | 14 | ? 15 | ? 16 | 17 | 18 | % 19 | % 20 | 21 | 22 | 23 | uuid 24 | 6D6B631D-0D6C-413C-B4FA-1D535CBCE890 25 | 26 | 27 | -------------------------------------------------------------------------------- /Snippets/Form.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <form action="${1:${TM_FILENAME/(.*?)\..*/$1_submit/}}" method="${2:get}" accept-charset="utf-8"> 7 | $0 8 | 9 | <p><input type="submit" value="Continue &rarr;"${TM_XHTML}></p> 10 | </form> 11 | name 12 | Form 13 | scope 14 | text.html - B:meta.tag - B:text.html meta.embedded 15 | tabTrigger 16 | form 17 | uuid 18 | 232C2E8B-A08E-11D9-A5A2-000D93C8BE28 19 | 20 | 21 | -------------------------------------------------------------------------------- /Snippets/Fieldset.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleUUID 6 | 4676FC6D-6227-11D9-BFB1-000D93589AF6 7 | content 8 | <fieldset id="${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}"${2: class="${3:}"}> 9 | <legend>${1:$TM_SELECTED_TEXT}</legend> 10 | 11 | $0 12 | </fieldset> 13 | name 14 | Fieldset 15 | scope 16 | text.html - B:meta.tag - B:text.html meta.embedded 17 | tabTrigger 18 | fieldset 19 | uuid 20 | 9BD2BE01-A854-4D55-B584-725D04C075C0 21 | 22 | 23 | -------------------------------------------------------------------------------- /Snippets/Input with Label.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleUUID 6 | 4676FC6D-6227-11D9-BFB1-000D93589AF6 7 | content 8 | <label for="${2:${1/[[:alpha:]]+|( )/(?1:_:\L$0)/g}}">$1</label><input type="${3|text,submit,hidden,button|}" name="${4:$2}" value="$5"${6: id="${7:$2}"}${TM_XHTML}> 9 | name 10 | Input with Label 11 | scope 12 | text.html - B:meta.tag - B:text.html meta.embedded 13 | tabTrigger 14 | input 15 | uuid 16 | D8DCCC81-749A-4E2A-B4BC-D109D5799CAA 17 | 18 | 19 | -------------------------------------------------------------------------------- /Preferences/Comments.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments 7 | scope 8 | text.html 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | <!-- 18 | 19 | 20 | name 21 | TM_COMMENT_END 22 | value 23 | --> 24 | 25 | 26 | 27 | uuid 28 | B79BDBCF-D0C9-468E-BE62-744074D7825F 29 | 30 | 31 | -------------------------------------------------------------------------------- /Commands/Persistent Include.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require "#{ENV['TM_BUNDLE_SUPPORT']}/tminclude.rb" 10 | TextMate::Includes.instance.include_command 11 | 12 | input 13 | none 14 | keyEquivalent 15 | ^@i 16 | name 17 | Add Persistent Include 18 | output 19 | afterSelectedText 20 | scope 21 | text.html 22 | uuid 23 | 0D814247-7A00-46EE-A2A4-45FBBF4B1181 24 | 25 | 26 | -------------------------------------------------------------------------------- /Commands/Update Includes.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require "#{ENV['TM_BUNDLE_SUPPORT']}/tminclude.rb" 10 | TextMate::Includes.instance.process_persistent_includes 11 | 12 | input 13 | document 14 | keyEquivalent 15 | ^@u 16 | name 17 | Update Document 18 | output 19 | replaceDocument 20 | scope 21 | text.html 22 | uuid 23 | 4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8 24 | 25 | 26 | -------------------------------------------------------------------------------- /Commands/Update Project.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | require "#{ENV['TM_BUNDLE_SUPPORT']}/tminclude.rb" 10 | TextMate::Includes.instance.process_persistent_includes_for_project 11 | 12 | input 13 | none 14 | keyEquivalent 15 | ^@u 16 | name 17 | Update Project / Selected Files 18 | output 19 | showAsTooltip 20 | scope 21 | text.html 22 | uuid 23 | CA24BD98-E4B6-48F8-B15A-84CC533BE1BD 24 | 25 | 26 | -------------------------------------------------------------------------------- /DragCommands/Insert JS Link.tmDragCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleUUID 6 | 4676FC6D-6227-11D9-BFB1-000D93589AF6 7 | command 8 | #!/bin/bash 9 | [[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh" 10 | 11 | echo "<script src=\"$TM_DROPPED_FILE\"></script>" 12 | draggedFileExtensions 13 | 14 | js 15 | 16 | name 17 | Insert JS Link 18 | output 19 | insertAsSnippet 20 | scope 21 | text.html 22 | uuid 23 | 52124611-B363-40AD-B9F0-0A811941CD20 24 | 25 | 26 | -------------------------------------------------------------------------------- /Snippets/Head.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <head> 7 | <meta charset="utf-8"${TM_XHTML}> 8 | <meta http-equiv="x-ua-compatible" content="ie=edge"${TM_XHTML}> 9 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"${TM_XHTML}> 10 | 11 | <title>${1:${TM_FILENAME/((.+)\..*)?/(?2:$2:Page Title)/}}</title> 12 | $0 13 | </head> 14 | name 15 | Head 16 | scope 17 | text.html - B:meta.tag - B:text.html meta.embedded 18 | tabTrigger 19 | head 20 | uuid 21 | 9CF008C4-A086-11D9-A5A2-000D93C8BE28 22 | 23 | 24 | -------------------------------------------------------------------------------- /Snippets/Video.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <video controls> 7 | <source src="${1:example.mp4}" type="video/${1/(?i).*?(?:\.((mp4)|(webm)|(og[gv])|(mov)))?$/(?2:mp4)(?3:webm)(?4:ogg)(?5:quicktime)(?1::unknown)/}"${TM_XHTML}> 8 | 9 | <p>Your browser doesn't support HTML5 video. Here is 10 | a <a href="${1:example.mp4}">link to the video</a> instead.</p> 11 | </video> 12 | name 13 | Video 14 | scope 15 | text.html - B:meta.tag - B:text.html meta.embedded 16 | tabTrigger 17 | video 18 | uuid 19 | 42F15753-9B6D-4DD8-984C-807B94363277 20 | 21 | 22 | -------------------------------------------------------------------------------- /Commands/Show Web Preview.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | autoRefresh 6 | 7 | DocumentChanged 8 | 9 | beforeRunningCommand 10 | nop 11 | command 12 | #!/bin/sh 13 | if [[ -e "$TM_FILEPATH" ]]; then 14 | echo "<base href=\"file://$TM_FILEPATH\">" 15 | fi 16 | cat 17 | 18 | disableJavaScriptAPI 19 | 20 | input 21 | document 22 | keyEquivalent 23 | ^~@p 24 | name 25 | Show Preview 26 | output 27 | showAsHTML 28 | uuid 29 | AC5F664E-86BA-4D81-B6CE-1B12F69FA490 30 | 31 | 32 | -------------------------------------------------------------------------------- /Commands/Wrap Each Selected Line in Open:Close Tag.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | perl -pe 's/[\$`\\]/\\$&/g; s/([ \t]*)(.+)/$1<\${1:li}>$2<\/\${1\/\\s.*\/\/}>/' 9 | fallbackInput 10 | line 11 | input 12 | selection 13 | keyEquivalent 14 | ^@W 15 | name 16 | Wrap Each Selected Line in Open/Close Tag 17 | output 18 | insertAsSnippet 19 | scope 20 | text.html 21 | uuid 22 | 991E7EBD-F3F5-469A-BA01-DC30E04AD472 23 | 24 | 25 | -------------------------------------------------------------------------------- /Snippets/Select Box.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleUUID 6 | 4676FC6D-6227-11D9-BFB1-000D93589AF6 7 | content 8 | <select name="${1:some_name}" id="${2:$1}"${3:${4: multiple}${5: onchange="${6:}"}${7: size="${8:1}"}}> 9 | <option${9: value="${10:option1}"}>${11:$10}</option> 10 | <option${12: value="${13:option2}"}>${14:$13}</option>${15:} 11 | $0 12 | </select> 13 | name 14 | Select Box 15 | scope 16 | text.html - B:meta.tag - B:text.html meta.embedded 17 | tabTrigger 18 | select 19 | uuid 20 | 26023CFF-C73F-4EF5-9803-E4DBA2CBEADD 21 | 22 | 23 | -------------------------------------------------------------------------------- /Snippets/Audio.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <audio controls> 7 | <source src="${1:example.mp3}" type="audio/${1/(?i).*?(?:\.((mp4)|(mp3)|(webm)|(og[ga])|(flac)|(wave?)))?$/(?2:mp4)(?3:mp3)(?4:webm)(?5:ogg)(?6:flac)(?7:wav)(?1::unknown)/}"${TM_XHTML}> 8 | 9 | <p>Your browser doesn't support HTML5 audio. Here is 10 | a <a href="${1:example.mp3}">link to the audio</a> instead.</p> 11 | </audio> 12 | name 13 | Audio 14 | scope 15 | text.html - B:meta.tag - B:text.html meta.embedded 16 | tabTrigger 17 | audio 18 | uuid 19 | 8C826982-F460-43FA-BA31-476EE410F101 20 | 21 | 22 | -------------------------------------------------------------------------------- /Preferences/Indentation Script Tag Closure.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Indentation - Script Tag Closure 7 | scope 8 | text.html > meta.embedded.block > meta.tag.metadata.script, text.html > meta.embedded.block > meta.tag.metadata.script > source.js 9 | settings 10 | 11 | decreaseIndentPattern 12 | ^\s*</(?i:script)> 13 | increaseIndentPattern 14 | <((?i:script))(?=\s|>)\b[^>]*>(?!.*</\1>) 15 | indentNextLinePattern 16 | (?=not)possible 17 | unIndentedLinePattern 18 | (?=not)possible 19 | 20 | uuid 21 | A62F2377-AE98-4F1B-9675-B2C772C17993 22 | 23 | 24 | -------------------------------------------------------------------------------- /Snippets/Insert Boilerplate.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <!DOCTYPE html> 7 | <html lang="${LANG/(?<=^..).*//}"> 8 | <head> 9 | <meta charset="utf-8"${TM_XHTML}> 10 | <meta http-equiv="x-ua-compatible" content="ie=edge"${TM_XHTML}> 11 | <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"${TM_XHTML}> 12 | 13 | <title>$1</title> 14 | 15 | $2 16 | </head> 17 | <body> 18 | $0 19 | </body> 20 | </html> 21 | 22 | name 23 | Insert Boilerplate 24 | scope 25 | text.html, L:dyn.caret.begin.document 26 | tabTrigger 27 | html 28 | uuid 29 | 64F212E5-545D-4D36-A243-B452B10EC678 30 | 31 | 32 | -------------------------------------------------------------------------------- /Snippets/Table.tmSnippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | content 6 | <table> 7 | ${1: <caption>${2:Description}</caption> 8 | }${3: <thead> 9 | <tr> 10 | <th scope="${4|col,row,rowgroup,colgroup,auto|}">${5:Header Title}</th> 11 | </tr> 12 | </thead> 13 | }${3/(?m)\A(..*)\z/(?1: <tbody> 14 | :)/} <tr> 15 | ${3/(?m)\A(..*)\z/(?1: :)/} <td>$6</td>$0 16 | ${3/(?m)\A(..*)\z/(?1: :)/} </tr> 17 | ${3/(?m)\A(..*)\z/(?1: </tbody> 18 | :)/}</table> 19 | name 20 | Table 21 | scope 22 | text.html - B:meta.tag - B:text.html meta.embedded 23 | tabTrigger 24 | table 25 | uuid 26 | 57176082-A12F-11D9-A5A2-000D93C8BE28 27 | 28 | 29 | -------------------------------------------------------------------------------- /Preferences/Folding.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Folding 7 | scope 8 | text.html 9 | settings 10 | 11 | foldingStartMarker 12 | (?x) 13 | (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl|section|article|header|footer|nav|aside)\b.*?> 14 | |<!--(?!.*--\s*>) 15 | |^<!--\ \#tminclude\ (?>.*?-->)$ 16 | ) 17 | foldingStopMarker 18 | (?x) 19 | (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl|section|article|header|footer|nav|aside)> 20 | |^(?!.*?<!--).*?--\s*> 21 | |^<!--\ end\ tminclude\ -->$ 22 | ) 23 | 24 | uuid 25 | 559D87E0-20C9-4424-AD7C-F3CDD315177C 26 | 27 | 28 | -------------------------------------------------------------------------------- /Commands/Convert Line : Selection to URL Escapes.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby20 9 | require 'erb' 10 | print ERB::Util.url_encode(STDIN.read) 11 | 12 | fallbackInput 13 | line 14 | input 15 | selection 16 | inputFormat 17 | text 18 | keyEquivalent 19 | @& 20 | name 21 | URL Escape Line / Selection 22 | outputCaret 23 | heuristic 24 | outputFormat 25 | text 26 | outputLocation 27 | replaceInput 28 | scope 29 | text.html 30 | uuid 31 | 6B024865-6095-4CE3-8EDD-DC6F2230C2FF 32 | version 33 | 2 34 | 35 | 36 | -------------------------------------------------------------------------------- /Commands/Decode Numeric URL Escapes in Line : Selection.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby20 9 | require 'cgi' 10 | print CGI.unescape(STDIN.read) 11 | 12 | fallbackInput 13 | line 14 | input 15 | selection 16 | inputFormat 17 | text 18 | keyEquivalent 19 | @& 20 | name 21 | URL Unescape Line / Selection 22 | outputCaret 23 | heuristic 24 | outputFormat 25 | text 26 | outputLocation 27 | replaceInput 28 | scope 29 | text.html 30 | uuid 31 | 2C4C9673-B166-432A-8938-75A5CA622481 32 | version 33 | 2 34 | 35 | 36 | -------------------------------------------------------------------------------- /Commands/Strip HTML tags.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | ## Strip HTML and PHP tags from the selected text 9 | php -r 'echo strip_tags( file_get_contents("/dev/stdin") );' 10 | 11 | ### If you want to keep a particular tag, such as <p> comment the above line and uncomment the next line 12 | # php -r 'echo strip_tags( file_get_contents("/dev/stdin"), "<p>" );' 13 | ### end 14 | fallbackInput 15 | document 16 | input 17 | selection 18 | keyEquivalent 19 | 20 | name 21 | Strip HTML Tags from Document / Selection 22 | output 23 | replaceSelectedText 24 | scope 25 | text.html 26 | uuid 27 | 20D760B5-A127-11D9-A5A2-000D93C8BE28 28 | 29 | 30 | -------------------------------------------------------------------------------- /DragCommands/Anchor Tag.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | title=`echo $TM_DROPPED_FILE | perl -pe 's/^(.*\/)?(.*?)(\..*)?$/$2/g'` 7 | echo -n "<a href=\"$TM_DROPPED_FILE\" id=\"\" title=\"\${1:$title}\">\${1:$title}</a>" 8 | draggedFileExtensions 9 | 10 | html 11 | htm 12 | rhtml 13 | shtml 14 | phtml 15 | php 16 | php3 17 | php4 18 | php5 19 | cfm 20 | cfml 21 | dbm 22 | dbml 23 | 24 | name 25 | Insert Anchor 26 | output 27 | insertAsSnippet 28 | scope 29 | text.html 30 | uuid 31 | B23D6E15-6B33-11D9-86C1-000D93589AF6 32 | 33 | 34 | -------------------------------------------------------------------------------- /README.mdown: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | You can install this bundle in TextMate by opening the preferences and going to the bundles tab. After installation it will be automatically updated for you. 4 | 5 | # General 6 | 7 | * [Bundle Styleguide](http://kb.textmate.org/bundle_styleguide) — _before you make changes_ 8 | * [Commit Styleguide](http://kb.textmate.org/commit_styleguide) — _before you send a pull request_ 9 | * [Writing Bug Reports](http://kb.textmate.org/writing_bug_reports) — _before you report an issue_ 10 | 11 | # License 12 | 13 | If not otherwise specified (see below), files in this repository fall under the following license: 14 | 15 | Permission to copy, use, modify, sell and distribute this 16 | software is granted. This software is provided "as is" without 17 | express or implied warranty, and with no claim as to its 18 | suitability for any purpose. 19 | 20 | An exception is made for files in readable text which contain their own license information, or files where an accompanying file exists (in the same directory) with a “-license” suffix added to the base-name name of the original file, and an extension of txt, html, or similar. For example “tidy” is accompanied by “tidy-license.txt”. -------------------------------------------------------------------------------- /Preferences/Tag preferences.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Tag Preferences 7 | scope 8 | meta.tag 9 | settings 10 | 11 | smartTypingPairs 12 | 13 | 14 | " 15 | " 16 | 17 | 18 | ( 19 | ) 20 | 21 | 22 | { 23 | } 24 | 25 | 26 | [ 27 | ] 28 | 29 | 30 | 31 | 32 | 33 | 34 | < 35 | > 36 | 37 | 38 | ' 39 | ' 40 | 41 | 42 | spellChecking 43 | 0 44 | 45 | uuid 46 | 73251DBE-EBD2-470F-8148-E6F2EC1A9641 47 | 48 | 49 | -------------------------------------------------------------------------------- /DragCommands/CSS Link.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | #!/usr/bin/env ruby20 7 | 8 | if ENV['TM_DROPPED_FILE'] =~ /print[^\/]*\.css$/ 9 | print "<link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"print\"$TM_XHTML>" 10 | elsif ENV['TM_DROPPED_FILE'] =~ /(aural|speech)[^\/]*\.css$/ 11 | print "<link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"speech\"$TM_XHTML>" 12 | elsif ENV['TM_DROPPED_FILE'] =~ /screen[^\/]*\.css$/ 13 | print "<link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\" media=\"screen\"$TM_XHTML>" 14 | else 15 | print "<link rel=\"stylesheet\" href=\"#{ENV['TM_DROPPED_FILE']}\"$TM_XHTML>" 16 | end 17 | 18 | draggedFileExtensions 19 | 20 | css 21 | 22 | name 23 | Insert CSS Link 24 | output 25 | insertAsSnippet 26 | scope 27 | text.html 28 | uuid 29 | C8B717C2-6B33-11D9-BB47-000D93589AF6 30 | 31 | 32 | -------------------------------------------------------------------------------- /Macros/Delete whitespace between tags.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | commands 6 | 7 | 8 | argument 9 | 10 | action 11 | findNext 12 | findInProjectIgnoreCase 13 | 0 14 | findString 15 | (?=\S)|\s+ 16 | ignoreCase 17 | 0 18 | regularExpression 19 | 1 20 | replaceAllScope 21 | document 22 | wrapAround 23 | 0 24 | 25 | command 26 | findWithOptions: 27 | 28 | 29 | command 30 | deleteBackward: 31 | 32 | 33 | keyEquivalent 34 | ^~ 35 | name 36 | Forward Delete All Whitespace 37 | scope 38 | text.html 39 | uuid 40 | 7B7E945E-A112-11D9-A5A2-000D93C8BE28 41 | 42 | 43 | -------------------------------------------------------------------------------- /Commands/Decode HTML Entities.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | $KCODE = 'U' 10 | 11 | $entity_to_char = { } 12 | File.open("#{ENV['TM_BUNDLE_SUPPORT']}/entities.txt").read.scan(/^(\d+)\t(.+)$/) do |key, value| 13 | $entity_to_char[value] = [key.to_i].pack('U') 14 | end 15 | 16 | res = STDIN.read.gsub(/&(?:([a-z0-9]+)|#([0-9]+)|#x([0-9A-F]+));/i) do |m| 17 | if $1 then 18 | $entity_to_char[$1] || m 19 | else 20 | [$2 ? $2.to_i : $3.hex].pack("U") 21 | end 22 | end 23 | 24 | print res 25 | 26 | fallbackInput 27 | line 28 | input 29 | selection 30 | keyEquivalent 31 | @& 32 | name 33 | Decode Entities in Line / Selection 34 | output 35 | replaceSelectedText 36 | scope 37 | text.html 38 | uuid 39 | C183920D-A126-11D9-A5A2-000D93C8BE28 40 | 41 | 42 | -------------------------------------------------------------------------------- /Commands/Convert to HTML Entities.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | $KCODE = 'U' 10 | 11 | $char_to_entity = { } 12 | File.open("#{ENV['TM_BUNDLE_SUPPORT']}/entities.txt").read.scan(/^(\d+)\t(.+)$/) do |key, value| 13 | $char_to_entity[[key.to_i].pack('U')] = value 14 | end 15 | 16 | def encode (text) 17 | text.gsub(/[^\x00-\x7F]|["'<>&]/) do |ch| 18 | ent = $char_to_entity[ch] 19 | ent ? "&#{ent};" : sprintf("&#x%02X;", ch.unpack("U")[0]) 20 | end 21 | end 22 | 23 | print encode(STDIN.read) 24 | 25 | fallbackInput 26 | character 27 | input 28 | selection 29 | keyEquivalent 30 | @& 31 | name 32 | Convert Character / Selection to Entities 33 | output 34 | replaceSelectedText 35 | scope 36 | text.html 37 | uuid 38 | 3DD8406C-A116-11D9-A5A2-000D93C8BE28 39 | 40 | 41 | -------------------------------------------------------------------------------- /DragCommands/Insert Anchor href.tmDragCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | #!/usr/bin/env ruby20 7 | 8 | if ENV['TM_SCOPE'] =~ /string\.quoted\.double\.html/ 9 | print "#{ENV['TM_DROPPED_FILE']}" 10 | elsif ENV['TM_SCOPE'] =~ /punctuation\.definition\.tag\.end\.html/ 11 | print " href=\"#{ENV['TM_DROPPED_FILE']}\"" 12 | else 13 | print "href=\"#{ENV['TM_DROPPED_FILE']}\" " 14 | end 15 | 16 | draggedFileExtensions 17 | 18 | html 19 | htm 20 | rhtml 21 | shtml 22 | phtml 23 | php 24 | php3 25 | php4 26 | php5 27 | cfm 28 | cfml 29 | dbm 30 | dbml 31 | 32 | name 33 | Insert Href Attribute 34 | output 35 | insertAsSnippet 36 | scope 37 | B:text.html meta.tag 38 | uuid 39 | BD4AEF38-638B-4C47-A762-4A0A6190F9C7 40 | 41 | 42 | -------------------------------------------------------------------------------- /Commands/Encrypt Line : Selection (ROT 13).tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | 10 | def e_js(str) 11 | str.gsub(/(?=[\\"])/, '\\').gsub(/\n/, '\n').gsub(/[@.\/]/) { |ch| sprintf('\\%03o', ch[0]) } 12 | end 13 | 14 | def rot_13(str) 15 | str.tr('A-Za-z', 'N-ZA-Mn-za-m') 16 | end 17 | 18 | print %{<script type="text/javascript">document.write( 19 | "#{e_js(rot_13(STDIN.read))}".replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);})); 20 | </script>} 21 | 22 | fallbackInput 23 | line 24 | input 25 | selection 26 | inputFormat 27 | text 28 | keyEquivalent 29 | @& 30 | name 31 | Encrypt Line / Selection (ROT 13) 32 | outputCaret 33 | heuristic 34 | outputFormat 35 | text 36 | outputLocation 37 | replaceInput 38 | scope 39 | text.html 40 | uuid 41 | 9B13543F-8356-443C-B6E7-D9259B604927 42 | version 43 | 2 44 | 45 | 46 | -------------------------------------------------------------------------------- /DragCommands/Insert Video.tmDragCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby20 9 | 10 | if ENV['TM_DROPPED_FILE'] =~ /(?i)\.mp4$/ 11 | mimetype = 'mp4' 12 | elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.og[gv]$/ 13 | mimetype = 'ogg' 14 | elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.webm$/ 15 | mimetype = 'webm' 16 | elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.mov$/ 17 | mimetype = 'quicktime' 18 | end 19 | 20 | puts <<~TAG 21 | <video controls> 22 | <source src="#{ENV['TM_DROPPED_FILE']}" type="video/#{mimetype}"${TM_XHTML}> 23 | 24 | <p>Your browser doesn't support HTML5 video. Here is 25 | a <a href="#{ENV['TM_DROPPED_FILE']}">link to the video</a> instead.</p> 26 | </video> 27 | TAG 28 | 29 | draggedFileExtensions 30 | 31 | mp4 32 | ogg 33 | ogv 34 | webm 35 | mov 36 | 37 | input 38 | selection 39 | name 40 | Insert Video 41 | output 42 | insertAsSnippet 43 | scope 44 | text.html 45 | uuid 46 | EBE53CE6-AEBB-4318-AE98-D07F3755E3F9 47 | 48 | 49 | -------------------------------------------------------------------------------- /Commands/Validate Syntax.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby20 9 | 10 | STDOUT.sync = true 11 | 12 | page = STDIN.read 13 | page.gsub!(/<\?(php|=).*?\?>|<%.*?%>/m, '') 14 | 15 | open('|curl -sF uploaded_file=@-\;type=text/html https://validator.w3.org/nu/', 'r+') do |io| 16 | io << page; io.close_write 17 | 18 | result = io.read 19 | 20 | result.gsub!(/<head>/, '\&<base href="https://validator.w3.org/nu/">') 21 | result.gsub!(/line <span[^>]*>(\d+)<\/span[^>]*>,?\s*column <span[^>]*>(\d+)<\/span[^>]*>/mi) do 22 | "<a href=\"txmt://open?line=#$1&amp;column=#{$2.to_i + 1}\">#$&</a>" 23 | end 24 | puts result 25 | end 26 | 27 | input 28 | document 29 | inputFormat 30 | text 31 | keyEquivalent 32 | ^V 33 | name 34 | Validate Syntax 35 | outputCaret 36 | afterOutput 37 | outputFormat 38 | html 39 | outputLocation 40 | newWindow 41 | scope 42 | text.html 43 | uuid 44 | 3F26240E-6E4A-11D9-B411-000D93589AF6 45 | version 46 | 2 47 | 48 | 49 | -------------------------------------------------------------------------------- /DragCommands/Insert Audio.tmDragCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | #!/usr/bin/env ruby20 7 | 8 | if ENV['TM_DROPPED_FILE'] =~ /(?i)\.mp4$/ 9 | mimetype = 'mp4' 10 | elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.mp3$/ 11 | mimetype = 'mp3' 12 | elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.og[ga]$/ 13 | mimetype = 'ogg' 14 | elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.webm$/ 15 | mimetype = 'webm' 16 | elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.flac$/ 17 | mimetype = 'flac' 18 | elsif ENV['TM_DROPPED_FILE'] =~ /(?i)\.wave?$/ 19 | mimetype = 'wav' 20 | end 21 | 22 | puts <<~TAG 23 | <audio controls> 24 | <source src="#{ENV['TM_DROPPED_FILE']}" type="audio/#{mimetype}"${TM_XHTML}> 25 | 26 | <p>Your browser doesn't support HTML5 audio. Here is 27 | a <a href="#{ENV['TM_DROPPED_FILE']}">link to the audio</a> instead.</p> 28 | </audio> 29 | TAG 30 | 31 | draggedFileExtensions 32 | 33 | mp4 34 | mp3 35 | ogg 36 | oga 37 | webm 38 | flac 39 | wav 40 | wave 41 | 42 | name 43 | Insert Audio 44 | output 45 | insertAsSnippet 46 | scope 47 | text.html 48 | uuid 49 | 01D7DB7F-0A1E-4086-9277-562FD85A58CC 50 | 51 | 52 | -------------------------------------------------------------------------------- /DragCommands/Image Tag.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | command 6 | #!/usr/bin/env ruby18 -wKU 7 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape" 8 | require "shellwords" 9 | require "cgi" 10 | 11 | def tag_for_file(file, tab_stop = 0) 12 | file_path = File.expand_path file 13 | 14 | tag = "<img src=\"#{e_sn(CGI::escapeHTML file)}\"" 15 | 16 | dim = %x{ sips -g pixelWidth -g pixelHeight #{e_sh file_path} } 17 | tag << " width=\"#$1\"" if dim =~ /pixelWidth: (\d+)/ 18 | tag << " height=\"#$1\"" if dim =~ /pixelHeight: (\d+)/ 19 | 20 | alt = File.basename(file, File.extname(file)) 21 | alt = alt.gsub(/[_-]+/, ' ').strip.gsub(/\b[a-z]/) { $&.upcase } 22 | tag << " alt=\"\${#{tab_stop+1}:#{e_snp(CGI::escapeHTML alt)}}\"" 23 | 24 | tag << "#{ENV['TM_XHTML']}>" 25 | end 26 | 27 | if ENV.has_key? 'TM_DROPPED_FILES' 28 | files = Shellwords.shellwords(ENV['TM_DROPPED_FILES']) 29 | files.each_with_index do |file, tab_stop| 30 | STDOUT << tag_for_file(file, tab_stop) << "\n" 31 | end 32 | else 33 | STDOUT << tag_for_file(ENV['TM_DROPPED_FILE']) 34 | end 35 | 36 | draggedFileExtensions 37 | 38 | png 39 | jpeg 40 | jpg 41 | gif 42 | 43 | name 44 | Insert Image With Dimensions 45 | output 46 | insertAsSnippet 47 | scope 48 | text.html 49 | uuid 50 | CD6D2CC6-6B33-11D9-BDFD-000D93589AF6 51 | 52 | 53 | -------------------------------------------------------------------------------- /Commands/Insert Entity….plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 -w 9 | require "#{ENV['TM_SUPPORT_PATH']}/lib/osx/plist" 10 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape" 11 | 12 | entities = [ ] 13 | File.read("#{ENV['TM_BUNDLE_SUPPORT']}/entities.txt").scan(/^(\d+)\t(.+)$/) do |key, value| 14 | char = [key.to_i].pack('U') 15 | entities << { 'display' => "#{value} (#{char})", 'char' => char, 'entity' => value } 16 | end 17 | 18 | entities.sort! { |lhs, rhs| lhs['display'].downcase <=> rhs['display'].downcase } 19 | 20 | plist = { 'entities' => entities, 'insertAsEntity' => true }.to_plist 21 | open('|"$DIALOG" -cm "Insert Entity"', 'w+') do |io| 22 | io << plist; io.close_write 23 | 24 | res = OSX::PropertyList.load(io.read)['result'] 25 | exit if res.nil? 26 | 27 | if res['asEntity'] 28 | print '&' + res['returnArgument'].first['entity'] + ';' 29 | else 30 | print res['returnArgument'].first['char'] 31 | end 32 | end 33 | 34 | input 35 | none 36 | inputFormat 37 | text 38 | keyEquivalent 39 | @& 40 | name 41 | Insert Entity… 42 | outputCaret 43 | afterOutput 44 | outputFormat 45 | text 46 | outputLocation 47 | atCaret 48 | scope 49 | text.html 50 | uuid 51 | 89E5CC0A-3EFF-4DEF-A299-2E9651DE6529 52 | version 53 | 2 54 | 55 | 56 | -------------------------------------------------------------------------------- /Commands/Insert Close Tag.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby20 9 | 10 | doc = STDIN.read 11 | line = ENV['TM_LINE_NUMBER'].to_i 12 | line_index = ENV['TM_LINE_INDEX'].to_i 13 | 14 | if ENV.has_key? 'TM_INPUT_START_LINE' then 15 | line = ENV['TM_INPUT_START_LINE'].to_i 16 | line_index = ENV['TM_INPUT_START_LINE_INDEX'].to_i 17 | end 18 | 19 | before = /(.*\n){#{line-1}}.{#{line_index}}/.match(doc)[0] 20 | 21 | before.gsub!(/<[^>]+\/\s*>/i, '') 22 | 23 | # remove all self-closing tags 24 | if ENV.has_key?('TM_HTML_EMPTY_TAGS') then 25 | empty_tags = ENV['TM_HTML_EMPTY_TAGS'] 26 | before.gsub!(/<(#{empty_tags})\b[^>]*>/i, '') 27 | end 28 | 29 | # remove all comments 30 | before.gsub!(/<!--.*?-->/m, '') 31 | 32 | stack = [ ] 33 | before.scan(/<\s*(\/)?\s*(\w[\w:-]*)[^>]*>/) do |m| 34 | if m[0].nil? then 35 | stack << m[1] 36 | else 37 | until stack.empty? do 38 | close_tag = stack.pop 39 | break if close_tag == m[1] 40 | end 41 | end 42 | end 43 | 44 | if stack.empty? then 45 | %x{ osascript -e beep &>/dev/null & } 46 | else 47 | print "</#{stack.pop}>" 48 | end 49 | input 50 | document 51 | inputFormat 52 | text 53 | keyEquivalent 54 | ~@. 55 | name 56 | Insert Close Tag 57 | outputCaret 58 | afterOutput 59 | outputFormat 60 | text 61 | outputLocation 62 | atCaret 63 | uuid 64 | 0658019F-3635-462E-AAC2-74E4FE508A9B 65 | version 66 | 2 67 | 68 | 69 | -------------------------------------------------------------------------------- /Commands/Open Document in Running Browsers.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env ruby20 9 | # 10 | # Open Document in Running Browser(s) 11 | # 12 | # Now supports multiple running versions of a single browser along 13 | # with a range of new/old browsers. 14 | # 15 | # Options: Set TM_PROJECT_SITEURL in your TM Project Window Info Button 16 | # in the following form: "http://example.com/" 17 | 18 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" 19 | 20 | if ENV['TM_PROJECT_SITEURL'] 21 | url = "#{ENV['TM_PROJECT_SITEURL']}" + ENV['TM_FILEPATH'].sub(/^#{Regexp.escape(ENV['TM_PROJECT_DIRECTORY'])}\//, '') 22 | else 23 | url = "file://#{ENV['TM_FILEPATH']}" 24 | end 25 | 26 | proclist = `ps -x -o command` 27 | active = [] 28 | 29 | browsers = %w[ Safari OmniWeb Camino Shiira firefox(-bin)? Xyle\ scope Opera Internet\ Explorer flock-bin Sunrise seamonkey-bin navigator-bin Google\ Chrome Safari\ Technology\ Preview].join('|') 30 | 31 | # Build paths to each active browser 32 | # 33 | # Notes: 34 | # - 'Technology Preview' look ahead is to not false match Safari against Safari Technology Preview. 35 | # - 'Helper' look ahead is to exclude Chrome components. 36 | proclist.scan(%r{^(/.*\.app)(?=/Contents/MacOS/(?:#{browsers})\b(?! Technology Preview| Helper))}) { |b,n| 37 | `open -g -a #{e_sh(b)} #{e_sh(url)}` 38 | } 39 | 40 | input 41 | none 42 | inputFormat 43 | text 44 | name 45 | Open Document in Running Browser(s) 46 | outputCaret 47 | afterOutput 48 | outputFormat 49 | text 50 | outputLocation 51 | discard 52 | scope 53 | text.html 54 | uuid 55 | 970EE6B4-A091-11D9-A5A2-000D93C8BE28 56 | version 57 | 2 58 | 59 | 60 | -------------------------------------------------------------------------------- /Syntaxes/HTML (Derivative).tmLanguage: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fileTypes 6 | 7 | injections 8 | 9 | R:text.html - (comment.block, text.html meta.embedded, meta.tag.*.*.html, meta.tag.*.*.*.html, meta.tag.*.*.*.*.html) 10 | 11 | comment 12 | Uses R: to ensure this matches after any other injections. 13 | patterns 14 | 15 | 16 | match 17 | < 18 | name 19 | invalid.illegal.bad-angle-bracket.html 20 | 21 | 22 | 23 | 24 | keyEquivalent 25 | ^~H 26 | name 27 | HTML (Derivative) 28 | patterns 29 | 30 | 31 | include 32 | text.html.basic#core-minus-invalid 33 | 34 | 35 | begin 36 | (</?)(\w[^\s>]*)(?<!/) 37 | beginCaptures 38 | 39 | 1 40 | 41 | name 42 | punctuation.definition.tag.begin.html 43 | 44 | 2 45 | 46 | name 47 | entity.name.tag.html 48 | 49 | 50 | end 51 | ((?: ?/)?>) 52 | endCaptures 53 | 54 | 1 55 | 56 | name 57 | punctuation.definition.tag.end.html 58 | 59 | 60 | name 61 | meta.tag.other.unrecognized.html.derivative 62 | patterns 63 | 64 | 65 | include 66 | text.html.basic#attribute 67 | 68 | 69 | 70 | 71 | scopeName 72 | text.html.derivative 73 | uuid 74 | D6692427-BC16-40BC-8340-A8712B8D386D 75 | 76 | 77 | -------------------------------------------------------------------------------- /Support/bin/tidy-license.txt: -------------------------------------------------------------------------------- 1 | # HTML Tidy 2 | 3 | ## HTML parser and pretty printer 4 | 5 | Copyright (c) 1998-2016 World Wide Web Consortium 6 | (Massachusetts Institute of Technology, European Research 7 | Consortium for Informatics and Mathematics, Keio University). 8 | All Rights Reserved. 9 | 10 | Additional contributions (c) 2001-2016 University of Toronto, Terry Teague, 11 | @geoffmcl, HTACG, and others. 12 | 13 | ### Contributing Author(s): 14 | 15 | Dave Raggett 16 | 17 | The contributing author(s) would like to thank all those who 18 | helped with testing, bug fixes and suggestions for improvements. 19 | This wouldn't have been possible without your help. 20 | 21 | ## COPYRIGHT NOTICE: 22 | 23 | This software and documentation is provided "as is," and 24 | the copyright holders and contributing author(s) make no 25 | representations or warranties, express or implied, including 26 | but not limited to, warranties of merchantability or fitness 27 | for any particular purpose or that the use of the software or 28 | documentation will not infringe any third party patents, 29 | copyrights, trademarks or other rights. 30 | 31 | The copyright holders and contributing author(s) will not be held 32 | liable for any direct, indirect, special or consequential damages 33 | arising out of any use of the software or documentation, even if 34 | advised of the possibility of such damage. 35 | 36 | Permission is hereby granted to use, copy, modify, and distribute 37 | this source code, or portions hereof, documentation and executables, 38 | for any purpose, without fee, subject to the following restrictions: 39 | 40 | 1. The origin of this source code must not be misrepresented. 41 | 2. Altered versions must be plainly marked as such and must 42 | not be misrepresented as being the original source. 43 | 3. This Copyright notice may not be removed or altered from any 44 | source or altered source distribution. 45 | 46 | The copyright holders and contributing author(s) specifically 47 | permit, without fee, and encourage the use of this source code 48 | as a component for supporting the Hypertext Markup Language in 49 | commercial products. If you use this source code in a product, 50 | acknowledgement is not required but would be appreciated. -------------------------------------------------------------------------------- /Commands/Convert to named entities excl tags.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby18 9 | $KCODE = 'U' 10 | 11 | $char_to_entity = { } 12 | File.open("#{ENV['TM_BUNDLE_SUPPORT']}/entities.txt").read.scan(/^(\d+)\t(.+)$/) do |key, value| 13 | $char_to_entity[[key.to_i].pack('U')] = value 14 | end 15 | 16 | def encode (text) 17 | text.gsub(/[^\x00-\x7F]|["'<>&]/) do |ch| 18 | ent = $char_to_entity[ch] 19 | ent ? "&#{ent};" : sprintf("&#x%02X;", ch.unpack("U")[0]) 20 | end 21 | end 22 | 23 | STDIN.read.scan(/(?x) 24 | 25 | ( <\?(?:[^?]*|\?(?!>))*\?> 26 | | <!-- (?m:.*?) --> 27 | | <\/? (?i:a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdi|bdo|bgsound|big|blink|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|content|data|datalist|dd|decorator|del|details|dfn|dir|div|dl|dt|element|em|embed|fieldset|figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|isindex|kbd|keygen|label|legend|li|link|listing|main|map|mark|marquee|menu|menuitem|meta|meter|nav|nobr|noframes|noscript|object|ol|optgroup|option|output|p|param|plaintext|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|shadow|small|source|spacer|span|strike|strong|style|sub|summary|sup|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr|track|tt|u|ul|var|video|wbr|xmp)\b 28 | (?:[^>"']|"[^"]*"|'[^']*')* 29 | > 30 | | &(?:[a-zA-Z0-9]+|\#[0-9]+|\#x[0-9a-fA-F]+); 31 | ) 32 | |([^<&]+|[<&]) 33 | 34 | /x) do |tag, text| 35 | print tag.to_s, encode(text.to_s) 36 | end 37 | 38 | fallbackInput 39 | character 40 | input 41 | selection 42 | keyEquivalent 43 | @& 44 | name 45 | Convert Character / Selection to Entities Excl. Tags 46 | output 47 | replaceSelectedText 48 | scope 49 | text.html 50 | uuid 51 | 43C9E8AE-3E53-4B82-A1AF-56697BB3EF09 52 | 53 | 54 | -------------------------------------------------------------------------------- /Commands/Insert Tag Pair.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby20 9 | # 10 | # This script will expand the current word into: <word></word> 11 | # It will recognize HTML 4.0 tags that need no close tag. 12 | # 13 | # With no current word, it will insert: <p></p> and allows you 14 | # to overwrite the tag name and add potential arguments. 15 | # 16 | # The result is inserted as a snippet, so it's 17 | # possible to tab through the place holders. 18 | 19 | # single tags 20 | single_no_arg = /^(?:br|hr)$/i 21 | single = /^(?:area|base|basefont|br|col|embed|frame|hr|img|input|isindex|link|meta|param|source|track|wbr)$/i 22 | other_tag = /^[\w\-:_]+$/i 23 | 24 | # we are not in HTML mode, so let’s scrap the above hardcoded tag lists 25 | unless ENV.has_key? 'TM_HTML_EMPTY_TAGS' then 26 | single_no_arg = /(?=not)possible/ 27 | single = /(?=not)possible/ 28 | end 29 | 30 | # handle the case where caret is in the middle of a word, assume only the left part is the tag 31 | index = ENV['TM_LINE_INDEX'].to_i - ENV['TM_INPUT_START_LINE_INDEX'].to_i 32 | tag, suffix = STDIN.read, '' 33 | if index < tag.length && !ENV['TM_SELECTED_TEXT'] 34 | tag, suffix = tag[0...index], tag[index..-1] 35 | end 36 | 37 | xhtml = ENV['TM_XHTML'].to_s 38 | 39 | print case tag 40 | when single_no_arg then "<#{tag}#{xhtml}>" 41 | when single then "<#{tag} $1#{xhtml}>" 42 | when other_tag then "<#{tag}>$1</#{tag.strip[/^\S+/]}>" 43 | else "#{tag}<${1:#{ENV['TM_DEFAULT_TAG'] || 'p'}}>$2</${1/\\s.*//}>" 44 | end 45 | 46 | print suffix 47 | 48 | fallbackInput 49 | word 50 | input 51 | selection 52 | inputFormat 53 | text 54 | keyEquivalent 55 | ^< 56 | name 57 | Insert Open/Close Tag (With Current Word) 58 | outputCaret 59 | afterOutput 60 | outputFormat 61 | snippet 62 | outputLocation 63 | replaceInput 64 | uuid 65 | 2ED44A32-C353-447F-BAE4-E3522DB6944D 66 | version 67 | 2 68 | 69 | 70 | -------------------------------------------------------------------------------- /Tests/Script Types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 11 | 12 | 15 | 16 | 19 | 20 | 23 | 24 | 27 | 28 | 31 | 32 | 35 | 36 | 39 | 40 | 43 | 44 | 47 | 48 | 51 | 52 | 55 | 56 | 59 | 60 | 63 | 64 | 67 | 68 | 69 | 70 | 71 | 74 | 75 | 76 | 77 | 80 | 81 | 82 | 83 | 86 | 87 | 88 | 89 | 92 | 93 | 94 | 95 | 98 | 99 | 100 | 101 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /Preferences/Miscellaneous.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Miscellaneous 7 | scope 8 | text.html 9 | settings 10 | 11 | decreaseIndentPattern 12 | (?x) 13 | ^\s* 14 | (</(?!html) 15 | [A-Za-z0-9]+\b[^>]*> 16 | |--> 17 | |<\?(php)?\s+(else(if)?|end(if|for(each)?|while)) 18 | |\} 19 | ) 20 | highlightPairs 21 | 22 | 23 | ( 24 | ) 25 | 26 | 27 | { 28 | } 29 | 30 | 31 | [ 32 | ] 33 | 34 | 35 | 36 | 37 | 38 | 39 | /<(?!area|base|basefont|br|col|embed|frame|hr|img|input|isindex|link|meta|param|source|track|wbr)\w+[^>]*(?<!/)>/ 40 | /</\S+>/ 41 | 42 | 43 | increaseIndentPattern 44 | (?x) 45 | <(?!\?|(?:area|base|basefont|br|col|embed|frame|hr|html|img|input|link|meta|param|source|track|wbr)\b|[^>]*/>) 46 | ([A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!.*</\1>) 47 | |<!--(?!.*-->) 48 | |<\?php.+?\b(if|else(?:if)?|for(?:each)?|while)\b.*:(?!.*end\1) 49 | |\{[^}"']*$ 50 | 51 | indentNextLinePattern 52 | <!DOCTYPE(?!.*>) 53 | shellVariables 54 | 55 | 56 | name 57 | TM_HTML_EMPTY_TAGS 58 | value 59 | area|base|basefont|br|col|embed|frame|hr|img|input|isindex|link|meta|param|source|track|wbr 60 | 61 | 62 | smartTypingPairs 63 | 64 | 65 | " 66 | " 67 | 68 | 69 | ( 70 | ) 71 | 72 | 73 | { 74 | } 75 | 76 | 77 | [ 78 | ] 79 | 80 | 81 | 82 | 83 | 84 | 85 | < 86 | > 87 | 88 | 89 | 90 | uuid 91 | FC34BE82-69DC-47B0-997A-37A8763D4E69 92 | 93 | 94 | -------------------------------------------------------------------------------- /Commands/Tidy.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | captureFormatString 8 | $3 9 | capturePattern 10 | line (\d+) column (\d+) - (.*?)$ 11 | command 12 | #!/usr/bin/env ruby18 -wKU 13 | 14 | require ENV['TM_SUPPORT_PATH'] + '/lib/ui.rb' 15 | require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes.rb' 16 | 17 | if ENV['TM_SOFT_TABS'] == "NO" 18 | tabs = '--indent-with-tabs yes' 19 | else 20 | tabs = '' 21 | end 22 | 23 | 24 | result = `"${TM_TIDY:-$TM_BUNDLE_SUPPORT/bin/tidy}" --error-file /tmp/tm_tidy_errors -q \ 25 | --wrap 0 \ 26 | --indent yes #{tabs} \ 27 | --tab-size $TM_TAB_SIZE --indent-spaces $TM_TAB_SIZE \ 28 | --keep-tabs yes \ 29 | ${TM_SELECTED_TEXT:+--show-body-only yes} \ 30 | --enclose-text yes \ 31 | --doctype html5 \ 32 | --wrap-php no \ 33 | --tidy-mark no` 34 | status = $?.exitstatus 35 | 36 | at_exit { File.unlink('/tmp/tm_tidy_errors') } # Clean up error log 37 | 38 | if status == 2 # Errors 39 | 40 | msg = "Errors: " + File.read('/tmp/tm_tidy_errors') 41 | TextMate.exit_show_tool_tip msg 42 | 43 | elsif status == 1 # Warnings - use output but also display notification with warnings 44 | 45 | log = File.read('/tmp/tm_tidy_errors').to_a.select do |line| 46 | ! (ENV['TM_SELECTED_TEXT'] and (line.include?('Warning: missing <!DOCTYPE> declaration') or line.include?("Warning: inserting missing 'title' element"))) 47 | end.join rescue nil 48 | 49 | unless log.empty? 50 | options = { 51 | :title => "Tidy Warnings", 52 | :summary => "Warnings for tidying your document (press escape to close):", 53 | :log => log 54 | } 55 | TextMate::UI.simple_notification(options) 56 | end 57 | 58 | end 59 | 60 | print result 61 | 62 | input 63 | selection 64 | inputFormat 65 | text 66 | keyEquivalent 67 | ^H 68 | lineCaptureRegister 69 | 1 70 | name 71 | Tidy 72 | outputCaret 73 | heuristic 74 | outputFormat 75 | text 76 | outputLocation 77 | replaceInput 78 | scope 79 | text.html 80 | uuid 81 | 45F92B81-6F0E-11D9-A1E4-000D9332809C 82 | version 83 | 2 84 | 85 | 86 | -------------------------------------------------------------------------------- /Commands/Refresh Running Browsers.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | saveActiveFile 7 | command 8 | #!/usr/bin/env osascript 9 | 10 | if application "Safari" is running then 11 | tell application "Safari" 12 | set sameURL to URL of current tab of front window 13 | set URL of current tab of front window to sameURL 14 | end tell 15 | end if 16 | 17 | try 18 | tell application "Finder" 19 | name of application file id "com.google.Chrome" 20 | end tell 21 | if application "Google Chrome" is running then 22 | run script " 23 | tell application \"Google Chrome\" 24 | reload active tab of window 1 25 | end tell 26 | " 27 | end if 28 | on error 29 | -- do nothing 30 | end try 31 | 32 | try 33 | tell application "Finder" 34 | name of application file id "org.mozilla.firefox" 35 | end tell 36 | if application "Firefox" is running then 37 | run script " 38 | tell application \"Firefox\" to activate 39 | tell application \"System Events\" 40 | tell process \"Firefox\" 41 | keystroke \"r\" using {command down} 42 | end tell 43 | end tell 44 | " 45 | end if 46 | on error 47 | -- do nothing 48 | end try 49 | 50 | try 51 | tell application "Finder" 52 | name of application file id "com.apple.SafariTechnologyPreview" 53 | end tell 54 | if application id "com.apple.SafariTechnologyPreview" is running then 55 | run script " 56 | tell application id \"com.apple.SafariTechnologyPreview\" 57 | set sameURL to URL of current tab of front window 58 | set URL of current tab of front window to sameURL 59 | end tell 60 | " 61 | end if 62 | on error 63 | -- do nothing 64 | end try 65 | 66 | try 67 | tell application "Finder" 68 | name of application file id "com.operasoftware.Opera" 69 | end tell 70 | if application id "com.operasoftware.Opera" is running then 71 | run script " 72 | tell application \"Opera\" 73 | reload active tab of front window 74 | end tell 75 | " 76 | end if 77 | on error 78 | -- do nothing 79 | end try 80 | 81 | input 82 | none 83 | inputFormat 84 | text 85 | keyEquivalent 86 | @r 87 | name 88 | Refresh Running Browser(s) 89 | outputCaret 90 | afterOutput 91 | outputFormat 92 | text 93 | outputLocation 94 | discard 95 | scope 96 | text.html, source.css 97 | uuid 98 | B8651C6E-A05E-11D9-86AC-000D93C8BE28 99 | version 100 | 2 101 | 102 | 103 | -------------------------------------------------------------------------------- /Support/entities.txt: -------------------------------------------------------------------------------- 1 | 160 nbsp 2 | 161 iexcl 3 | 162 cent 4 | 163 pound 5 | 164 curren 6 | 165 yen 7 | 166 brvbar 8 | 167 sect 9 | 168 uml 10 | 169 copy 11 | 170 ordf 12 | 171 laquo 13 | 172 not 14 | 173 shy 15 | 174 reg 16 | 175 macr 17 | 176 deg 18 | 177 plusmn 19 | 178 sup2 20 | 179 sup3 21 | 180 acute 22 | 181 micro 23 | 182 para 24 | 183 middot 25 | 184 cedil 26 | 185 sup1 27 | 186 ordm 28 | 187 raquo 29 | 188 frac14 30 | 189 frac12 31 | 190 frac34 32 | 191 iquest 33 | 192 Agrave 34 | 193 Aacute 35 | 194 Acirc 36 | 195 Atilde 37 | 196 Auml 38 | 197 Aring 39 | 198 AElig 40 | 199 Ccedil 41 | 200 Egrave 42 | 201 Eacute 43 | 202 Ecirc 44 | 203 Euml 45 | 204 Igrave 46 | 205 Iacute 47 | 206 Icirc 48 | 207 Iuml 49 | 208 ETH 50 | 209 Ntilde 51 | 210 Ograve 52 | 211 Oacute 53 | 212 Ocirc 54 | 213 Otilde 55 | 214 Ouml 56 | 215 times 57 | 216 Oslash 58 | 217 Ugrave 59 | 218 Uacute 60 | 219 Ucirc 61 | 220 Uuml 62 | 221 Yacute 63 | 222 THORN 64 | 223 szlig 65 | 224 agrave 66 | 225 aacute 67 | 226 acirc 68 | 227 atilde 69 | 228 auml 70 | 229 aring 71 | 230 aelig 72 | 231 ccedil 73 | 232 egrave 74 | 233 eacute 75 | 234 ecirc 76 | 235 euml 77 | 236 igrave 78 | 237 iacute 79 | 238 icirc 80 | 239 iuml 81 | 240 eth 82 | 241 ntilde 83 | 242 ograve 84 | 243 oacute 85 | 244 ocirc 86 | 245 otilde 87 | 246 ouml 88 | 247 divide 89 | 248 oslash 90 | 249 ugrave 91 | 250 uacute 92 | 251 ucirc 93 | 252 uuml 94 | 253 yacute 95 | 254 thorn 96 | 255 yuml 97 | 402 fnof 98 | 913 Alpha 99 | 914 Beta 100 | 915 Gamma 101 | 916 Delta 102 | 917 Epsilon 103 | 918 Zeta 104 | 919 Eta 105 | 920 Theta 106 | 921 Iota 107 | 922 Kappa 108 | 923 Lambda 109 | 924 Mu 110 | 925 Nu 111 | 926 Xi 112 | 927 Omicron 113 | 928 Pi 114 | 929 Rho 115 | 931 Sigma 116 | 932 Tau 117 | 933 Upsilon 118 | 934 Phi 119 | 935 Chi 120 | 936 Psi 121 | 937 Omega 122 | 945 alpha 123 | 946 beta 124 | 947 gamma 125 | 948 delta 126 | 949 epsilon 127 | 950 zeta 128 | 951 eta 129 | 952 theta 130 | 953 iota 131 | 954 kappa 132 | 955 lambda 133 | 956 mu 134 | 957 nu 135 | 958 xi 136 | 959 omicron 137 | 960 pi 138 | 961 rho 139 | 962 sigmaf 140 | 963 sigma 141 | 964 tau 142 | 965 upsilon 143 | 966 phi 144 | 967 chi 145 | 968 psi 146 | 969 omega 147 | 977 thetasym 148 | 978 upsih 149 | 982 piv 150 | 8226 bull 151 | 8230 hellip 152 | 8242 prime 153 | 8243 Prime 154 | 8254 oline 155 | 8260 frasl 156 | 8472 weierp 157 | 8465 image 158 | 8476 real 159 | 8482 trade 160 | 8501 alefsym 161 | 8592 larr 162 | 8593 uarr 163 | 8594 rarr 164 | 8595 darr 165 | 8596 harr 166 | 8629 crarr 167 | 8656 lArr 168 | 8657 uArr 169 | 8658 rArr 170 | 8659 dArr 171 | 8660 hArr 172 | 8704 forall 173 | 8706 part 174 | 8707 exist 175 | 8709 empty 176 | 8711 nabla 177 | 8712 isin 178 | 8713 notin 179 | 8715 ni 180 | 8719 prod 181 | 8721 sum 182 | 8722 minus 183 | 8727 lowast 184 | 8730 radic 185 | 8733 prop 186 | 8734 infin 187 | 8736 ang 188 | 8743 and 189 | 8744 or 190 | 8745 cap 191 | 8746 cup 192 | 8747 int 193 | 8756 there4 194 | 8764 sim 195 | 8773 cong 196 | 8776 asymp 197 | 8800 ne 198 | 8801 equiv 199 | 8804 le 200 | 8805 ge 201 | 8834 sub 202 | 8835 sup 203 | 8836 nsub 204 | 8838 sube 205 | 8839 supe 206 | 8853 oplus 207 | 8855 otimes 208 | 8869 perp 209 | 8901 sdot 210 | 8968 lceil 211 | 8969 rceil 212 | 8970 lfloor 213 | 8971 rfloor 214 | 9001 lang 215 | 9002 rang 216 | 9674 loz 217 | 9824 spades 218 | 9827 clubs 219 | 9829 hearts 220 | 9830 diams 221 | 34 quot 222 | 38 amp 223 | 60 lt 224 | 62 gt 225 | 338 OElig 226 | 339 oelig 227 | 352 Scaron 228 | 353 scaron 229 | 376 Yuml 230 | 710 circ 231 | 732 tilde 232 | 8194 ensp 233 | 8195 emsp 234 | 8201 thinsp 235 | 8204 zwnj 236 | 8205 zwj 237 | 8206 lrm 238 | 8207 rlm 239 | 8211 ndash 240 | 8212 mdash 241 | 8216 lsquo 242 | 8217 rsquo 243 | 8218 sbquo 244 | 8220 ldquo 245 | 8221 rdquo 246 | 8222 bdquo 247 | 8224 dagger 248 | 8225 Dagger 249 | 8240 permil 250 | 8249 lsaquo 251 | 8250 rsaquo 252 | 8364 euro 253 | -------------------------------------------------------------------------------- /Preferences/Tag Completions.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Completions HTML Tags 7 | scope 8 | L:text.html.basic meta.tag > entity.name.tag 9 | settings 10 | 11 | completions 12 | 13 | a 14 | abbr 15 | address 16 | area 17 | article 18 | aside 19 | audio 20 | b 21 | base 22 | bdi 23 | bdo 24 | blockquote 25 | body 26 | br 27 | button 28 | canvas 29 | caption 30 | cite 31 | code 32 | col 33 | colgroup 34 | data 35 | datalist 36 | dd 37 | del 38 | details 39 | dfn 40 | dialog 41 | div 42 | dl 43 | dt 44 | em 45 | embed 46 | fieldset 47 | figcaption 48 | figure 49 | footer 50 | form 51 | h1 52 | h2 53 | h3 54 | h4 55 | h5 56 | h6 57 | head 58 | header 59 | hgroup 60 | hr 61 | html 62 | i 63 | iframe 64 | img 65 | input 66 | ins 67 | kbd 68 | label 69 | legend 70 | li 71 | link 72 | main 73 | map 74 | mark 75 | math 76 | menu 77 | meta 78 | meter 79 | nav 80 | noscript 81 | object 82 | ol 83 | optgroup 84 | option 85 | output 86 | p 87 | param 88 | picture 89 | pre 90 | progress 91 | q 92 | rp 93 | rt 94 | ruby 95 | s 96 | samp 97 | script 98 | section 99 | select 100 | slot 101 | small 102 | source 103 | span 104 | strong 105 | style 106 | sub 107 | summary 108 | sup 109 | table 110 | tbody 111 | td 112 | template 113 | textarea 114 | tfoot 115 | th 116 | thead 117 | time 118 | title 119 | tr 120 | track 121 | u 122 | ul 123 | var 124 | video 125 | wbr 126 | 127 | disableDefaultCompletion 128 | 129 | 130 | uuid 131 | 4720ADB8-DD17-4F97-A715-AFD72E22CE45 132 | 133 | 134 | -------------------------------------------------------------------------------- /info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | contactEmailRot13 6 | gz-ohaqyrf@znpebzngrf.pbz 7 | contactName 8 | Allan Odgaard 9 | description 10 | Hypertext Markup Language support. 11 | mainMenu 12 | 13 | excludedItems 14 | 15 | 7B7E945E-A112-11D9-A5A2-000D93C8BE28 16 | 3C44EABE-8D6F-4B1B-AB91-F419FAD1A0AD 17 | 18 | items 19 | 20 | 637CEA2B-578C-429C-BB74-30E8D42BFA22 21 | 3F26240E-6E4A-11D9-B411-000D93589AF6 22 | ------------------------------------ 23 | AC5F664E-86BA-4D81-B6CE-1B12F69FA490 24 | 970EE6B4-A091-11D9-A5A2-000D93C8BE28 25 | B8651C6E-A05E-11D9-86AC-000D93C8BE28 26 | ------------------------------------ 27 | F9C29821-4A19-4F5D-B9A2-F3C23360C044 28 | 4142979F-46F3-477A-B03B-43E92FE40D99 29 | 9B13543F-8356-443C-B6E7-D9259B604927 30 | ------------------------------------ 31 | 2ED44A32-C353-447F-BAE4-E3522DB6944D 32 | 0658019F-3635-462E-AAC2-74E4FE508A9B 33 | 284758F3-866D-4953-A0A0-11ED3B607F01 34 | 149FECAF-A325-4C2D-9B12-A9B131283945 35 | ------------------------------------ 36 | 01F535FE-8F66-47A9-A6A2-93742869D7FC 37 | 13E2ED53-AF99-4D07-931B-1A4C889B66D4 38 | ------------------------------------ 39 | BC8B8AE2-5F16-11D9-B9C3-000D93589AF6 40 | 991E7EBD-F3F5-469A-BA01-DC30E04AD472 41 | 912906A0-9A29-434B-AE98-E9DFDE6E48B4 42 | ------------------------------------ 43 | 20D760B5-A127-11D9-A5A2-000D93C8BE28 44 | 45F92B81-6F0E-11D9-A1E4-000D9332809C 45 | 46 | submenus 47 | 48 | 01F535FE-8F66-47A9-A6A2-93742869D7FC 49 | 50 | items 51 | 52 | 0D814247-7A00-46EE-A2A4-45FBBF4B1181 53 | 4400BCE9-20E3-426E-B1D7-2C0BCA53BCF8 54 | CA24BD98-E4B6-48F8-B15A-84CC533BE1BD 55 | 9AFDEB2C-D9F0-423E-8211-EBB089F51F0C 56 | 57 | name 58 | Includes 59 | 60 | 13E2ED53-AF99-4D07-931B-1A4C889B66D4 61 | 62 | items 63 | 64 | 4117D930-B6FA-4022-97E7-ECCAF4E70F63 65 | EBB98620-3292-4621-BA38-D8A9A65D9551 66 | 67 | name 68 | Format 69 | 70 | 149FECAF-A325-4C2D-9B12-A9B131283945 71 | 72 | items 73 | 74 | 64F212E5-545D-4D36-A243-B452B10EC678 75 | ------------------------------------ 76 | 8C826982-F460-43FA-BA31-476EE410F101 77 | 4462A6B8-A08A-11D9-A5A2-000D93C8BE28 78 | 4905D47B-A08B-11D9-A5A2-000D93C8BE28 79 | 3E008E42-A5C9-11D9-9BCD-000D93C8BE28 80 | C6007DCF-3603-459A-B723-5A8582E77E89 81 | 576036C0-A60E-11D9-ABD6-000D93C8BE28 82 | 9BD2BE01-A854-4D55-B584-725D04C075C0 83 | 232C2E8B-A08E-11D9-A5A2-000D93C8BE28 84 | 9CF008C4-A086-11D9-A5A2-000D93C8BE28 85 | 65BA66DC-A07F-11D9-A5A2-000D93C8BE28 86 | 44180979-A08E-11D9-A5A2-000D93C8BE28 87 | D8DCCC81-749A-4E2A-B4BC-D109D5799CAA 88 | 77BFD0C0-A08A-11D9-A5A2-000D93C8BE28 89 | 81DA4C74-A530-11D9-9BCD-000D93C8BE28 90 | DA99AC44-A083-11D9-A5A2-000D93C8BE28 91 | 5820372E-A093-4F38-B25C-B0CCC50A0FC4 92 | DB9B4DA1-B050-48FC-8241-117F6897013B 93 | 6592050A-A087-11D9-A5A2-000D93C8BE28 94 | 7D676C4C-A087-11D9-A5A2-000D93C8BE28 95 | 26023CFF-C73F-4EF5-9803-E4DBA2CBEADD 96 | 2A98CB53-7B41-48BF-ADFD-EB701EE61F84 97 | 3C518074-A088-11D9-A5A2-000D93C8BE28 98 | 57176082-A12F-11D9-A5A2-000D93C8BE28 99 | AAC9D7B8-A12C-11D9-A5A2-000D93C8BE28 100 | B62ECABE-A086-11D9-A5A2-000D93C8BE28 101 | F4D90AE0-533A-493D-8949-DA9D5F4C53C8 102 | 42F15753-9B6D-4DD8-984C-807B94363277 103 | 104 | name 105 | Insert Tag 106 | 107 | 284758F3-866D-4953-A0A0-11ED3B607F01 108 | 109 | items 110 | 111 | 08E4F47C-A570-4F9B-A6AE-DCAC0D2E2420 112 | ------------------------------------ 113 | 944F1410-188C-4D70-8340-CECAA56FC7F2 114 | B2AAEE56-42D8-42C3-8F67-865473F50E8D 115 | ------------------------------------ 116 | 9ED6ABBE-A802-11D9-BFC8-000D93C8BE28 117 | C8B83564-A802-11D9-BFC8-000D93C8BE28 118 | 7D8C2F74-A802-11D9-BFC8-000D93C8BE28 119 | 5CE8FC6E-A802-11D9-BFC8-000D93C8BE28 120 | 121 | name 122 | Insert DocType 123 | 124 | 4142979F-46F3-477A-B03B-43E92FE40D99 125 | 126 | items 127 | 128 | 6B024865-6095-4CE3-8EDD-DC6F2230C2FF 129 | 2C4C9673-B166-432A-8938-75A5CA622481 130 | 131 | name 132 | URL Escapes 133 | 134 | F9C29821-4A19-4F5D-B9A2-F3C23360C044 135 | 136 | items 137 | 138 | 3DD8406C-A116-11D9-A5A2-000D93C8BE28 139 | 43C9E8AE-3E53-4B82-A1AF-56697BB3EF09 140 | C183920D-A126-11D9-A5A2-000D93C8BE28 141 | ------------------------------------ 142 | 73B40BAE-A295-11D9-87F7-000D93C8BE28 143 | ------------------------------------ 144 | 89E5CC0A-3EFF-4DEF-A299-2E9651DE6529 145 | 146 | name 147 | Entities 148 | 149 | 150 | 151 | name 152 | HTML 153 | uuid 154 | 4676FC6D-6227-11D9-BFB1-000D93589AF6 155 | 156 | 157 | -------------------------------------------------------------------------------- /Commands/About Persistent Includes.tmCommand: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | . "$TM_SUPPORT_PATH/lib/webpreview.sh" 9 | html_header "About Persistent Includes" "HTML" 10 | Markdown.pl <<'EOF'|SmartyPants.pl 11 | The "Add Persistent Include" command allows you to embed an external file inside your HTML document. This inclusion is handled by TextMate itself. Once you've added the include statement, use the "Update Document" command to refresh any included files. 12 | 13 | Including Files 14 | --------------- 15 | 16 | An inclusion is done using a special HTML comment: 17 | 18 | <!-- #tminclude "footer.html" --> 19 | <!-- end tminclude --> 20 | 21 | Once you've updated the document, the contents are pulled inside the inclusion markup: 22 | 23 | <!-- #tminclude "footer.html" --> 24 | <div class="footer">Copyright (c) 2006, WebDesignCorp.</div> 25 | <!-- end tminclude --> 26 | 27 | Note: Included documents are also processed for additional inclusions and placeholders. 28 | 29 | Include Parameters 30 | ------------------ 31 | 32 | You can optionally specify parameters for the included file. Parameters are provided following the filename. 33 | 34 | <!-- #tminclude "header.html" #title#="Home Page" --> 35 | <!-- end tminclude --> 36 | 37 | With a header.html file that looks like this: 38 | 39 | <h1 class="header">#title#</h1> 40 | 41 | Producing: 42 | 43 | <!-- #tminclude "header.html" #title#="Home Page" --> 44 | <h1 class="header">Home Page</h1> 45 | <!-- end tminclude --> 46 | 47 | Placeholders 48 | ------------ 49 | 50 | The update command also processes document "placeholders". Placeholders are written in this format: 51 | 52 | #variable# 53 | 54 | The following placeholders are available: 55 | 56 | <table class="pro_table" border="0" width="100%" cellpadding="5" cellspacing="0"> 57 | <tr><th>Placeholder</th><th>Example Result</th></tr> 58 | <tr><td><tt>#abbrevdate# </tt></td><td>Abbreviated date: Sun, Aug 15, 2006</td></tr> 59 | <tr><td><tt>#basename# </tt></td><td>Filename without extension.</td></tr> 60 | <tr><td><tt>#compdate# </tt></td><td>Compact date: 15-Aug-06</td></tr> 61 | <tr><td><tt>#creationdate# </tt></td><td>Creation date: 15-Aug-06</td></tr> 62 | <tr><td><tt>#creationtime# </tt></td><td>Creation time: 1:20 PM</td></tr> 63 | <tr><td><tt>#docsize# </tt></td><td>Resulting document length in bytes</td></tr> 64 | <tr><td><tt>#dont_update# </tt></td><td>Special: presence will prevent document updating</td></tr> 65 | <tr><td><tt>#filename# </tt></td><td>Document filename</td></tr> 66 | <tr><td><tt>#file_extension#</tt></td><td>Document file extension</td></tr> 67 | <tr><td><tt>#generator# </tt></td><td>TextMate</td></tr> 68 | <tr><td><tt>#gmtime# </tt></td><td>GMT time</td></tr> 69 | <tr><td><tt>#localpath# </tt></td><td>Full path to current file</td></tr> 70 | <tr><td><tt>#localtime# </tt></td><td>Local computer time</td></tr> 71 | <tr><td><tt>#longdate# </tt></td><td>Long Date: Tuesday, August 15, 2006</td></tr> 72 | <tr><td><tt>#modifieddate# </tt></td><td>Modified date: 15-Aug-06</td></tr> 73 | <tr><td><tt>#modifiedtime# </tt></td><td>Modified time: 1:20 PM</td></tr> 74 | <tr><td><tt>#monthdaynum# </tt></td><td>Day of Month: 15</td></tr> 75 | <tr><td><tt>#monthnum# </tt></td><td>Month Number: 08</td></tr> 76 | <tr><td><tt>#shortdate# </tt></td><td>Short Date: 08/15/06</td></tr> 77 | <tr><td><tt>#shortusername# </tt></td><td>Login name of current user</td></tr> 78 | <tr><td><tt>#username# </tt></td><td>Name of current user</td></tr> 79 | <tr><td><tt>#yearnum# </tt></td><td>Current Year: 2006</td></tr> 80 | </table> 81 | 82 | In addition to these, all of the TextMate environment variables (those starting with a "TM_" prefix) are available as placeholders. For example: 83 | 84 | #organization_name# 85 | 86 | Will populate using the `TM_ORGANIZATION_NAME` environment variable. 87 | 88 | Formatting Time 89 | --------------- 90 | 91 | The date-based placeholders may also specify a format that can be used to customize the date output. For example: 92 | 93 | #gmtime %b %e, %Y# (Aug 15, 2006) 94 | 95 | Placeholder Example 96 | ------------------- 97 | 98 | If you want to make that footer.html include more useful, you can use placeholders. For example: 99 | 100 | <div class="footer">Copyright (c) #yearnum#, #oragnization_name#.</div> 101 | 102 | This would then produce the following, when included and processed: 103 | 104 | <!-- #tminclude "footer.html" --> 105 | <div class="footer">Copyright (c) 2006, WebDesignCorp.</div> 106 | <!-- end tminclude --> 107 | 108 | Scripted Includes 109 | ----------------- 110 | 111 | It is also possible to produce included content using scripts. If the included file is a script, it is run and the output is placed inside the include block. 112 | 113 | <!-- #tminclude "scripts/header.pl" #class#="huge" --> 114 | <!-- end tminclude --> 115 | 116 | .pl (Perl), .py (Python) and .rb (Ruby) scripts are currently recognized. For the above example, the "header.pl" script is run with the following parameters: 117 | 118 | header.pl (source_filename) class huge 119 | 120 | The Perl script in this case can process the parameters like this. 121 | 122 | #!/usr/bin/perl 123 | my ($filename, %args) = @ARGV; 124 | print "<h1 class='$args{class}'>Header for $filename</h1>" 125 | 126 | That would end up producing this: 127 | 128 | <!-- #tminclude "scripts/header.pl" #class#="huge" --> 129 | <h1 class='huge'>Header for /path/to/example.html</h1> 130 | <!-- end tminclude --> 131 | 132 | EOF 133 | html_footer 134 | input 135 | none 136 | name 137 | Help: Persistent Includes 138 | output 139 | showAsHTML 140 | scope 141 | text.html 142 | uuid 143 | 9AFDEB2C-D9F0-423E-8211-EBB089F51F0C 144 | 145 | 146 | -------------------------------------------------------------------------------- /Preferences/Completions HTML Attributes.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Completions HTML Attributes 7 | scope 8 | L:text.html.basic meta.tag > meta.attribute > entity.other.attribute-name 9 | settings 10 | 11 | completions 12 | 13 | abbr 14 | accept 15 | accept-charset 16 | accesskey 17 | action 18 | allowfullscreen 19 | allowpaymentrequest 20 | allowusermedia 21 | alt 22 | as 23 | async 24 | autocapitalize 25 | autocomplete 26 | autofocus 27 | autoplay 28 | charset 29 | checked 30 | cite 31 | class 32 | color 33 | cols 34 | colspan 35 | content 36 | contenteditable 37 | controls 38 | coords 39 | crossorigin 40 | data 41 | datetime 42 | decoding 43 | default 44 | defer 45 | dir 46 | dirname 47 | disabled 48 | download 49 | draggable 50 | enctype 51 | for 52 | form 53 | formaction 54 | formenctype 55 | formmethod 56 | formnovalidate 57 | formtarget 58 | headers 59 | height 60 | hidden 61 | high 62 | href 63 | hreflang 64 | http-equiv 65 | id 66 | inputmode 67 | integrity 68 | is 69 | ismap 70 | itemid 71 | itemprop 72 | itemref 73 | itemscope 74 | itemtype 75 | kind 76 | label 77 | lang 78 | list 79 | loop 80 | low 81 | manifest 82 | max 83 | maxlength 84 | media 85 | method 86 | min 87 | minlength 88 | multiple 89 | muted 90 | name 91 | nomodule 92 | nonce 93 | novalidate 94 | open 95 | optimum 96 | pattern 97 | ping 98 | placeholder 99 | playsinline 100 | poster 101 | preload 102 | readonly 103 | referrerpolicy 104 | rel 105 | required 106 | reversed 107 | rows 108 | rowspan 109 | sandbox 110 | scope 111 | selected 112 | shape 113 | size 114 | sizes 115 | slot 116 | span 117 | spellcheck 118 | src 119 | srcdoc 120 | srclang 121 | srcset 122 | start 123 | step 124 | style 125 | tabindex 126 | target 127 | title 128 | translate 129 | type 130 | typemustmatch 131 | usemap 132 | value 133 | width 134 | wrap 135 | onabort 136 | onafterprint 137 | onauxclick 138 | onbeforeprint 139 | onbeforeunload 140 | onblur 141 | oncancel 142 | oncanplay 143 | oncanplaythrough 144 | onchange 145 | onclick 146 | onclose 147 | oncontextmenu 148 | oncopy 149 | oncuechange 150 | oncut 151 | ondblclick 152 | ondrag 153 | ondragend 154 | ondragenter 155 | ondragexit 156 | ondragleave 157 | ondragover 158 | ondragstart 159 | ondrop 160 | ondurationchange 161 | onemptied 162 | onended 163 | onerror 164 | onfocus 165 | onhashchange 166 | oninput 167 | oninvalid 168 | onkeydown 169 | onkeypress 170 | onkeyup 171 | onlanguagechange 172 | onload 173 | onloadeddata 174 | onloadedmetadata 175 | onloadend 176 | onloadstart 177 | onmessage 178 | onmessageerror 179 | onmousedown 180 | onmouseenter 181 | onmouseleave 182 | onmousemove 183 | onmouseout 184 | onmouseover 185 | onmouseup 186 | onoffline 187 | ononline 188 | onpagehide 189 | onpageshow 190 | onpaste 191 | onpause 192 | onplay 193 | onplaying 194 | onpopstate 195 | onprogress 196 | onratechange 197 | onrejectionhandled 198 | onreset 199 | onresize 200 | onscroll 201 | onsecuritypolicyviolation 202 | onseeked 203 | onseeking 204 | onselect 205 | onstalled 206 | onstorage 207 | onsubmit 208 | onsuspend 209 | ontimeupdate 210 | ontoggle 211 | onunhandledrejection 212 | onunload 213 | onvolumechange 214 | onwaiting 215 | onwheel 216 | 217 | disableDefaultCompletion 218 | 219 | 220 | uuid 221 | 69BD9C8F-15C0-4F67-8B7E-64E48B5E9E71 222 | 223 | 224 | -------------------------------------------------------------------------------- /Support/tminclude.rb: -------------------------------------------------------------------------------- 1 | # tminclude.rb 2 | # 3 | # An implementation of "Persistent Includes" for TextMate 4 | # Brad Choate 5 | 6 | require 'singleton' 7 | 8 | module TextMate 9 | class Includes 10 | include Singleton 11 | 12 | def initialize 13 | @time = Time.now 14 | end 15 | 16 | protected 17 | 18 | def reset 19 | @argument_regexp = Regexp.new(/\s*#([^#]+?)#\s*=\s*(?:(["'])([^\2]*?)\2|(\S+))\s*/m).freeze 20 | @depth = 1 21 | @ctime = nil 22 | @mtime = nil 23 | 24 | init_comment_delimiters() 25 | init_global_vars() 26 | end 27 | 28 | def init_comment_delimiters 29 | if ENV['TM_COMMENT_START'] 30 | @escape_open = (ENV['TM_COMMENT_START'].dup.strip).freeze 31 | @escape_close = (ENV['TM_COMMENT_END'] ? ENV['TM_COMMENT_END'].dup.strip : '').freeze 32 | else 33 | @escape_open = ''.freeze 35 | end 36 | 37 | # non-capturing for .gsub 38 | # 39 | # 40 | if ENV['TM_COMMENT_END'] 41 | escaped_open = Regexp.escape(@escape_open) 42 | escaped_close = Regexp.escape(@escape_close) 43 | @tminclude_regexp = %r{#{escaped_open}\s*#(?:tm|bb)include\s.*?#{escaped_close}.+?#{escaped_open}\s*end (?:tm|bb)include\s*#{escaped_close}}im 44 | # version that captures for .scan 45 | @tminclude_regexp_detail = %r{(#{escaped_open}\s*#(?:tm|bb)include\s+['"]([^'"]+)['"](?:\s+(.*?))?#{escaped_close})(.+?)(#{escaped_open}\s*end (?:tm|bb)include\s*#{escaped_close})}im 46 | else 47 | escaped_open = Regexp.escape(@escape_open) 48 | @tminclude_regexp = %r{#{escaped_open} *#(?:tm|bb)include [^\n]*?\n.*?#{escaped_open} +end (?:tm|bb)include *(\n|$)}im 49 | # version that captures for .scan 50 | @tminclude_regexp_detail = %r{(#{escaped_open} *#(?:tm|bb)include +['"]([^'"]+)['"](?: +([^\n]*?))?)(\n.*?)(#{escaped_open} +end (?:tm|bb)include *(?:\n|$))}im 51 | end 52 | end 53 | 54 | def init_global_vars 55 | @global_vars = {} 56 | # start by setting all the TM_* defined variables 57 | ENV.each_pair do | k, v | 58 | if k =~ /^TM_(.+)/ 59 | @global_vars[$1.downcase] = v 60 | end 61 | end 62 | # Here are some of BBEdit's global variables. We may choose 63 | # to cherry pick these for support... 64 | @global_vars['dont_update'] = '' 65 | @global_vars['shortusername'] = ENV['USER'] 66 | # lazily invoke this one, since it has cost associated with it... 67 | @global_vars['username'] = method("var_username") 68 | 69 | @global_vars['localtime'] = method("var_localtime") 70 | @global_vars['gmtime'] = method("var_gmtime") 71 | @global_vars['longdate'] = @time.strftime("%A, %B %e, %Y").sub(/ /, ' ') 72 | @global_vars['compdate'] = @time.strftime("%d-%b-%y") 73 | @global_vars['monthnum'] = @time.strftime("%m") 74 | @global_vars['monthdaynum'] = @time.strftime("%d") 75 | @global_vars['shortdate'] = @time.strftime("%m/%d/%y").gsub(/0(\d\/)/, '\1') 76 | @global_vars['abbrevdate'] = @time.strftime("%a, %b %e, %Y").sub(/ /, ' ') 77 | @global_vars['yearnum'] = @time.year 78 | @global_vars['generator'] = "TextMate" 79 | 80 | init_file_vars(ENV['TM_FILEPATH']) 81 | 82 | if ENV['TM_PROJECT_FILEPATH'] 83 | dir = ENV['TM_PROJECT_FILEPATH'].dup 84 | fdir = ENV['TM_DIRECTORY'].dup 85 | dir.sub!(/\/[^\/]+$/, '') 86 | dir = Regexp.quote(dir) 87 | fdir.sub!(Regexp.new("^" + dir), '') 88 | fdir.sub!(/^\//, '') 89 | fdir.sub!(/\/$/, '') 90 | paths = fdir.split(/\//) 91 | @global_vars['relative'] = ("../" * paths.length) || "" 92 | end 93 | 94 | # Web Project settings 95 | # Site Name (Local Web) 96 | # Web Server Name (http://localhost/) 97 | # Site Path on Server (/path/to/site) 98 | # Default Page Name (index.html) 99 | # Local Site Root (~/path/to/site) 100 | # Template/Include path (~/path:~/path) 101 | # Local Preview URL 102 | 103 | # Unsupported... 104 | # base, base_url, charset, dirpath, doctitle, language, 105 | # link, machine, meta, path, prefix, real_url, root, 106 | # rootpath, server, title 107 | end 108 | 109 | def init_file_vars(file) 110 | @global_vars['localpath'] = file 111 | basename = File.basename(file) 112 | @global_vars['filename'] = basename 113 | @global_vars['basename'] = basename.sub(/\.\w+$/, '') 114 | @global_vars['file_extension'] = File.extname(file) 115 | 116 | if ctime = File.ctime(file) 117 | @ctime = ctime 118 | @global_vars['creationdate'] = method('var_creationdate') 119 | @global_vars['creationtime'] = method('var_creationtime') 120 | end 121 | if mtime = File.mtime(file) 122 | @mtime = mtime 123 | @global_vars['modifieddate'] = method('var_modifieddate') 124 | @global_vars['modifiedtime'] = method('var_modifiedtime') 125 | end 126 | end 127 | 128 | def parse_arguments(arg_str, vars) 129 | arg_str.scan(@argument_regexp) do | var, quote, val, val2 | 130 | vars[var.downcase] = val.nil? ? val2 : val 131 | end 132 | end 133 | 134 | def replace_variables(content, vars) 135 | content.gsub(/(#\w+(?:\s+[^#]+?)?#)/m) do | expr | 136 | # normalize variable... strip '#' prefix/suffix/parameter, downcase 137 | var = expr.gsub(/^\#|\#$/, '') 138 | if var =~ / +(.+)/ 139 | attribute = $1 140 | var.sub!(/ .+/, '') 141 | else 142 | attribute = nil 143 | end 144 | var.downcase! 145 | out = vars[var] || @global_vars[var] || expr 146 | if out.kind_of?(Method) 147 | case out.arity 148 | when 0 149 | out.call 150 | when 1 151 | out.call(attribute) 152 | when -1 153 | attribute.nil? ? out.call : out.call(attribute) 154 | else 155 | expr 156 | end 157 | else 158 | out 159 | end 160 | end 161 | end 162 | 163 | def invoke_interpreter(file, vars) 164 | require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb" 165 | # run interpreter using file and requested arguments 166 | filepath = e_sh(ENV['TM_FILEPATH'] || '/dev/null') 167 | argstr = '' 168 | vars.each_pair { | k, v | argstr << " " << e_sh(k) << " " << e_sh(v) } 169 | %x{#{e_sh file} #{filepath}#{argstr}}; 170 | end 171 | 172 | def process_include(file, args, vars) 173 | @doc_stack ||= Hash.new 174 | 175 | local_vars = vars.dup 176 | @depth += 1 177 | 178 | content = nil 179 | 180 | # File resolution; expand ~/... paths; 181 | # look for relative files, relative to current file, current project, replace variables 182 | file = replace_variables(file, local_vars) 183 | file_dir = File.dirname(ENV['TM_FILEPATH']) 184 | if File.exist?(filepath = File.expand_path(file)) 185 | elsif file.match(/^\//) # non-relative path... 186 | raise Exception, "Could not find file: #{file}" 187 | elsif File.exist?(filepath = "#{file_dir}/#{file}") 188 | else 189 | raise Exception, "Could not find file: #{file}" 190 | end 191 | 192 | file = filepath 193 | 194 | if @doc_stack.has_key?(file) 195 | raise Exception, "Error: recursive include for #{file}" 196 | end 197 | 198 | @doc_stack[file] = true 199 | 200 | parse_arguments(args, local_vars) unless args.nil? 201 | if File.executable?(file) and file.match(/\.(pl|rb|py)$/) 202 | content = invoke_interpreter(file, local_vars) 203 | else 204 | content = IO.readlines(file).join 205 | end 206 | replace_variables(content, local_vars) 207 | if content.scan(@tminclude_regexp) 208 | content = process_document(content, local_vars) 209 | end 210 | 211 | @doc_stack.delete(file) 212 | 213 | @depth -= 1 214 | content 215 | end 216 | 217 | # Dynamic variables 218 | 219 | def var_creationtime(format = "%l:%M %p") 220 | @ctime ? @ctime.strftime(format) : nil 221 | end 222 | 223 | def var_creationdate(format = "%d-%b-%y") 224 | @ctime ? @ctime.strftime(format) : nil 225 | end 226 | 227 | def var_modifiedtime(format = "%l:%M %p") 228 | @mtime ? @mtime.strftime(format) : nil 229 | end 230 | 231 | def var_modifieddate(format = "%d-%b-%y") 232 | @mtime ? @mtime.strftime(format) : nil 233 | end 234 | 235 | def var_localtime(format = "%c") 236 | @time.strftime(format) 237 | end 238 | 239 | def var_gmtime(format = "%c") 240 | @time.gmtime.strftime(format) 241 | end 242 | 243 | def var_username 244 | # store the username into the variable stash so we don't have 245 | # to do this again... 246 | @global_vars['username'] = ENV['TM_FULLNAME'] 247 | end 248 | 249 | def process_document(doc, vars) 250 | # process blocks that look like this: 251 | # 252 | # 253 | # and this... 254 | # 255 | # 256 | doc.gsub!(@tminclude_regexp) do | match | 257 | result = match 258 | match.scan(@tminclude_regexp_detail) do | open, file, args, incl, close | 259 | if @depth == 1 260 | result = "#{open}\n#{process_include(file, args, vars)}\n#{close}" 261 | else 262 | result = "#{process_include(file, args, vars)}" 263 | end 264 | end 265 | result 266 | end 267 | replace_variables(doc, vars) 268 | end 269 | 270 | def process_persistent_includes_for_string(doc) 271 | vars = {} 272 | process_document(doc, vars) 273 | 274 | # lastly, process '#docsize#' 275 | # TBD: support for reporting document size in kb, mb, etc. 276 | # TBD: support for image sizes as well. 277 | matches = doc.scan(/#docsize#/i) 278 | if matches.length 279 | # baselen is document without any "#docsize#" elements 280 | baselen = doc.length - '#docsize#'.length * matches.length 281 | # newlen is document with added docsize values 282 | newlen = baselen + baselen.to_s.length * matches.length 283 | # sometimes this adjustment causes the length of the document 284 | # to change again, so check for that. 285 | while baselen + (newlen.to_s.length * matches.length) != newlen 286 | newlen = baselen + (newlen.to_s.length * matches.length) 287 | end 288 | doc.gsub!(/#docsize#/i, newlen.to_s) 289 | end 290 | end 291 | 292 | public 293 | 294 | def process_persistent_includes_for_project 295 | require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate.rb" 296 | count = 0 297 | begin 298 | TextMate.each_text_file do | file | 299 | doc = IO.readlines(file).join 300 | if doc.match(/#(tm|bb)include/) 301 | if not doc.match(/#dont_update#/) 302 | ENV['TM_FILEPATH'] = file 303 | ENV['TM_DIRECTORY'] = File.dirname(file) 304 | reset 305 | newdoc = doc.dup 306 | process_persistent_includes_for_string(newdoc) 307 | if newdoc != doc 308 | if File.writable?(file) 309 | f = File.new(file, "w") 310 | f.write(newdoc) 311 | f.close 312 | count += 1 313 | end 314 | end 315 | end 316 | end 317 | end 318 | rescue Exception => e 319 | print e 320 | exit 206 321 | end 322 | if count == 1 323 | print "1 file updated" 324 | TextMate.rescan_project 325 | elsif count > 1 326 | print "#{count} files updated" 327 | TextMate.rescan_project 328 | else 329 | print "No files needed an update" 330 | end 331 | exit 206 332 | end 333 | 334 | def process_persistent_includes 335 | #initialize 336 | reset 337 | 338 | doc = STDIN.readlines.join 339 | if doc =~ /\#dont_update\#/ 340 | print "This document cannot be updated because it is protected." 341 | exit 206 342 | end 343 | begin 344 | process_persistent_includes_for_string(doc) 345 | rescue Exception => e 346 | print e 347 | exit 206 348 | end 349 | print doc 350 | end 351 | 352 | def include_command 353 | #initialize 354 | init_comment_delimiters() 355 | 356 | require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb" 357 | cstart = (@escape_open).rstrip + ' ' 358 | cend = (' ' + @escape_close).rstrip 359 | begin 360 | TextMate::UI.request_file do | file | 361 | print <<-"EOT" 362 | #{cstart}#tminclude "#{file}"#{cend} 363 | #{cstart}end tminclude#{cend} 364 | EOT 365 | end 366 | rescue SystemExit 367 | exit 200 368 | end 369 | end 370 | end 371 | end 372 | -------------------------------------------------------------------------------- /Commands/Documentation for Tag.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beforeRunningCommand 6 | nop 7 | command 8 | #!/usr/bin/env ruby20 9 | # 10 | # Lookup the current tag in the MDN web docs 11 | 12 | $tags = { 13 | "a" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a", 14 | "abbr" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr", 15 | "acronym" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/acronym", 16 | "address" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/address", 17 | "applet" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/applet", 18 | "area" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/area", 19 | "article" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article", 20 | "aside" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/aside", 21 | "audio" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio", 22 | "b" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/b", 23 | "base" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base", 24 | "basefont" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/basefont", 25 | "bdi" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdi", 26 | "bdo" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bdo", 27 | "bgsound" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/bgsound", 28 | "big" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/big", 29 | "blink" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blink", 30 | "blockquote" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote", 31 | "body" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body", 32 | "br" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/br", 33 | "button" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button", 34 | "canvas" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas", 35 | "caption" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/caption", 36 | "center" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center", 37 | "cite" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/cite", 38 | "code" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code", 39 | "col" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/col", 40 | "colgroup" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup", 41 | "command" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/command", 42 | "content" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/content", 43 | "data" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/data", 44 | "datalist" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist", 45 | "dd" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dd", 46 | "del" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del", 47 | "details" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details", 48 | "dfn" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dfn", 49 | "dialog" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog", 50 | "dir" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dir", 51 | "div" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div", 52 | "dl" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl", 53 | "dt" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dt", 54 | "element" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/element", 55 | "em" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em", 56 | "embed" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/embed", 57 | "fieldset" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/fieldset", 58 | "figcaption" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figcaption", 59 | "figure" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure", 60 | "font" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/font", 61 | "footer" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/footer", 62 | "form" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form", 63 | "frame" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/frame", 64 | "frameset" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/frameset", 65 | "h1" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements", 66 | "head" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/head", 67 | "header" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/header", 68 | "hgroup" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hgroup", 69 | "hr" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr", 70 | "html" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html", 71 | "i" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/i", 72 | "iframe" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe", 73 | "image" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/image", 74 | "img" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img", 75 | "input" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input", 76 | "ins" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins", 77 | "isindex" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/isindex", 78 | "kbd" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd", 79 | "keygen" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/keygen", 80 | "label" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label", 81 | "legend" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/legend", 82 | "li" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li", 83 | "link" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link", 84 | "listing" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/listing", 85 | "main" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main", 86 | "map" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/map", 87 | "mark" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark", 88 | "marquee" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/marquee", 89 | "menu" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu", 90 | "menuitem" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menuitem", 91 | "meta" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta", 92 | "meter" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter", 93 | "multicol" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/multicol", 94 | "nav" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav", 95 | "nextid" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nextid", 96 | "nobr" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nobr", 97 | "noembed" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noembed", 98 | "noframes" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noframes", 99 | "noscript" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript", 100 | "object" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object", 101 | "ol" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol", 102 | "optgroup" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/optgroup", 103 | "option" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/option", 104 | "output" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/output", 105 | "p" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/p", 106 | "param" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/param", 107 | "picture" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture", 108 | "plaintext" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/plaintext", 109 | "pre" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre", 110 | "progress" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress", 111 | "q" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/q", 112 | "rp" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rp", 113 | "rt" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rt", 114 | "rtc" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/rtc", 115 | "ruby" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ruby", 116 | "s" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s", 117 | "samp" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/samp", 118 | "script" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script", 119 | "section" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/section", 120 | "select" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select", 121 | "shadow" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/shadow", 122 | "slot" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot", 123 | "small" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/small", 124 | "source" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source", 125 | "spacer" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/spacer", 126 | "span" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/span", 127 | "strike" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strike", 128 | "strong" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong", 129 | "style" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style", 130 | "sub" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub", 131 | "summary" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/summary", 132 | "sup" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup", 133 | "table" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table", 134 | "tbody" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tbody", 135 | "td" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/td", 136 | "template" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template", 137 | "textarea" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea", 138 | "tfoot" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tfoot", 139 | "th" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th", 140 | "thead" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/thead", 141 | "time" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time", 142 | "title" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title", 143 | "tr" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tr", 144 | "track" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track", 145 | "tt" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tt", 146 | "u" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u", 147 | "ul" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul", 148 | "var" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/var", 149 | "video" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video", 150 | "wbr" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/wbr", 151 | "xmp" => "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/xmp", 152 | 153 | "math" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math", 154 | "math.annotation" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics", 155 | "math.annotation-xml" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics", 156 | "math.maction" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/maction", 157 | "math.maligngroup" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/maligngroup", 158 | "math.malignmark" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/malignmark", 159 | "math.menclose" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose", 160 | "math.merror" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/merror", 161 | "math.mfenced" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced", 162 | "math.mfrac" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfrac", 163 | "math.mglyph" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mglyph", 164 | "math.mi" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mi", 165 | "math.mlabeledtr" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mlabeledtr", 166 | "math.mlongdiv" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mlongdiv", 167 | "math.mmultiscripts" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mmultiscripts", 168 | "math.mn" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mn", 169 | "math.mo" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo", 170 | "math.mover" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mover", 171 | "math.mpadded" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mpadded", 172 | "math.mphantom" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mphantom", 173 | "math.mroot" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mroot", 174 | "math.mrow" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mrow", 175 | "math.ms" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/ms", 176 | "math.mscarries" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mscarries", 177 | "math.mscarry" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mscarry", 178 | "math.msgroup" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msgroup", 179 | "math.msline" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msline", 180 | "math.mspace" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mspace", 181 | "math.msqrt" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msqrt", 182 | "math.msrow" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msrow", 183 | "math.mstack" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstack", 184 | "math.mstyle" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle", 185 | "math.msub" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msub", 186 | "math.msubsup" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msubsup", 187 | "math.msup" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msup", 188 | "math.mtable" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable", 189 | "math.mtd" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtd", 190 | "math.mtext" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtext", 191 | "math.mtr" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtr", 192 | "math.munder" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/munder", 193 | "math.munderover" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/munderover", 194 | "math.semantics" => "https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics", 195 | 196 | "svg.a" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/a", 197 | "svg.altGlyph" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/altGlyph", 198 | "svg.altGlyphDef" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/altGlyphDef", 199 | "svg.altGlyphItem" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/altGlyphItem", 200 | "svg.animate" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animate", 201 | "svg.animateColor" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateColor", 202 | "svg.animateMotion" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateMotion", 203 | "svg.animateTransform" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/animateTransform", 204 | "svg.circle" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/circle", 205 | "svg.clipPath" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/clipPath", 206 | "svg.color-profile" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/color-profile", 207 | "svg.cursor" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/cursor", 208 | "svg.defs" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/defs", 209 | "svg.desc" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/desc", 210 | "svg.discard" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/discard", 211 | "svg.ellipse" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/ellipse", 212 | "svg.feBlend" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feBlend", 213 | "svg.feColorMatrix" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feColorMatrix", 214 | "svg.feComponentTransfer" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feComponentTransfer", 215 | "svg.feComposite" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feComposite", 216 | "svg.feConvolveMatrix" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feConvolveMatrix", 217 | "svg.feDiffuseLighting" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDiffuseLighting", 218 | "svg.feDisplacementMap" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDisplacementMap", 219 | "svg.feDistantLight" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDistantLight", 220 | "svg.feDropShadow" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDropShadow", 221 | "svg.feFlood" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feFlood", 222 | "svg.feFuncA" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feFuncA", 223 | "svg.feFuncB" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feFuncB", 224 | "svg.feFuncG" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feFuncG", 225 | "svg.feFuncR" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feFuncR", 226 | "svg.feGaussianBlur" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feGaussianBlur", 227 | "svg.feImage" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feImage", 228 | "svg.feMerge" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feMerge", 229 | "svg.feMergeNode" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feMergeNode", 230 | "svg.feMorphology" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feMorphology", 231 | "svg.feOffset" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feOffset", 232 | "svg.fePointLight" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/fePointLight", 233 | "svg.feSpecularLighting" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feSpecularLighting", 234 | "svg.feSpotLight" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feSpotLight", 235 | "svg.feTile" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feTile", 236 | "svg.feTurbulence" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feTurbulence", 237 | "svg.filter" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/filter", 238 | "svg.font" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/font", 239 | "svg.font-face" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/font-face", 240 | "svg.font-face-format" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/font-face-format", 241 | "svg.font-face-name" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/font-face-name", 242 | "svg.font-face-src" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/font-face-src", 243 | "svg.font-face-uri" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/font-face-uri", 244 | "svg.foreignObject" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject", 245 | "svg.g" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g", 246 | "svg.glyph" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/glyph", 247 | "svg.glyphRef" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/glyphRef", 248 | "svg.hatch" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/hatch", 249 | "svg.hatchpath" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/hatchpath", 250 | "svg.hkern" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/hkern", 251 | "svg.image" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/image", 252 | "svg.line" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/line", 253 | "svg.linearGradient" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient", 254 | "svg.marker" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/marker", 255 | "svg.mask" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/mask", 256 | "svg.mesh" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/mesh", 257 | "svg.meshgradient" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/meshgradient", 258 | "svg.meshpatch" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/meshpatch", 259 | "svg.meshrow" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/meshrow", 260 | "svg.metadata" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/metadata", 261 | "svg.missing-glyph" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/missing-glyph", 262 | "svg.mpath" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/mpath", 263 | "svg.path" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/path", 264 | "svg.pattern" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pattern", 265 | "svg.polygon" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/polygon", 266 | "svg.polyline" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/polyline", 267 | "svg.radialGradient" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/radialGradient", 268 | "svg.rect" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect", 269 | "svg.script" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script", 270 | "svg.set" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/set", 271 | "svg.solidcolor" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/solidcolor", 272 | "svg.stop" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/stop", 273 | "svg.style" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/style", 274 | "svg" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg", 275 | "svg.switch" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/switch", 276 | "svg.symbol" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/symbol", 277 | "svg.text" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text", 278 | "svg.textPath" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/textPath", 279 | "svg.title" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title", 280 | "svg.tref" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tref", 281 | "svg.tspan" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/tspan", 282 | "svg.unknown" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/unknown", 283 | "svg.use" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use", 284 | "svg.view" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/view", 285 | "svg.vkern" => "https://developer.mozilla.org/en-US/docs/Web/SVG/Element/vkern" 286 | } 287 | 288 | left_tag = ENV["TM_SCOPE_LEFT"][/meta\.tag\.\w+\.((svg\.|math\.)?[\w\-]+)\.\w+\.html/, 1].to_s 289 | right_tag = ENV["TM_SCOPE"][/meta\.tag\.\w+\.((svg\.|math\.)?[\w\-]+)\.\w+\.html/, 1].to_s 290 | 291 | url = $tags[left_tag.downcase] || $tags[right_tag.downcase] || 'https://developer.mozilla.org/en-US/docs/Web/HTML/Element' 292 | 293 | puts "<meta http-equiv='Refresh' content='0;URL=#{url}'>" 294 | 295 | input 296 | none 297 | inputFormat 298 | text 299 | keyEquivalent 300 | ^h 301 | name 302 | Documentation for Tag 303 | outputCaret 304 | afterOutput 305 | outputFormat 306 | html 307 | outputLocation 308 | newWindow 309 | scope 310 | text.html, text.html entity.name.tag 311 | semanticClass 312 | lookup.define.html 313 | uuid 314 | 637CEA2B-578C-429C-BB74-30E8D42BFA22 315 | version 316 | 2 317 | 318 | 319 | --------------------------------------------------------------------------------