Skip to content

Commit 1851e1c

Browse files
committed
Better tooling
1 parent 370ba81 commit 1851e1c

File tree

8 files changed

+2234
-19
lines changed

8 files changed

+2234
-19
lines changed

.github/workflows/test.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: "22"
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
24+
- name: Run tests
25+
run: npm test

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/.vitepress/cache/
22
/.vitepress/dist/
33
/node_modules/
4-
package-lock.json
5-
.idea/
4+
/.idea/

.vitepress/config.mts

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
1+
import fs from 'node:fs'
12
import { defineConfig } from 'vitepress'
23

3-
// https://vitepress.dev/reference/site-config
4+
const __dirname = new URL('.', import.meta.url).pathname
5+
const mamlLang = JSON.parse(fs.readFileSync(__dirname + '/maml.json', 'utf8'))
6+
47
export default defineConfig({
5-
title: "MAML",
6-
description: "Minimal Abstract Markup Language",
8+
base: '/',
9+
cleanUrls: true,
10+
title: 'MAML',
11+
titleTemplate: ':title',
12+
description: 'Minimal Abstract Markup Language',
713
themeConfig: {
8-
// https://vitepress.dev/reference/default-theme-config
914
nav: [
1015
{ text: 'Home', link: '/' },
11-
],
12-
13-
sidebar: [
1416
{
15-
text: 'Examples',
17+
text: 'Spec',
1618
items: [
17-
{ text: 'Markdown Examples', link: '/markdown-examples' },
18-
{ text: 'Runtime API Examples', link: '/api-examples' }
19-
]
20-
}
19+
{ text: 'v0.1', link: '/spec/v0.1' },
20+
],
21+
},
2122
],
22-
2323
socialLinks: [
24-
{ icon: 'github', link: 'https://github.com/maml-dev/maml' }
25-
]
26-
}
24+
{ icon: 'github', link: 'https://github.com/maml-dev/maml' },
25+
],
26+
search: {
27+
provider: 'local',
28+
},
29+
},
30+
markdown: {
31+
theme: {
32+
light: 'catppuccin-latte',
33+
dark: 'plastic'
34+
},
35+
shikiSetup(shiki) {
36+
shiki.loadLanguage(mamlLang)
37+
},
38+
},
2739
})

