Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -6562,6 +6562,12 @@
"fileMatch": ["tusk.yml", "tusk.yaml"],
"url": "https://raw.githubusercontent.com/rliebz/tusk/main/tusk.schema.json"
},
{
"name": "twee-ts",
"description": "twee-ts compiler configuration file",
"fileMatch": ["twee-ts.config.json"],
"url": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/twee-ts.config.json"
},
{
"name": "typewiz.json",
"description": "Typewiz configuration file",
Expand Down
110 changes: 110 additions & 0 deletions src/schemas/json/twee-ts.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://unpkg.com/@rohal12/twee-ts/schemas/twee-ts.config.schema.json",
"title": "twee-ts Configuration",
"description": "Configuration file for twee-ts, a TypeScript Twee-to-HTML compiler.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"description": "JSON Schema reference for editor support."
},
"sources": {
"type": "array",
"items": { "type": "string" },
"description": "Files or directories to compile."
},
"output": {
"type": "string",
"description": "Output file path."
},
"outputMode": {
"type": "string",
"enum": [
"html",
"twee3",
"twee1",
"twine2-archive",
"twine1-archive",
"json"
],
"default": "html",
"description": "Output mode."
},
"formatId": {
"type": "string",
"description": "Story format directory ID (e.g. 'sugarcube-2')."
},
"startPassage": {
"type": "string",
"description": "Name of the starting passage.",
"default": "Start"
},
"formatPaths": {
"type": "array",
"items": { "type": "string" },
"description": "Extra directories to search for story formats."
},
"formatIndices": {
"type": "array",
"items": { "type": "string" },
"description": "URLs to SFA-compatible index.json files for remote format lookup."
},
"formatUrls": {
"type": "array",
"items": { "type": "string" },
"description": "Direct URLs to format.js files."
},
"useTweegoPath": {
"type": "boolean",
"default": true,
"description": "Also search TWEEGO_PATH env for formats."
},
"modules": {
"type": "array",
"items": { "type": "string" },
"description": "Module files to inject into <head>."
},
"headFile": {
"type": "string",
"description": "Raw HTML file to append to <head>."
},
"trim": {
"type": "boolean",
"default": true,
"description": "Trim passage whitespace."
},
"twee2Compat": {
"type": "boolean",
"default": false,
"description": "Twee2 compatibility mode."
},
"testMode": {
"type": "boolean",
"default": false,
"description": "Enable debug/test mode option."
},
"noRemote": {
"type": "boolean",
"default": false,
"description": "Disable remote format fetching."
},
"tagAliases": {
"type": "object",
"additionalProperties": { "type": "string" },
"description": "Map alias tags to canonical special tags (e.g. { \"library\": \"script\" })."
},
"sourceInfo": {
"type": "boolean",
"default": false,
"description": "Emit source file and line as data- attributes on passage elements."
},
"wordCountMethod": {
"type": "string",
"enum": ["tweego", "whitespace"],
"default": "tweego",
"description": "Word counting method. 'tweego': NFKD normalize, divide chars by 5 (matches Tweego). 'whitespace': split on whitespace after stripping comments and markup."
}
}
}
24 changes: 24 additions & 0 deletions src/test/twee-ts.config/twee-ts.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "https://unpkg.com/@rohal12/twee-ts/schemas/twee-ts.config.schema.json",
"formatId": "sugarcube-2",
"formatIndices": ["https://example.com/index.json"],
"formatPaths": ["/path/to/formats"],
"formatUrls": ["https://example.com/format.js"],
"headFile": "head.html",
"modules": ["module.js"],
"noRemote": false,
"output": "story.html",
"outputMode": "html",
"sourceInfo": false,
"sources": ["src/"],
"startPassage": "Start",
"tagAliases": {
"library": "script",
"theme": "stylesheet"
},
"testMode": false,
"trim": true,
"twee2Compat": false,
"useTweegoPath": true,
"wordCountMethod": "whitespace"
}