mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Split separate lines of schema descriptions (#761)
Before:  After: 
This commit is contained in:
commit
1af27ce772
@ -12,18 +12,18 @@
|
|||||||
"format": "prettier --write ."
|
"format": "prettier --write ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/starlight": "^0.14.0",
|
"@astrojs/starlight": "^0.15.1",
|
||||||
"astro": "3.6.4",
|
"astro": "4.0.8",
|
||||||
"rehype-external-links": "^3.0.0",
|
"rehype-external-links": "^3.0.0",
|
||||||
"sharp": "^0.33.0"
|
"sharp": "^0.33.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@apidevtools/json-schema-ref-parser": "^11.1.0",
|
"@apidevtools/json-schema-ref-parser": "^11.1.0",
|
||||||
"eslint": "^8.54.0",
|
"eslint": "^8.56.0",
|
||||||
"eslint-plugin-prettier": "^5.0.1",
|
"eslint-plugin-prettier": "^5.1.2",
|
||||||
"fast-xml-parser": "^4.3.2",
|
"fast-xml-parser": "^4.3.2",
|
||||||
"prettier": "^3.1.0",
|
"prettier": "^3.1.1",
|
||||||
"prettier-plugin-astro": "^0.12.2",
|
"prettier-plugin-astro": "^0.12.3",
|
||||||
"xml-js": "^1.6.11"
|
"xml-js": "^1.6.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2964
docs/pnpm-lock.yaml
generated
2964
docs/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,8 @@ const refSlug = SchemaTools.getRefSlug(schema);
|
|||||||
const enumVals = SchemaTools.getEnumValues(schema);
|
const enumVals = SchemaTools.getEnumValues(schema);
|
||||||
const props = SchemaTools.getProps(schema, level);
|
const props = SchemaTools.getProps(schema, level);
|
||||||
|
|
||||||
|
const descSplit = description?.toString().split(" \n").map(l => l.trim()).filter(l => l.length !== 0);
|
||||||
|
|
||||||
const HeadingTag = levelMap[level] ?? "h6";
|
const HeadingTag = levelMap[level] ?? "h6";
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -60,7 +62,7 @@ const HeadingTag = levelMap[level] ?? "h6";
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
{description ? <p>{description}</p> : <p>No Description Found</p>}
|
{descSplit?.map(l => <p>{l}</p>) ?? <p>No Description Found</p>}
|
||||||
{
|
{
|
||||||
enumVals.length !== 0 && (
|
enumVals.length !== 0 && (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
import type { JSONSchema } from "@apidevtools/json-schema-ref-parser/dist/lib/types";
|
import type { JSONSchema } from "@apidevtools/json-schema-ref-parser/dist/lib/types";
|
||||||
import type { MarkdownHeading } from "astro";
|
import type { MarkdownHeading } from "astro";
|
||||||
import { readFileSync } from "fs";
|
import { readFileSync } from "fs";
|
||||||
import { Element, xml2js } from "xml-js";
|
import { xml2js } from "xml-js";
|
||||||
|
import type { Element } from "xml-js";
|
||||||
|
|
||||||
export type InternalSchema = { type: "JSON"; val: JSONSchema } | { type: "XML"; val: Element };
|
export type InternalSchema = { type: "JSON"; val: JSONSchema } | { type: "XML"; val: Element };
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user