erikaheidi / yamldocs
1.0.4
2023-07-13 17:09 UTC
Requires
- minicli/command-help: ^1.0
- minicli/minicli: ^4.0
- minicli/stencil: ^0.2.1
- symfony/yaml: ^6.1
Requires (Dev)
- pestphp/pest: ^1.21
- dev-main
- v1.0.x-dev
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.1.2
- 0.1.1
- 0.1.0
- dev-update-stencil
- dev-use-env-overwrite
- dev-fix-bin
- dev-update-default-builder
- dev-refactor-builders
- dev-recursive
- dev-yaml-config
- dev-refactoring-document
- dev-expand-meta
- dev-support-custom-templates
- dev-collapse-nodes
This package is auto-updated.
Last update: 2023-07-13 17:18:24 UTC
README
Yamldocs 是一个基于 YAML 文件的 Markdown 文档生成器,使用 PHP 和 Minicli 编写。它可以作为一个独立的应用程序使用,也可以作为 Composer 的 bin 命令包含在现有项目中。它可用于创建可通过模板和通用构建器接口自定义的自动化参考文档。
有关安装和使用说明,请访问文档网站。
示例
示例 YAML
此 YAML 展示了定义文档的结构和生成的 Markdown 的方式
Section1: #structure is based on the actual yaml Item1: value0 Item2: value1 Item3: - value12 - value13 Item4: value2 Section2: Item1: - value12 - value13 Item2: value1 Item3: value3 Item4: value2 # The document is described in the _meta node, but there are no required fields. Markdown will be generated anyways, # based on the structure of the YAML document. _meta: # Each node has a description (info) and an array of items that will be presented as a table. Section1: info: Information about Section 1 items: Item1: The first row Item2: The second row Section2: info: Information about Section 2 items: Item3: The third row Item4: The fourth row # Setting up a custom example example: | Section2: Item1: - value01 - value02
构建单个文档
./bin/yamldocs build markdown file=example.yaml output=example.md
生成的 Markdown 内容
## example.yaml example.yaml YAML reference ## Section1 Information about Section 1 ### Reference | Directive | Expects | |-----------|-------------------------| | Item1 | (String) The first row | | Item2 | (String) The second row | | Item3 | (Array) | | Item4 | (String) | ### Example ```yaml Section1: Item1: value0 Item2: value1 Item3: - value12 - value13 Item4: value2 ``` ## Section2 Information about Section 2 ### Reference | Directive | Expects | |-----------|-------------------------| | Item1 | (Array) | | Item2 | (String) | | Item3 | (String) The third row | | Item4 | (String) The fourth row | ### Example ```yaml Section2: Item1: - value01 - value02 ```
构建多个文档
使用 build docs
命令构建目录中所有 YAML 文件的 Markdown 文档。添加 --recursively
以构建子目录。
./bin/yamldocs build docs source=var/yaml output=var/output --recursive
有关更多信息和使用说明,请查看完整文档。