Skip to content

Commit 6cb7fca

Browse files
committed
fix highlighting bugs, minor visuals in usage
1 parent 49f976f commit 6cb7fca

File tree

3 files changed

+34
-60
lines changed

3 files changed

+34
-60
lines changed

astro.config.mjs

+20-11
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,26 @@ export default defineConfig({
1111
shikiConfig: {
1212
theme: 'dracula',
1313
langs: [
14-
// important: a language's dependencies must be loaded first, or explosion
15-
{
16-
id: 'mpcal',
17-
scopeName: 'source.tlaplus.mpcal',
18-
grammar: JSON.parse(readFileSync('highlighting/mpcal.tmLanguage.json'))
19-
}, {
20-
id: 'tlaplus',
21-
scopeName: 'source.tlaplus',
22-
grammar: JSON.parse(readFileSync('./highlighting/tlaplus.tmLanguage.json')),
23-
aliases: ['tla']
24-
}],
14+
// important: a language's dependencies must be loaded first, or explosion
15+
{
16+
id: 'tlaplus',
17+
scopeName: 'source.tlaplus',
18+
grammar: JSON.parse(readFileSync('./highlighting/tlaplus.tmLanguage.json')),
19+
aliases: ['tla'],
20+
},
21+
{
22+
id: 'pluscal',
23+
scopeName: 'source.tlaplus.pluscal',
24+
grammar: JSON.parse(readFileSync('./highlighting/pluscal.tmLanguage.json')),
25+
embeddedLangs: ['tlaplus'],
26+
},
27+
{
28+
id: 'mpcal',
29+
scopeName: 'source.tlaplus.mpcal',
30+
grammar: JSON.parse(readFileSync('./highlighting/mpcal.tmLanguage.json')),
31+
embeddedLangs: ['tlaplus', 'pluscal'],
32+
},
33+
],
2534
wrap: true
2635
}
2736
}

highlighting/tlaplus.tmLanguage.json

-36
Original file line numberDiff line numberDiff line change
@@ -105,42 +105,6 @@
105105
"begin": "\\\\\\*",
106106
"end": "$"
107107
},
108-
"comment-block": {
109-
"name": "comment.block.tlaplus",
110-
"begin": "\\(\\*",
111-
"end": "\\*\\)",
112-
"patterns": [
113-
{
114-
"begin": "(\\-\\-)(mpcal)(\\s+)(\\w+)(\\s*)({)",
115-
"end": "}",
116-
"beginCaptures": {
117-
"2": {
118-
"name": "keyword.other.mpcal"
119-
}
120-
},
121-
"name": "meta.embedded.block.mpcal",
122-
"patterns": [{
123-
"include": "source.tlaplus.mpcal"
124-
}]
125-
},
126-
{
127-
"begin": "(\\-\\-)(algorithm|fair\\s+algorithm)(\\s+)(\\w+)(\\s*)({)",
128-
"end": "}",
129-
"beginCaptures": {
130-
"2": {
131-
"name": "keyword.other.pluscal"
132-
}
133-
},
134-
"name": "meta.embedded.block.pluscal",
135-
"patterns": [{
136-
"include": "source.tlaplus.pluscal"
137-
}]
138-
},
139-
{
140-
"include": "#comment-block"
141-
}
142-
]
143-
},
144108
"operators-4-char": {
145109
"name": "keyword.operator.tlaplus",
146110
"match": "(\\(\\\\X\\)|-\\+-\\>)"

src/pages/usage.mdx

+14-13
Original file line numberDiff line numberDiff line change
@@ -129,33 +129,34 @@ In this section, we'll go over how to verify a load balancer. We'll get PGo's ex
129129
```
130130

131131
3. Open the load balancer specification in the TLA+ toolbox (by going to File > Open Spec > Add New Spec... > Browse...).
132-
<div class="flex flex-row">
132+
<div class="flex flex-row flex-wrap">
133133
<Figure src={img_add_new_spec} alt="Add New Spec..." client:load />
134134
<Figure src={img_browse} alt="Browse..." client:load />
135135
</div>
136136

137137
4. Press `Ctrl-t` to compile PlusCal to TLA+ (output in the same file).
138138

139139
5. On the left pane, right click on models, select New Models..., and name the new model. The created model is opened on the right pane.
140-
<div class="flex flex-row">
140+
<div class="flex flex-row flex-wrap">
141141
<Figure src={img_new_model} alt="New model..." client:load />
142142
<Figure src={img_new_model_dialog} alt="New model dialog..." client:load />
143143
</div>
144144

145-
6. In What is the model? on the lower right side, double click on each item and fill in the following values.
146-
```
147-
| Item | Value |
148-
| ----------- | ----- |
149-
| GET_PAGE | 1 |
150-
| NUM_CLIENTS | 1 |
151-
| NUM_SERVERS | 1 |
152-
| BUFFER_SIZE | 1 |
153-
| WEB_PAGE | 1 |
154-
```
145+
6. In "What is the model?" on the lower right side, double click on each item and fill in the following values.
146+
147+
<div class="max-w-prose">
148+
| Item | Value |
149+
| ----------- | ----- |
150+
| GET_PAGE | 1 |
151+
| NUM_CLIENTS | 1 |
152+
| NUM_SERVERS | 1 |
153+
| BUFFER_SIZE | 1 |
154+
| WEB_PAGE | 1 |
155+
</div>
155156

156157
You can vary the values as you see fit.
157158

158-
<div class="flex flex-row">
159+
<div class="flex flex-row flex-wrap">
159160
<Figure src={img_value_filling} alt="Value filling..." client:load />
160161
<Figure src={img_what_is_the_model} alt="What is the model?" client:load />
161162
</div>

0 commit comments

Comments
 (0)