mirror of
https://github.com/MatMoul/dokytree.git
synced 2025-11-20 22:42:05 +00:00
Inital commit
This commit is contained in:
3
samples/doc_v1/doc/_index.yaml
Normal file
3
samples/doc_v1/doc/_index.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
title: dokytree Documentation
|
||||
templates:
|
||||
node: '@index'
|
||||
5
samples/doc_v1/doc/about/_index.01.md
Normal file
5
samples/doc_v1/doc/about/_index.01.md
Normal file
@@ -0,0 +1,5 @@
|
||||
dokytree is a documentation system.
|
||||
|
||||
It is intended to build a node tree document based on yaml file in directory tree.
|
||||
Pages are rendred with pugjs templates.
|
||||
You can add addition md, adoc, txt, ... files to extend your documentation.
|
||||
4
samples/doc_v1/doc/about/_index.yaml
Normal file
4
samples/doc_v1/doc/about/_index.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
index: 1
|
||||
title: About
|
||||
headfiles:
|
||||
- 01.md
|
||||
54
samples/doc_v1/doc/document/_index.01.md
Normal file
54
samples/doc_v1/doc/document/_index.01.md
Normal file
@@ -0,0 +1,54 @@
|
||||
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
|
||||
``` json
|
||||
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
|
||||
``` json
|
||||
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
|
||||
}
|
||||
```
|
||||
4
samples/doc_v1/doc/document/_index.yaml
Normal file
4
samples/doc_v1/doc/document/_index.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
index: 4
|
||||
title: Document
|
||||
files:
|
||||
- 01.md
|
||||
17
samples/doc_v1/doc/structure/01_tree/_index.01.md
Normal file
17
samples/doc_v1/doc/structure/01_tree/_index.01.md
Normal file
@@ -0,0 +1,17 @@
|
||||
```
|
||||
doc
|
||||
|- doc/ # Documentation tree
|
||||
| |- category/ # Child node
|
||||
| | |- _index.yaml # Node information
|
||||
| | |- item1.yaml # Item data
|
||||
| | |- item1.01.md # Item extra file
|
||||
| |- _index.yaml # Node information
|
||||
| |- _index.01.md # Node extra file
|
||||
| |- _index.01.txt # Node extra file
|
||||
| |- _index.01.pug # Node extra file
|
||||
| |- _index.01.svg # Node extra file
|
||||
|- templates/ # Pug Templates
|
||||
| |- template1.pug # A pugjs template
|
||||
| |- template2.pug # A pugjs template
|
||||
|- doc.yaml # Documentation main file
|
||||
```
|
||||
3
samples/doc_v1/doc/structure/01_tree/_index.yaml
Normal file
3
samples/doc_v1/doc/structure/01_tree/_index.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
title: Tree
|
||||
headfiles:
|
||||
- 01.md
|
||||
4
samples/doc_v1/doc/structure/02_doc.yaml/_index.01.md
Normal file
4
samples/doc_v1/doc/structure/02_doc.yaml/_index.01.md
Normal file
@@ -0,0 +1,4 @@
|
||||
``` yaml
|
||||
doc: 'doc' # Optional: Documentation directory
|
||||
templates: 'templates' # Optional: Templates directory
|
||||
```
|
||||
3
samples/doc_v1/doc/structure/02_doc.yaml/_index.yaml
Normal file
3
samples/doc_v1/doc/structure/02_doc.yaml/_index.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
title: doc.yaml
|
||||
files:
|
||||
- 01.md
|
||||
15
samples/doc_v1/doc/structure/03_index.yaml/_index.01.md
Normal file
15
samples/doc_v1/doc/structure/03_index.yaml/_index.01.md
Normal file
@@ -0,0 +1,15 @@
|
||||
``` yaml
|
||||
index: 1 # Optional: Override node index
|
||||
title: Documentation # Optional: Override node title
|
||||
toc: true # Optional: Show in TOC (default: true)
|
||||
book: true # Optional: Include in book (default: true)
|
||||
templates: # Optional: Templates
|
||||
node: 'template1' # Optional: Node template (default: @node)
|
||||
items: 'template2' # Optional: Items template (default: @item)
|
||||
headfiles: # Optional: Additional file on top of node document
|
||||
- 01.md
|
||||
files: # Optional: Additional file in node document
|
||||
- 01.md
|
||||
footfiles:
|
||||
- 01.md # Optional: Additional file at bootom of node document
|
||||
```
|
||||
3
samples/doc_v1/doc/structure/03_index.yaml/_index.yaml
Normal file
3
samples/doc_v1/doc/structure/03_index.yaml/_index.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
title: _index.yaml
|
||||
files:
|
||||
- 01.md
|
||||
9
samples/doc_v1/doc/structure/04_item.yaml/_index.01.md
Normal file
9
samples/doc_v1/doc/structure/04_item.yaml/_index.01.md
Normal file
@@ -0,0 +1,9 @@
|
||||
``` yaml
|
||||
name: Item1 # Optional: Override name of item
|
||||
headfiles: # Optional: Additional file on top of node document
|
||||
- 01.md
|
||||
files: # Optional: Additional file in node document
|
||||
- 01.md
|
||||
footfiles: # Optional: Additional file at bootom of node document
|
||||
- 01.md
|
||||
```
|
||||
3
samples/doc_v1/doc/structure/04_item.yaml/_index.yaml
Normal file
3
samples/doc_v1/doc/structure/04_item.yaml/_index.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
title: item.yaml
|
||||
files:
|
||||
- 01.md
|
||||
@@ -0,0 +1,9 @@
|
||||
You can store additionnal files related to the yaml file.
|
||||
As exemple, with _index.yaml, you can add _index.01.md or _index.01.svg.
|
||||
You can use the same method with item.yaml files.
|
||||
Thoses files can be added as headfile, file or footfiles just using 01.md or 01.svg.
|
||||
|
||||
### Supported extentions
|
||||
Text: txt adoc
|
||||
Parsed: md html pug
|
||||
Images: svg png jpg jpeg gif bmp
|
||||
@@ -0,0 +1,3 @@
|
||||
title: .file.ext
|
||||
files:
|
||||
- 01.md
|
||||
19
samples/doc_v1/doc/structure/06_template.pug/_index.01.md
Normal file
19
samples/doc_v1/doc/structure/06_template.pug/_index.01.md
Normal file
@@ -0,0 +1,19 @@
|
||||
``` pug
|
||||
div#HEADFILES // Headfiles container
|
||||
// Your pugjs code
|
||||
div#FILES // Files container
|
||||
// Your pugjs code
|
||||
div#FOOTFILES // Footfiles container
|
||||
```
|
||||
|
||||
### Informations
|
||||
|
||||
pugjs documentation can be found here :
|
||||
[https://pugjs.org/](https://pugjs.org/)
|
||||
|
||||
When you use pugjs with dokytree, you have some additional objets :
|
||||
```
|
||||
doc // The document root node
|
||||
node // The current node
|
||||
compareIP // A helper to sort IP v4
|
||||
```
|
||||
3
samples/doc_v1/doc/structure/06_template.pug/_index.yaml
Normal file
3
samples/doc_v1/doc/structure/06_template.pug/_index.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
title: template.pug
|
||||
files:
|
||||
- 01.md
|
||||
4
samples/doc_v1/doc/structure/_index.yaml
Normal file
4
samples/doc_v1/doc/structure/_index.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
index: 3
|
||||
title: Structure
|
||||
templates:
|
||||
- node: '@overview'
|
||||
14
samples/doc_v1/doc/usage/_index.01.md
Normal file
14
samples/doc_v1/doc/usage/_index.01.md
Normal file
@@ -0,0 +1,14 @@
|
||||
```
|
||||
node app.js [args] docfile.yaml
|
||||
-p | --port Set listen port (default : 3000)
|
||||
-b | --bind Set listen ip (default : 127.0.0.1)
|
||||
```
|
||||
|
||||
This command start the documentation server.
|
||||
You can use it to view your changes.
|
||||
Then you can click on book link and print your doc as pdf.
|
||||
|
||||
### Additional tools
|
||||
VSCode - Editor for your documentation.
|
||||
Chromium or derived browser - To print PDF with converted link.
|
||||
Draw.io - Editor for schemas.
|
||||
4
samples/doc_v1/doc/usage/_index.yaml
Normal file
4
samples/doc_v1/doc/usage/_index.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
index: 2
|
||||
title: Usage
|
||||
headfiles:
|
||||
- 01.md
|
||||
Reference in New Issue
Block a user