.vitepress/maml.json

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
{
2+
"displayName": "MAML",
3+
"name": "maml",
4+
"patterns": [
5+
{
6+
"include": "#value"
7+
}
8+
],
9+
"repository": {
10+
"comments": {
11+
"begin": "(^[\\t ]+)?(?=#)",
12+
"beginCaptures": {
13+
"1": {
14+
"name": "punctuation.whitespace.comment.leading.maml"
15+
}
16+
},
17+
"end": "(?!\\G)",
18+
"patterns": [
19+
{
20+
"begin": "#",
21+
"beginCaptures": {
22+
"0": {
23+
"name": "punctuation.definition.comment.maml"
24+
}
25+
},
26+
"end": "\\n",
27+
"name": "comment.line.number-sign.maml"
28+
}
29+
]
30+
},
31+
"array": {
32+
"begin": "\\[",
33+
"beginCaptures": {
34+
"0": {
35+
"name": "punctuation.definition.array.begin.maml"
36+
}
37+
},
38+
"end": "]",
39+
"endCaptures": {
40+
"0": {
41+
"name": "punctuation.definition.array.end.maml"
42+
}
43+
},
44+
"name": "meta.structure.array.maml",
45+
"patterns": [
46+
{
47+
"include": "#value"
48+
},
49+
{
50+
"match": ",",
51+
"name": "punctuation.separator.array.maml"
52+
},
53+
{
54+
"match": "[^]\\s]",
55+
"name": "invalid.illegal.expected-array-separator.maml"
56+
}
57+
]
58+
},
59+
"object": {
60+
"begin": "\\{",
61+
"beginCaptures": {
62+
"0": {
63+
"name": "punctuation.definition.dictionary.begin.maml"
64+
}
65+
},
66+
"end": "}",
67+
"endCaptures": {
68+
"0": {
69+
"name": "punctuation.definition.dictionary.end.maml"
70+
}
71+
},
72+
"name": "meta.structure.dictionary.maml",
73+
"patterns": [
74+
{
75+
"include": "#comments"
76+
},
77+
{
78+
"include": "#key"
79+
},
80+
{
81+
"begin": ":",
82+
"beginCaptures": {
83+
"0": {
84+
"name": "punctuation.separator.dictionary.key-value.maml"
85+
}
86+
},
87+
"end": "(,)|(?=\n)|(?=})",
88+
"endCaptures": {
89+
"1": {
90+
"name": "punctuation.separator.dictionary.pair.maml"
91+
}
92+
},
93+
"name": "meta.structure.dictionary.value.maml",
94+
"patterns": [
95+
{
96+
"include": "#value"
97+
},
98+
{
99+
"match": "[^,\\s]",
100+
"name": "invalid.illegal.expected-dictionary-separator.maml"
101+
}
102+
]
103+
},
104+
{
105+
"match": "[^}\\s]",
106+
"name": "invalid.illegal.expected-dictionary-separator.maml"
107+
}
108+
]
109+
},
110+
"key": {
111+
"name": "string.key.maml",
112+
"patterns": [
113+
{
114+
"include": "#string"
115+
},
116+
{
117+
"match": "[A-Za-z0-9_-]",
118+
"name": "variable.other.key.maml"
119+
}
120+
]
121+
},
122+
"string": {
123+
"begin": "\"",
124+
"beginCaptures": {
125+
"0": {
126+
"name": "punctuation.definition.string.begin.maml"
127+
}
128+
},
129+
"end": "\"",
130+
"endCaptures": {
131+
"0": {
132+
"name": "punctuation.definition.string.end.maml"
133+
}
134+
},
135+
"name": "string.quoted.double.maml",
136+
"patterns": [
137+
{
138+
"include": "#stringcontent"
139+
}
140+
]
141+
},
142+
"stringcontent": {
143+
"patterns": [
144+
{
145+
"match": "\\\\(?:[\"/\\\\bfnrt]|u\\h{4})",
146+
"name": "constant.character.escape.maml"
147+
},
148+
{
149+
"match": "\\\\.",
150+
"name": "invalid.illegal.unrecognized-string-escape.maml"
151+
}
152+
]
153+
},
154+
"multilinestring": {
155+
"begin": "\"\"\"",
156+
"beginCaptures": {
157+
"0": {
158+
"name": "punctuation.definition.string.begin.maml"
159+
}
160+
},
161+
"end": "\"{3,5}",
162+
"endCaptures": {
163+
"0": {
164+
"name": "punctuation.definition.string.end.maml"
165+
}
166+
},
167+
"name": "string.quoted.triple.string.maml"
168+
},
169+
"constant": {
170+
"match": "\\b(?:true|false|null)\\b",
171+
"name": "constant.language.maml"
172+
},
173+
"number": {
174+
"match": "-?(?:0|[1-9]\\d*)(?:(?:\\.\\d+)?(?:[Ee][-+]?\\d+)?)?",
175+
"name": "constant.numeric.maml"
176+
},
177+
"value": {
178+
"patterns": [
179+
{
180+
"include": "#constant"
181+
},
182+
{
183+
"include": "#number"
184+
},
185+
{
186+
"include": "#multilinestring"
187+
},
188+
{
189+
"include": "#string"
190+
},
191+
{
192+
"include": "#array"
193+
},
194+
{
195+
"include": "#object"
196+
},
197+
{
198+
"include": "#comments"
199+
}
200+
]
201+
}
202+
},
203+
"scopeName": "source.maml"
204+
}

index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ hero:
2929
born: 2001
3030
}
3131
}
32+
{
33+
maml: {
34+
name: "MAML"
35+
born: 2025
36+
}
37+
}
3238
]
3339
3440
notes: """

0 commit comments

Comments
 (0)