@openuji/render-respec 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -85
- package/dist/model.d.ts +3 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +1 -0
- package/dist/model.js.map +1 -1
- package/dist/render/html.d.ts.map +1 -1
- package/dist/render/html.js +33 -7
- package/dist/render/html.js.map +1 -1
- package/dist/templates/respec.html +326 -324
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -1,100 +1,32 @@
|
|
|
1
1
|
# @openuji/render-respec
|
|
2
2
|
|
|
3
|
-
Generate ReSpec-compatible HTML from
|
|
3
|
+
**Generate high-performance, ReSpec-compatible HTML from Speculator AST.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`render-respec` is the official rendering engine for the Speculator ecosystem. It takes the semantic content from the [Speculator core](../speculator) and weaves it into the classic, trusted W3C ReSpec aesthetic—without the browser-side performance penalty.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Speculator Integration**: Uses Speculator pipeline to build AST with all indexes and resolutions
|
|
9
|
-
- **Diagnostics**: Integrates speculator-lint for aggregating errors and warnings in-place
|
|
10
|
-
- **ReSpec Compatible**: Generates HTML with 100% look and feel of classical ReSpec template
|
|
11
|
-
- **Markdown & HTML**: Accepts both Markdown and HTML spec source files
|
|
12
|
-
- **Complete Documents**: Ships complete `<html/>` documents, similar to vocab-build
|
|
7
|
+
## ✨ Features
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
- **Instant Static HTML**: Generates complete, SEO-friendly HTML documents at build time.
|
|
10
|
+
- **Classic ReSpec Look**: 100% visual parity with the standard W3C ReSpec template.
|
|
11
|
+
- **Integrated Diagnostics**: Automatically embeds errors and warnings from `speculator-lint` into the rendered document.
|
|
12
|
+
- **Hyper-Resolution**: Handles complex cross-references, TOC generation, and bibliography resolution during the render phase.
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
pnpm add @openuji/render-respec
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Usage
|
|
21
|
-
|
|
22
|
-
### Programmatic API
|
|
14
|
+
## 🚀 Usage
|
|
23
15
|
|
|
24
16
|
```typescript
|
|
25
|
-
import { renderRespec } from
|
|
17
|
+
import { renderRespec } from "@openuji/render-respec";
|
|
26
18
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
strict: false,
|
|
19
|
+
await renderRespec({
|
|
20
|
+
input: "spec/index.md",
|
|
21
|
+
config: "spec/config.respec.json",
|
|
22
|
+
output: "dist/index.html",
|
|
32
23
|
});
|
|
33
|
-
|
|
34
|
-
if (result.success) {
|
|
35
|
-
console.log('Generated:', result.outputPath);
|
|
36
|
-
console.log('Diagnostics:', result.diagnostics);
|
|
37
|
-
} else {
|
|
38
|
-
console.error('Errors:', result.errors);
|
|
39
|
-
}
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### CLI
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
# Render spec to HTML
|
|
46
|
-
render-respec render -i spec/index.md -c spec/config.respec.json -o dist/index.html
|
|
47
|
-
|
|
48
|
-
# Validate spec without rendering
|
|
49
|
-
render-respec validate -i spec/index.md -c spec/config.respec.json
|
|
50
24
|
```
|
|
51
25
|
|
|
52
|
-
##
|
|
53
|
-
|
|
54
|
-
Create a `config.respec.json` file that mirrors standard ReSpec configuration:
|
|
55
|
-
|
|
56
|
-
```json
|
|
57
|
-
{
|
|
58
|
-
"specStatus": "ED",
|
|
59
|
-
"shortName": "my-spec",
|
|
60
|
-
"subtitle": "My Specification",
|
|
61
|
-
"editors": [
|
|
62
|
-
{
|
|
63
|
-
"name": "Editor Name",
|
|
64
|
-
"email": "editor@example.com",
|
|
65
|
-
"company": "Company",
|
|
66
|
-
"companyURL": "https://example.com"
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"publishDate": "2025-12-25",
|
|
70
|
-
"maxTocLevel": 3,
|
|
71
|
-
"github": "org/repo"
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Supported Config Options
|
|
76
|
-
|
|
77
|
-
- `specStatus`: Document status (ED, FPWD, WD, CR, PR, REC, etc.)
|
|
78
|
-
- `shortName`: Short name for the spec
|
|
79
|
-
- `subtitle`: Optional subtitle
|
|
80
|
-
- `editors`: Array of editor objects
|
|
81
|
-
- `authors`: Array of author objects
|
|
82
|
-
- `publishDate`: Publication date (YYYY-MM-DD)
|
|
83
|
-
- `previousPublishDate`: Previous publication date
|
|
84
|
-
- `group`: Working group name
|
|
85
|
-
- `github`: GitHub repository (org/repo format)
|
|
86
|
-
- `maxTocLevel`: Maximum TOC depth (default: 3)
|
|
87
|
-
- `copyrightStart`: Copyright start year
|
|
88
|
-
- `logos`: Custom logo configurations
|
|
89
|
-
|
|
90
|
-
## How It Works
|
|
26
|
+
## 📖 Why use this instead of standard ReSpec?
|
|
91
27
|
|
|
92
|
-
|
|
93
|
-
2. **Build AST**: Runs Speculator pipeline with transform, index, and resolve phases
|
|
94
|
-
3. **Lint**: Runs speculator-lint to collect diagnostics
|
|
95
|
-
4. **Render**: Generates ReSpec-compatible HTML with diagnostics displayed inline
|
|
96
|
-
5. **Output**: Writes complete HTML document
|
|
28
|
+
Traditional ReSpec runs in the reader's browser, which can be slow and brittle for large specifications. `render-respec` provides the same professional result but as a static asset, making your specs faster to load and easier to host anywhere.
|
|
97
29
|
|
|
98
|
-
|
|
30
|
+
---
|
|
99
31
|
|
|
100
|
-
|
|
32
|
+
Part of the [Speculator](../../README.md) ecosystem.
|
package/dist/model.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare const ReSpecConfigSchema: z.ZodObject<{
|
|
|
8
8
|
shortName: z.ZodOptional<z.ZodString>;
|
|
9
9
|
subtitle: z.ZodOptional<z.ZodString>;
|
|
10
10
|
publishDate: z.ZodOptional<z.ZodString>;
|
|
11
|
+
thisVersion: z.ZodOptional<z.ZodString>;
|
|
11
12
|
previousPublishDate: z.ZodOptional<z.ZodString>;
|
|
12
13
|
previousMaturity: z.ZodOptional<z.ZodString>;
|
|
13
14
|
editors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -86,6 +87,7 @@ export declare const ReSpecConfigSchema: z.ZodObject<{
|
|
|
86
87
|
shortName?: string | undefined;
|
|
87
88
|
subtitle?: string | undefined;
|
|
88
89
|
publishDate?: string | undefined;
|
|
90
|
+
thisVersion?: string | undefined;
|
|
89
91
|
previousPublishDate?: string | undefined;
|
|
90
92
|
previousMaturity?: string | undefined;
|
|
91
93
|
editors?: {
|
|
@@ -126,6 +128,7 @@ export declare const ReSpecConfigSchema: z.ZodObject<{
|
|
|
126
128
|
shortName?: string | undefined;
|
|
127
129
|
subtitle?: string | undefined;
|
|
128
130
|
publishDate?: string | undefined;
|
|
131
|
+
thisVersion?: string | undefined;
|
|
129
132
|
previousPublishDate?: string | undefined;
|
|
130
133
|
previousMaturity?: string | undefined;
|
|
131
134
|
editors?: {
|
package/dist/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4D7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAS7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;QACvC,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,CAElE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,CAElE"}
|
package/dist/model.js
CHANGED
|
@@ -10,6 +10,7 @@ export const ReSpecConfigSchema = z.object({
|
|
|
10
10
|
subtitle: z.string().optional(),
|
|
11
11
|
// Publication dates
|
|
12
12
|
publishDate: z.string().optional(), // YYYY-MM-DD format
|
|
13
|
+
thisVersion: z.string().optional(),
|
|
13
14
|
previousPublishDate: z.string().optional(),
|
|
14
15
|
previousMaturity: z.string().optional(),
|
|
15
16
|
// People
|
package/dist/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;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AE,EAAE,mBAAmB;IAClD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAEhC,gBAAgB;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5B,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,eAAe;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,6BAA6B;IAC5D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAElB,qBAAqB;IACrB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,iCAAiC;CACvE,CAAC,CAAC;AAqBH;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAe;IAChD,OAAO,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAe;IAChD,OAAO,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/render/html.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/render/html.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,SAAS,EAGZ,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOhD;;GAEG;AACH,wBAAsB,YAAY,CAC9B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACvB,OAAO,CAAC,MAAM,CAAC,CAgEjB"}
|
package/dist/render/html.js
CHANGED
|
@@ -48,6 +48,8 @@ export async function generateHTML(workspace, config, lintResult) {
|
|
|
48
48
|
copyrightStart: config.copyrightStart || new Date().getFullYear().toString(),
|
|
49
49
|
// Logos
|
|
50
50
|
logos: config.logos || [],
|
|
51
|
+
// JSON-LD
|
|
52
|
+
jsonLd: buildJsonLd(workspace, document, config),
|
|
51
53
|
};
|
|
52
54
|
// Configure Nunjucks
|
|
53
55
|
const templatesDir = join(__dirname, '..', 'templates');
|
|
@@ -117,15 +119,23 @@ function renderNode(node) {
|
|
|
117
119
|
return renderList(node);
|
|
118
120
|
case 'listItem':
|
|
119
121
|
return `<li>${renderChildren(node)}</li>`;
|
|
122
|
+
case 'specStatement':
|
|
123
|
+
return renderSpecStatement(node);
|
|
120
124
|
default:
|
|
121
125
|
return renderChildren(node);
|
|
122
126
|
}
|
|
123
127
|
}
|
|
124
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
128
|
function renderSection(node) {
|
|
126
129
|
const id = node.id ? ` id="${escapeHtml(node.id)}"` : '';
|
|
127
|
-
|
|
128
|
-
const
|
|
130
|
+
// Some sections might have custom classes added by the assembler/transformer
|
|
131
|
+
const data = node.data;
|
|
132
|
+
const respecClass = data?.respecClass;
|
|
133
|
+
const className = typeof respecClass === 'string' ? ` class="${escapeHtml(respecClass)}"` : '';
|
|
134
|
+
let title = '';
|
|
135
|
+
if (node.heading) {
|
|
136
|
+
const depth = node.heading.depth;
|
|
137
|
+
title = `<h${depth}>${renderChildren(node.heading)}</h${depth}>`;
|
|
138
|
+
}
|
|
129
139
|
const content = renderChildren(node);
|
|
130
140
|
return `<section${id}${className}>\n${title}\n${content}\n</section>`;
|
|
131
141
|
}
|
|
@@ -134,8 +144,14 @@ function renderParagraph(node) {
|
|
|
134
144
|
return `<p>${renderChildren(node)}</p>`;
|
|
135
145
|
}
|
|
136
146
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
147
|
+
function renderSpecStatement(node) {
|
|
148
|
+
const id = '';
|
|
149
|
+
const levelClass = node.level ? ` ${node.level.toLowerCase().replace(/\s+/g, '-')}` : '';
|
|
150
|
+
return `<p${id} class="spec-statement${levelClass}">${renderChildren(node)}</p>`;
|
|
151
|
+
}
|
|
152
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
137
153
|
function renderHeading(node) {
|
|
138
|
-
const level = node.
|
|
154
|
+
const level = node.depth || 2;
|
|
139
155
|
return `<h${level}>${renderChildren(node)}</h${level}>`;
|
|
140
156
|
}
|
|
141
157
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -158,10 +174,10 @@ function renderList(node) {
|
|
|
158
174
|
}
|
|
159
175
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
160
176
|
function renderChildren(node) {
|
|
161
|
-
|
|
177
|
+
const children = node.children;
|
|
178
|
+
if (!children || !Array.isArray(children))
|
|
162
179
|
return '';
|
|
163
|
-
|
|
164
|
-
return node.children.map((child) => renderNode(child)).join('');
|
|
180
|
+
return children.map((child) => renderNode(child)).join('');
|
|
165
181
|
}
|
|
166
182
|
function escapeHtml(text) {
|
|
167
183
|
return text
|
|
@@ -171,4 +187,14 @@ function escapeHtml(text) {
|
|
|
171
187
|
.replace(/"/g, '"')
|
|
172
188
|
.replace(/'/g, ''');
|
|
173
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Build JSON-LD script tag
|
|
192
|
+
*/
|
|
193
|
+
function buildJsonLd(_workspace, document, _config) {
|
|
194
|
+
const statementsJsonLd = document.computed?.statementsJsonLd;
|
|
195
|
+
if (!statementsJsonLd) {
|
|
196
|
+
return '';
|
|
197
|
+
}
|
|
198
|
+
return `<script type="application/ld+json">\n${JSON.stringify(statementsJsonLd, null, 2)}\n</script>`;
|
|
199
|
+
}
|
|
174
200
|
//# sourceMappingURL=html.js.map
|
package/dist/render/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/render/html.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/render/html.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAQpC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAC9B,SAAoB,EACpB,MAAoB,EACpB,UAAsB;IAEtB,uDAAuD;IACvD,MAAM,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACtD,CAAC;IAED,eAAe;IACf,MAAM,UAAU,GAA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,SAAS,cAAc,CAAC,IAAS;IAC7B,MAAM,QAAQ,GAAI,IAA+D,CAAC,QAAQ,CAAC;IAC3F,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;QAAE,OAAO,EAAE,CAAC;IACrD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC/D,CAAC;AAED,SAAS,UAAU,CAAC,IAAY;IAC5B,OAAO,IAAI;SACN,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAAC,UAAqB,EAAE,QAAkB,EAAE,OAAqB;IACjF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IAC7D,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpB,OAAO,EAAE,CAAC;IACd,CAAC;IAED,OAAO,wCAAwC,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC;AAC1G,CAAC"}
|
|
@@ -1,342 +1,342 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<
|
|
5
|
-
<meta charset="utf-8">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
6
5
|
<title>{{ title }}{% if subtitle %} — {{ subtitle }}{% endif %}</title>
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0"
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
|
|
8
|
+
{{ jsonLd | safe }}
|
|
8
9
|
|
|
9
10
|
<style>
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
11
|
+
/* ReSpec-inspired styling */
|
|
12
|
+
:root {
|
|
13
|
+
--main-bg: #fff;
|
|
14
|
+
--main-text: #000;
|
|
15
|
+
--heading-text: #005a9c;
|
|
16
|
+
--border-color: #ccc;
|
|
17
|
+
--code-bg: #f9f9f9;
|
|
18
|
+
--diagnostic-error: #d32f2f;
|
|
19
|
+
--diagnostic-warning: #f57c00;
|
|
20
|
+
--diagnostic-info: #0288d1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
body {
|
|
24
|
+
font-family: sans-serif;
|
|
25
|
+
line-height: 1.6;
|
|
26
|
+
max-width: 900px;
|
|
27
|
+
margin: 0 auto;
|
|
28
|
+
padding: 20px;
|
|
29
|
+
color: var(--main-text);
|
|
30
|
+
background: var(--main-bg);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Header styles */
|
|
34
|
+
.head {
|
|
35
|
+
border-bottom: 3px solid var(--border-color);
|
|
36
|
+
padding: 20px 0;
|
|
37
|
+
margin-bottom: 30px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.head h1 {
|
|
41
|
+
color: var(--heading-text);
|
|
42
|
+
margin: 0 0 10px 0;
|
|
43
|
+
font-size: 2.5em;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.head h2 {
|
|
47
|
+
color: #666;
|
|
48
|
+
font-size: 1.2em;
|
|
49
|
+
font-weight: normal;
|
|
50
|
+
margin: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.head dl {
|
|
54
|
+
margin: 20px 0 0 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.head dt {
|
|
58
|
+
font-weight: bold;
|
|
59
|
+
float: left;
|
|
60
|
+
clear: left;
|
|
61
|
+
width: 120px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.head dd {
|
|
65
|
+
margin-left: 140px;
|
|
66
|
+
margin-bottom: 10px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.head dd a {
|
|
70
|
+
color: var(--heading-text);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/* Status badge */
|
|
74
|
+
.status-badge {
|
|
75
|
+
display: inline-block;
|
|
76
|
+
padding: 5px 15px;
|
|
77
|
+
background: var(--heading-text);
|
|
78
|
+
color: white;
|
|
79
|
+
border-radius: 3px;
|
|
80
|
+
font-weight: bold;
|
|
81
|
+
margin-bottom: 10px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* TOC styles */
|
|
85
|
+
#toc {
|
|
86
|
+
border: 1px solid var(--border-color);
|
|
87
|
+
padding: 20px;
|
|
88
|
+
margin: 30px 0;
|
|
89
|
+
background: #f5f5f5;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
#toc h2 {
|
|
93
|
+
margin-top: 0;
|
|
94
|
+
color: var(--heading-text);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
#toc ol {
|
|
98
|
+
list-style: none;
|
|
99
|
+
counter-reset: item;
|
|
100
|
+
padding-left: 20px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#toc li {
|
|
104
|
+
counter-increment: item;
|
|
105
|
+
margin: 5px 0;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
#toc li::before {
|
|
109
|
+
content: counters(item, ".") ". ";
|
|
110
|
+
font-weight: bold;
|
|
111
|
+
margin-right: 5px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
#toc a {
|
|
115
|
+
color: var(--heading-text);
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
#toc a:hover {
|
|
120
|
+
text-decoration: underline;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Section styles */
|
|
124
|
+
section {
|
|
125
|
+
margin: 30px 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
section h2,
|
|
129
|
+
section h3,
|
|
130
|
+
section h4,
|
|
131
|
+
section h5,
|
|
132
|
+
section h6 {
|
|
133
|
+
color: var(--heading-text);
|
|
134
|
+
margin-top: 1.5em;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
section#abstract {
|
|
138
|
+
padding: 15px;
|
|
139
|
+
border-left: 4px solid var(--heading-text);
|
|
140
|
+
background: #f0f8ff;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Definition and reference styles */
|
|
144
|
+
dfn {
|
|
145
|
+
font-weight: bold;
|
|
146
|
+
font-style: normal;
|
|
147
|
+
color: var(--heading-text);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
a.internalDFN {
|
|
151
|
+
color: var(--heading-text);
|
|
152
|
+
text-decoration: underline dotted;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
a.internalDFN:hover {
|
|
156
|
+
text-decoration: underline;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Code styles */
|
|
160
|
+
code {
|
|
161
|
+
background: var(--code-bg);
|
|
162
|
+
padding: 2px 5px;
|
|
163
|
+
border-radius: 3px;
|
|
164
|
+
font-family: Monaco, "Courier New", monospace;
|
|
165
|
+
font-size: 0.9em;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
pre {
|
|
169
|
+
background: var(--code-bg);
|
|
170
|
+
padding: 15px;
|
|
171
|
+
border-left: 3px solid var(--border-color);
|
|
172
|
+
overflow-x: auto;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
pre code {
|
|
176
|
+
background: none;
|
|
177
|
+
padding: 0;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* Diagnostics panel */
|
|
181
|
+
.diagnostics-panel {
|
|
182
|
+
margin: 30px 0;
|
|
183
|
+
padding: 20px;
|
|
184
|
+
background: #fff8e1;
|
|
185
|
+
border: 1px solid #ffd54f;
|
|
186
|
+
border-radius: 5px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.diagnostics-panel h3 {
|
|
190
|
+
margin-top: 0;
|
|
191
|
+
color: #f57c00;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.diagnostic-summary {
|
|
195
|
+
font-weight: bold;
|
|
196
|
+
margin-bottom: 15px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.diagnostic-file h4 {
|
|
200
|
+
color: #666;
|
|
201
|
+
margin: 15px 0 10px 0;
|
|
202
|
+
font-size: 1em;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.diagnostic-list {
|
|
206
|
+
list-style: none;
|
|
207
|
+
padding: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.diagnostic-list li {
|
|
211
|
+
padding: 8px 12px;
|
|
212
|
+
margin: 5px 0;
|
|
213
|
+
border-radius: 3px;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.diagnostic-error {
|
|
217
|
+
background: #ffebee;
|
|
218
|
+
border-left: 4px solid var(--diagnostic-error);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.diagnostic-warning {
|
|
222
|
+
background: #fff3e0;
|
|
223
|
+
border-left: 4px solid var(--diagnostic-warning);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.diagnostic-info {
|
|
227
|
+
background: #e1f5fe;
|
|
228
|
+
border-left: 4px solid var(--diagnostic-info);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* Lists */
|
|
232
|
+
ul,
|
|
233
|
+
ol {
|
|
234
|
+
margin: 15px 0;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
li {
|
|
238
|
+
margin: 5px 0;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* Links */
|
|
242
|
+
a {
|
|
243
|
+
color: var(--heading-text);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/* Footer */
|
|
247
|
+
footer {
|
|
248
|
+
margin-top: 50px;
|
|
249
|
+
padding-top: 20px;
|
|
250
|
+
border-top: 1px solid var(--border-color);
|
|
251
|
+
color: #666;
|
|
252
|
+
font-size: 0.9em;
|
|
253
|
+
}
|
|
253
254
|
</style>
|
|
254
|
-
</head>
|
|
255
|
+
</head>
|
|
255
256
|
|
|
256
|
-
<body>
|
|
257
|
+
<body>
|
|
257
258
|
<!-- Document Header -->
|
|
258
259
|
<div class="head">
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
260
|
+
<p>
|
|
261
|
+
{% if logos %} {% for logo in logos %}
|
|
262
|
+
<a href="{{ logo.url or '#' }}">
|
|
263
|
+
<img
|
|
264
|
+
src="{{ logo.src }}"
|
|
265
|
+
alt="{{ logo.alt }}"
|
|
266
|
+
{%
|
|
267
|
+
if
|
|
268
|
+
logo.width
|
|
269
|
+
%}width="{{ logo.width }}"
|
|
270
|
+
{%
|
|
271
|
+
endif
|
|
272
|
+
%}
|
|
273
|
+
{%
|
|
274
|
+
if
|
|
275
|
+
logo.height
|
|
276
|
+
%}height="{{ logo.height }}"
|
|
277
|
+
{%
|
|
278
|
+
endif
|
|
279
|
+
%}
|
|
280
|
+
/>
|
|
281
|
+
</a>
|
|
282
|
+
{% endfor %} {% endif %}
|
|
283
|
+
</p>
|
|
284
|
+
|
|
285
|
+
<h1>{{ title }}</h1>
|
|
286
|
+
{% if subtitle %}
|
|
287
|
+
<h2>{{ subtitle }}</h2>
|
|
288
|
+
{% endif %}
|
|
289
|
+
|
|
290
|
+
<p class="status-badge">{{ specStatus }}</p>
|
|
291
|
+
|
|
292
|
+
<dl>
|
|
293
|
+
<dt>This version:</dt>
|
|
294
|
+
<dd>{{ publishDate }}</dd>
|
|
295
|
+
|
|
296
|
+
{% if previousPublishDate %}
|
|
297
|
+
<dt>Previous version:</dt>
|
|
298
|
+
<dd>{{ previousPublishDate }}</dd>
|
|
299
|
+
{% endif %} {% if editors and editors.length > 0 %}
|
|
300
|
+
<dt>Editor{% if editors.length > 1 %}s{% endif %}:</dt>
|
|
301
|
+
<dd>
|
|
302
|
+
{% for editor in editors %} {{ editor.name }} {% if editor.company %}
|
|
303
|
+
(<a href="{{ editor.companyURL or '#' }}">{{ editor.company }}</a>) {%
|
|
304
|
+
endif %} {% if editor.email %} <<a href="mailto:{{ editor.email }}"
|
|
305
|
+
>{{ editor.email }}</a
|
|
306
|
+
>> {% endif %} {% if not loop.last %}<br />{% endif %} {% endfor %}
|
|
307
|
+
</dd>
|
|
308
|
+
{% endif %} {% if authors and authors.length > 0 %}
|
|
309
|
+
<dt>Author{% if authors.length > 1 %}s{% endif %}:</dt>
|
|
310
|
+
<dd>
|
|
311
|
+
{% for author in authors %} {{ author.name }} {% if author.company %}
|
|
312
|
+
(<a href="{{ author.companyURL or '#' }}">{{ author.company }}</a>) {%
|
|
313
|
+
endif %} {% if not loop.last %}<br />{% endif %} {% endfor %}
|
|
314
|
+
</dd>
|
|
315
|
+
{% endif %} {% if github %}
|
|
316
|
+
<dt>Repository:</dt>
|
|
317
|
+
<dd><a href="https://github.com/{{ github }}">{{ github }}</a></dd>
|
|
273
318
|
{% endif %}
|
|
319
|
+
</dl>
|
|
274
320
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
<dd>{{ publishDate }}</dd>
|
|
280
|
-
|
|
281
|
-
{% if previousPublishDate %}
|
|
282
|
-
<dt>Previous version:</dt>
|
|
283
|
-
<dd>{{ previousPublishDate }}</dd>
|
|
284
|
-
{% endif %}
|
|
285
|
-
|
|
286
|
-
{% if editors and editors.length > 0 %}
|
|
287
|
-
<dt>Editor{% if editors.length > 1 %}s{% endif %}:</dt>
|
|
288
|
-
<dd>
|
|
289
|
-
{% for editor in editors %}
|
|
290
|
-
{{ editor.name }}
|
|
291
|
-
{% if editor.company %}
|
|
292
|
-
(<a href="{{ editor.companyURL or '#' }}">{{ editor.company }}</a>)
|
|
293
|
-
{% endif %}
|
|
294
|
-
{% if editor.email %}
|
|
295
|
-
<<a href="mailto:{{ editor.email }}">{{ editor.email }}</a>>
|
|
296
|
-
{% endif %}
|
|
297
|
-
{% if not loop.last %}<br>{% endif %}
|
|
298
|
-
{% endfor %}
|
|
299
|
-
</dd>
|
|
300
|
-
{% endif %}
|
|
301
|
-
|
|
302
|
-
{% if authors and authors.length > 0 %}
|
|
303
|
-
<dt>Author{% if authors.length > 1 %}s{% endif %}:</dt>
|
|
304
|
-
<dd>
|
|
305
|
-
{% for author in authors %}
|
|
306
|
-
{{ author.name }}
|
|
307
|
-
{% if author.company %}
|
|
308
|
-
(<a href="{{ author.companyURL or '#' }}">{{ author.company }}</a>)
|
|
309
|
-
{% endif %}
|
|
310
|
-
{% if not loop.last %}<br>{% endif %}
|
|
311
|
-
{% endfor %}
|
|
312
|
-
</dd>
|
|
313
|
-
{% endif %}
|
|
314
|
-
|
|
315
|
-
{% if github %}
|
|
316
|
-
<dt>Repository:</dt>
|
|
317
|
-
<dd><a href="https://github.com/{{ github }}">{{ github }}</a></dd>
|
|
318
|
-
{% endif %}
|
|
319
|
-
</dl>
|
|
320
|
-
|
|
321
|
-
<p class="copyright">
|
|
322
|
-
Copyright © {{ copyrightStart }}{% if copyrightStart != publishDate|slice(0,4) %}-{{ publishDate|slice(0,4)
|
|
323
|
-
}}{% endif %}
|
|
324
|
-
</p>
|
|
321
|
+
<p class="copyright">
|
|
322
|
+
Copyright © {{ copyrightStart }}{% if copyrightStart !=
|
|
323
|
+
publishDate|slice(0,4) %}-{{ publishDate|slice(0,4) }}{% endif %}
|
|
324
|
+
</p>
|
|
325
325
|
</div>
|
|
326
326
|
|
|
327
327
|
<!-- Abstract -->
|
|
328
328
|
<section id="abstract">
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
<h2>Abstract</h2>
|
|
330
|
+
{{ abstract | safe }}
|
|
331
331
|
</section>
|
|
332
332
|
|
|
333
333
|
<!-- Table of Contents -->
|
|
334
334
|
{% if toc %}
|
|
335
335
|
<nav id="toc">
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
336
|
+
<h2>Table of Contents</h2>
|
|
337
|
+
<ol class="toc">
|
|
338
|
+
{{ toc | safe }}
|
|
339
|
+
</ol>
|
|
340
340
|
</nav>
|
|
341
341
|
{% endif %}
|
|
342
342
|
|
|
@@ -348,8 +348,10 @@
|
|
|
348
348
|
|
|
349
349
|
<!-- Footer -->
|
|
350
350
|
<footer>
|
|
351
|
-
|
|
351
|
+
<p>
|
|
352
|
+
Generated by <strong>render-respec</strong> using the Speculator AST
|
|
353
|
+
pipeline.
|
|
354
|
+
</p>
|
|
352
355
|
</footer>
|
|
353
|
-
</body>
|
|
354
|
-
|
|
355
|
-
</html>
|
|
356
|
+
</body>
|
|
357
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openuji/render-respec",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Generate ReSpec-compatible HTML from specification source files using Speculator AST pipeline",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"nunjucks": "^3.2.4",
|
|
33
33
|
"prettier": "^3.1.0",
|
|
34
34
|
"zod": "^3.22.0",
|
|
35
|
-
"@openuji/speculator
|
|
36
|
-
"@openuji/speculator": "0.
|
|
35
|
+
"@openuji/speculator": "0.7.0",
|
|
36
|
+
"@openuji/speculator-lint": "0.3.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^20.10.0",
|
|
@@ -44,11 +44,18 @@
|
|
|
44
44
|
"typescript": "^5.3.0",
|
|
45
45
|
"vitest": "^1.0.0"
|
|
46
46
|
},
|
|
47
|
+
"lint-staged": {
|
|
48
|
+
"src/**/!(*.generated).ts": [
|
|
49
|
+
"eslint --fix --max-warnings 0",
|
|
50
|
+
"bash -c 'pnpm typecheck'",
|
|
51
|
+
"bash -c 'pnpm test --run'"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
47
54
|
"scripts": {
|
|
48
55
|
"build": "tsc && npm run postbuild",
|
|
49
56
|
"postbuild": "cp -r src/templates dist/",
|
|
50
57
|
"dev": "tsc --watch",
|
|
51
|
-
"test": "vitest run",
|
|
58
|
+
"test": "vitest run --passWithNoTests",
|
|
52
59
|
"test:watch": "vitest",
|
|
53
60
|
"lint": "eslint src --ext .ts",
|
|
54
61
|
"lint:fix": "eslint src --ext .ts --fix",
|