dokytree/samples/doc_v1/doc/document/_index.01.md
2023-03-09 00:38:30 +01:00

1.4 KiB

Document is structured as nodes.
The doc object is the root node.
Nodes contains child nodes and items.

root
 |-nodes
 |  |-node
 |  |  |-nodes
 |  |  |  |-nodes
 |  |  |  |-items
 |  |  |-items
 |  |     |-item1
 |  |-node
 |     |-nodes
 |     |  |-nodes
 |     |  |-items
 |     |-items
 |        |-item1
 |-items

Node

node: {
	name: '',               // ReadOnly: File name
	title: '',              // Optional: Title (default: name)
	toc: true,              // Optional: Show in TOC (default: true)
	book: true,             // Optional: Include in Book (default: true)
	url: '/',               // ReadOnly: Node URL
	templates: {            // Optional
		node: '@node',        // Optional: Node template (default: @node)
		items: '@item',       // Optional: Items template (default: @item)
	},
	parent: null,           // ReadOnly: Parent node
	nodes: [],              // ReadOnly: Child nodes
	items: [],              // ReadOnly: Items
	getNode: (name) => {},  // Function: Get child node by name
	getItem: (name) => {},  // Function: Get item by name
}

Item

item: {
	name: '',      // Optional: Name
	title: '',     // Optional: Title (default: name)
	toc: false,    // Optional: Show in TOC (default: false)
	book: true,    // Optional: Include in Book (default: true)
	url: '',       // ReadOnly: Item URL
	data: {},      // ReadOnly: Item Data
}