Skip to content
This repository has been archived by the owner on Feb 7, 2021. It is now read-only.

Commit

Permalink
changed generation of json schema file
Browse files Browse the repository at this point in the history
  • Loading branch information
Tiliavir committed Aug 18, 2018
1 parent da32716 commit 38a98f6
Show file tree
Hide file tree
Showing 11 changed files with 611 additions and 190 deletions.
26 changes: 24 additions & 2 deletions js/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,39 @@
export interface INavigationNode {
export interface IBreadcrumbNode {
referencedFile: string;
title: string;
}
interface INavigationNode {
title: string;
/**
* Values can be any string. Special treatment for:
* - "none" : excluded from all navigations except "allplain"
* - "top" : default top navigation
*/
navigation?: NavigationType | "none";
}
export interface IBranch extends INavigationNode {
children: ConfigNode[];
}
export interface IStructureNode extends INavigationNode {
children?: ConfigNode[];
referencedFile: string;
}
declare type ConfigNode = IStructureNode | IBranch;
/**
* Array of (child) elements in the site structure tree.
*/
export declare type StructureConfig = ConfigNode[];
export declare type NavigationType = string | "allplain" | "top";
export declare class Navigation {
private fileExtension;
private breadcrumbStartNode;
private structure;
private breadcrumbs;
constructor(s: any, fileExtension?: string, breadcrumbStartNode?: INavigationNode);
constructor(s: any, fileExtension?: string, breadcrumbStartNode?: IBreadcrumbNode);
private writeNavigationEntry;
private renderBreadcrumb;
private initBreadcrumbs;
writeNavigation(type: NavigationType, writeHtml?: boolean, excludedFromAllPlain?: string[]): string;
getBreadcrumb(referencedFile: string, writeHtml?: boolean): string;
}
export {};
17 changes: 9 additions & 8 deletions js/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion js/site-structure-schema.d.ts

This file was deleted.

73 changes: 0 additions & 73 deletions js/site-structure-schema.js

This file was deleted.

1 change: 0 additions & 1 deletion js/site-structure-schema.js.map

This file was deleted.

90 changes: 90 additions & 0 deletions js/site-structure-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"IBranch": {
"additionalProperties": false,
"properties": {
"children": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/IBranch"
},
{
"$ref": "#/definitions/IStructureNode"
}
]
},
"title": "children",
"type": "array"
},
"navigation": {
"description": "Values can be any string. Special treatment for:\n- \"none\" : excluded from all navigations except \"allplain\"\n- \"top\" : default top navigation",
"title": "navigation",
"type": "string"
},
"title": {
"title": "title",
"type": "string"
}
},
"required": [
"children",
"title"
],
"title": "IBranch",
"type": "object"
},
"IStructureNode": {
"additionalProperties": false,
"properties": {
"children": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/IBranch"
},
{
"$ref": "#/definitions/IStructureNode"
}
]
},
"title": "children",
"type": "array"
},
"navigation": {
"description": "Values can be any string. Special treatment for:\n- \"none\" : excluded from all navigations except \"allplain\"\n- \"top\" : default top navigation",
"title": "navigation",
"type": "string"
},
"referencedFile": {
"title": "referencedFile",
"type": "string"
},
"title": {
"title": "title",
"type": "string"
}
},
"required": [
"referencedFile",
"title"
],
"title": "IStructureNode",
"type": "object"
}
},
"description": "Array of (child) elements in the site structure tree.",
"items": {
"anyOf": [
{
"$ref": "#/definitions/IBranch"
},
{
"$ref": "#/definitions/IStructureNode"
}
]
},
"type": "array"
}

Loading

0 comments on commit 38a98f6

Please sign in to comment.