Rework documentation URLs as inline markdown. Redesign documentations with markdown text. Redesign way to document scripts/categories and present the documentation. Documentation is showed in an expandable box instead of tooltip. This is to allow writing longer documentation (tooltips are meant to be used for short text) and have better experience on mobile. If a node (script/category) has documentation it's now shown with single information icon (ℹ) aligned to right. Add support for rendering documentation as markdown. It automatically converts plain URLs to URLs with display names (e.g. https://docs.microsoft.com/..) will be rendered automatically like "docs.microsoft.com - Windows 11 Privacy...".
26 lines
667 B
TypeScript
26 lines
667 B
TypeScript
import type { CategoryData, CategoryOrScriptData, DocumentationData } from '@/application/collections/';
|
|
import { ScriptDataStub } from './ScriptDataStub';
|
|
|
|
export class CategoryDataStub implements CategoryData {
|
|
public children: readonly CategoryOrScriptData[] = [ScriptDataStub.createWithCode()];
|
|
|
|
public category = 'category name';
|
|
|
|
public docs?: DocumentationData;
|
|
|
|
public withChildren(children: readonly CategoryOrScriptData[]) {
|
|
this.children = children;
|
|
return this;
|
|
}
|
|
|
|
public withName(name: string) {
|
|
this.category = name;
|
|
return this;
|
|
}
|
|
|
|
public withDocs(docs: DocumentationData) {
|
|
this.docs = docs;
|
|
return this;
|
|
}
|
|
}
|