Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nvlang committed Jun 27, 2024
1 parent 0311688 commit e101db6
Show file tree
Hide file tree
Showing 11 changed files with 2,291 additions and 948 deletions.
6 changes: 3 additions & 3 deletions extras/vscode-extension/sveltex/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

All notable changes to the "sveltex" extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
## [1.0.0] - 2024-06-27

## [Unreleased]
### Added

- Initial release
- Added basic support for SvelTeX syntax highlighting.
42 changes: 12 additions & 30 deletions extras/vscode-extension/sveltex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ For example if there is an image subfolder under your extension project workspac
## Requirements

If you have any requirements or dependencies, add a section describing those and how to install and configure them.
This extension requires the `svelte.svelte-vscode` VS Code extension to be installed.
This is because the TextMate grammar for SvelTeX depends on Svelte's TextMate
grammar.

## Extension Settings

Expand All @@ -27,39 +29,19 @@ This extension contributes the following settings:
* `myExtension.enable`: Enable/disable this extension.
* `myExtension.thing`: Set to `blah` to do something.

## Limitations

- In LaTeX / math expressions, you may sometimes wish to have unbalanced
brackets (e.g., `[0, 1)` for intervals). Because of this, bracket matching
inside math scopes is turned off.

## Known Issues

Calling out known issues can help limit users opening duplicate issues against your extension.
- For `<style>` tags, only CSS is supported thus far; no SCSS, SASS, LESS, etc.
- For `<script>` tags, only JavaScript is supported thus far; no TypeScript (though JS highlighting is very similar), CoffeeScript, etc.

## Release Notes

Users appreciate release notes as you update your extension.

### 1.0.0

Initial release of ...

### 1.0.1

Fixed issue #.

### 1.1.0

Added features X, Y, and Z.

---

## Working with Markdown

You can author your README using Visual Studio Code. Here are some useful editor keyboard shortcuts:

* Split the editor (`Cmd+\` on macOS or `Ctrl+\` on Windows and Linux).
* Toggle preview (`Shift+Cmd+V` on macOS or `Shift+Ctrl+V` on Windows and Linux).
* Press `Ctrl+Space` (Windows, Linux, macOS) to see a list of Markdown snippets.

## For more information

* [Visual Studio Code's Markdown Support](http://code.visualstudio.com/docs/languages/markdown)
* [Markdown Syntax Reference](https://help.github.com/articles/markdown-basics/)

**Enjoy!**
Initial release.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
},
"brackets": [
["<!--", "-->"],
// ["{", "}"],
["{", "}"],
["(", ")"],
["[", "]"]
],
Expand Down
50 changes: 46 additions & 4 deletions extras/vscode-extension/sveltex/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,48 @@
{
"name": "sveltex",
"displayName": "SvelTeX",
"description": "SvelTeX language support",
"description": "Svelte + Markdown + LaTeX",
"version": "0.0.1",
"homepage": "https://sveltex.dev/",
"keywords": [
"sveltex",
"svelte",
"latex",
"markdown",
"vscode"
],
"publisher": "nvlang",
"icon": "res/icon@128.png",
"pricing": "Free",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/nvlang/sveltex.git"
},
"author": {
"name": "N. V. Lang",
"email": "hi@nvlang.dev",
"url": "https://nvlang.dev/"
},
"contributors": [
{
"name": "N. V. Lang",
"email": "hi@nvlang.dev",
"url": "https://nvlang.dev/"
}
],
"engines": {
"vscode": "^1.90.0"
"vscode": "^1.67.0"
},
"categories": [
"Programming Languages"
],
"scripts": {
"build": "tsx scripts/build.ts"
"build": "node scripts/build.js"
},
"extensionDependencies": [
"svelte.svelte-vscode"
],
"contributes": {
"languages": [
{
Expand All @@ -31,9 +62,20 @@
"language": "sveltex",
"scopeName": "source.sveltex",
"path": "./syntaxes/sveltex.tmLanguage.json",
"balancedBracketScopes": [
"*",
"meta.embedded"
],
"unbalancedBracketScopes": [
"markup.fenced_code",
"meta.math.block.tex",
"support.class.math.block.tex",
"meta.function.environment.math.latex",
"support.class.math.block.environment.latex"
],
"embeddedLanguages": {
"source.svelte": "svelte",
"text.html.markdown": "svelte",
"text.html.markdown": "markdown",
"text.tex.latex": "latex"
}
}
Expand Down
1 change: 1 addition & 0 deletions extras/vscode-extension/sveltex/res/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added extras/vscode-extension/sveltex/res/icon@128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 13 additions & 12 deletions extras/vscode-extension/sveltex/scripts/build.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { readFileSync, writeFileSync } from 'fs';
import { load } from 'js-yaml';

// this code if you want to save
writeFileSync(
'syntaxes/sveltex.tmLanguage.json',
JSON.stringify(
load(
readFileSync('syntaxes/sveltex.tmLanguage.yaml', {
encoding: 'utf-8',
}),
['sveltex', 'markdown'].forEach((lang) => {
writeFileSync(
`syntaxes/${lang}.tmLanguage.json`,
JSON.stringify(
load(
readFileSync(`syntaxes/${lang}.tmLanguage.yaml`, {
encoding: 'utf-8',
}),
),
null,
2,
),
null,
2,
),
);
);
});
Loading

0 comments on commit e101db6

Please sign in to comment.