forked from MapComplete/MapComplete
Chore: improve documentation and error messages
This commit is contained in:
parent
5095bffc50
commit
06a9fb3711
7 changed files with 26 additions and 19 deletions
|
@ -31,6 +31,7 @@ import MarkdownUtils from "../src/Utils/MarkdownUtils"
|
|||
import { parse as parse_html } from "node-html-parser"
|
||||
import { AvailableRasterLayers } from "../src/Models/RasterLayers"
|
||||
import { ImmutableStore } from "../src/Logic/UIEventSource"
|
||||
import * as unitUsage from "../Docs/Schemas/UnitConfigJson.schema.json"
|
||||
|
||||
/**
|
||||
* Converts a markdown-file into a .json file, which a walkthrough/slideshow element can use
|
||||
|
@ -268,7 +269,12 @@ export class GenerateDocs extends Script {
|
|||
|
||||
private generateBuiltinUnits() {
|
||||
const layer = new LayerConfig(<LayerConfigJson>unit, "units", true)
|
||||
const els: string[] = ["## " + layer.id]
|
||||
const els: string[] = [
|
||||
"# Units",
|
||||
"## How to use",
|
||||
unitUsage.description,
|
||||
"Units ",
|
||||
"## " + layer.id]
|
||||
|
||||
for (const unit of layer.units) {
|
||||
els.push("### " + unit.quantity)
|
||||
|
@ -295,8 +301,8 @@ export class GenerateDocs extends Script {
|
|||
}
|
||||
}
|
||||
|
||||
this.WriteMarkdownFile("./Docs/builtin_units.md", ["# Units", ...els].join("\n\n"), [
|
||||
`assets/layers/unit/unit.json`,
|
||||
this.WriteMarkdownFile("./Docs/builtin_units.md", els.join("\n\n"), [
|
||||
`assets/layers/unit/unit.json`, `src/Models/ThemeConfig/Json/UnitConfigJson.ts`
|
||||
])
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue