forked from MapComplete/MapComplete
Docs: improve docs of SpecialVisualizations.ts
This commit is contained in:
parent
e653b64e69
commit
5130a2b73a
6 changed files with 294 additions and 281 deletions
19
src/Utils/MarkdownUtils.ts
Normal file
19
src/Utils/MarkdownUtils.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
export default class MarkdownUtils {
|
||||
|
||||
public static table(header: string[], contents: string[][]){
|
||||
let result = ""
|
||||
|
||||
result += "\n\n| "+header.join(" | ") + " |\n"
|
||||
result += header.map(() => "-----").join("|") + " |\n"
|
||||
for (const line of contents) {
|
||||
if(!line){
|
||||
continue
|
||||
}
|
||||
result += "| " + line.map(x => x ?? "").join(" | ") + " |\n"
|
||||
}
|
||||
result += "\n\n"
|
||||
return result
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue