|
1 | | -# Sublime Tera Syntax |
| 1 | +# Tera Syntax for Sublime Text |
2 | 2 |
|
3 | | -A Sublime Text package for Tera template syntax highlighting with automatic detection of underlying file types. |
| 3 | +A simple syntax highlighting package for Tera templates in Sublime Text. |
4 | 4 |
|
5 | 5 | ## Features |
6 | 6 |
|
7 | 7 | - Syntax highlighting for Tera templates (`.tera` files) |
8 | | -- Automatic detection of base language based on file extension (e.g., `file.html.tera` uses HTML+Tera syntax) |
9 | | -- Support for nested variable properties (like `.hex` in `{{variable.hex}}`) |
10 | | -- Highlights Tera expressions, tags, and comments |
11 | | - |
12 | | -## How It Works |
13 | | - |
14 | | -The package includes: |
15 | | - |
16 | | -1. A base Tera syntax definition for highlighting template tags and expressions |
17 | | -2. A dynamic syntax detector that: |
18 | | - - Analyzes your file name to determine the underlying language |
19 | | - - Automatically generates combined syntax definitions |
20 | | - - Applies the correct highlighting |
21 | | - |
22 | | -## Examples |
23 | | - |
24 | | -- `page.html.tera` → HTML + Tera highlighting |
25 | | -- `config.toml.tera` → TOML + Tera highlighting |
26 | | -- `style.css.tera` → CSS + Tera highlighting |
27 | | -- `data.json.tera` → JSON + Tera highlighting |
28 | | - |
29 | | -If no base extension is detected, HTML highlighting is used as the default. |
30 | | - |
31 | | -## Commands |
32 | | - |
33 | | -- **Toggle Debug Mode**: Enables logging for troubleshooting |
34 | | -- **Clear Syntax Cache**: Clears cached syntax definitions |
| 8 | +- HTML syntax highlighting for template content |
| 9 | +- Support for all Tera template constructs: |
| 10 | + - Comments `{# ... #}` |
| 11 | + - Expressions `{{ ... }}` |
| 12 | + - Statements `{% ... %}` |
| 13 | + - Blocks, conditionals, loops, etc. |
35 | 14 |
|
36 | 15 | ## Installation |
37 | 16 |
|
38 | | -### Package Control |
39 | | - |
40 | | -1. Make sure you have [Package Control](https://packagecontrol.io/) installed |
41 | | -2. Open the command palette (Ctrl+Shift+P / Cmd+Shift+P) |
42 | | -3. Select `Package Control: Add Repository` |
43 | | -4. Paste `https://github.com/MuntasirSZN/sublime-tera` |
44 | | - |
45 | 17 | ### Manual Installation |
46 | 18 |
|
47 | 19 | 1. Download or clone this repository |
48 | 20 | 2. Go to `Preferences > Browse Packages...` in Sublime Text |
49 | | -3. Copy the `SublimeTera` folder into the Packages directory |
| 21 | +3. Copy the `TeraSyntax` folder into the Packages directory |
50 | 22 | 4. Restart Sublime Text |
51 | 23 |
|
52 | | -## License |
| 24 | +### Package Control (Coming Soon) |
53 | 25 |
|
54 | | -MIT License |
| 26 | +Once this package is available in Package Control, you'll be able to install it by: |
| 27 | + |
| 28 | +1. Opening the command palette (Ctrl+Shift+P / Cmd+Shift+P) |
| 29 | +2. Selecting `Package Control: Install Package` |
| 30 | +3. Searching for `Tera Syntax` and pressing Enter |
55 | 31 |
|
56 | | -## Thanks To |
| 32 | +## Usage |
57 | 33 |
|
58 | | -@uncenter for [vscode-tera](https://github.com/uncenter/vscode-tera). This repo is a port of vscode's tmLanguage. |
| 34 | +Files with `.tera` extension will automatically use this syntax. |
| 35 | + |
| 36 | +## License |
| 37 | + |
| 38 | +MIT License |
0 commit comments