mirror of
https://github.com/Icinga/icinga-docs-tools.git
synced 2025-07-26 15:24:02 +02:00
Add category option for projects
This commit is contained in:
parent
ea48dfa768
commit
c6650ffa3c
@ -20,6 +20,7 @@ This file defines generally for which projects documentation should be build. Al
|
|||||||
| `latest` | If set to `true`, the project will be cloned into a `latest` directory. |
|
| `latest` | If set to `true`, the project will be cloned into a `latest` directory. |
|
||||||
| `target` | Target directory within `projects_dir` |
|
| `target` | Target directory within `projects_dir` |
|
||||||
| `docs_dir` | Directory that includes the `*.md` files |
|
| `docs_dir` | Directory that includes the `*.md` files |
|
||||||
|
| `category` | If set, the projects will be displayed under this category |
|
||||||
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
@ -5,6 +5,7 @@ require 'git'
|
|||||||
|
|
||||||
config = YAML::load_file('config.yml')
|
config = YAML::load_file('config.yml')
|
||||||
mkdocs = YAML::load_file('mkdocs.template.yml')
|
mkdocs = YAML::load_file('mkdocs.template.yml')
|
||||||
|
categories = {}
|
||||||
|
|
||||||
config['projects'].each do |project_name, project_config|
|
config['projects'].each do |project_name, project_config|
|
||||||
puts "== #{project_name}"
|
puts "== #{project_name}"
|
||||||
@ -46,8 +47,19 @@ config['projects'].each do |project_name, project_config|
|
|||||||
header = filename[2].gsub('-', ' ').split.map(&:capitalize).join(' ')
|
header = filename[2].gsub('-', ' ').split.map(&:capitalize).join(' ')
|
||||||
pages.push(header => filepath)
|
pages.push(header => filepath)
|
||||||
end
|
end
|
||||||
mkdocs['pages'].push(project_name => pages)
|
|
||||||
|
|
||||||
|
if project_config['category']
|
||||||
|
categories[project_config['category']] = [] unless categories[project_config['category']]
|
||||||
|
categories[project_config['category']].push(project_name => pages)
|
||||||
|
else
|
||||||
|
mkdocs['pages'].push(project_name => pages)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if categories
|
||||||
|
categories.each do |cat, proj|
|
||||||
|
mkdocs['pages'].push(cat => proj)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
mkdocs['extra']['append_pages'].each do |name, target|
|
mkdocs['extra']['append_pages'].each do |name, target|
|
||||||
|
@ -19,9 +19,11 @@ projects:
|
|||||||
latest: true
|
latest: true
|
||||||
target: 'director'
|
target: 'director'
|
||||||
docs_dir: 'doc'
|
docs_dir: 'doc'
|
||||||
|
category: 'Modules'
|
||||||
Business Process:
|
Business Process:
|
||||||
git: 'https://github.com/Icinga/icingaweb2-module-businessprocess.git'
|
git: 'https://github.com/Icinga/icingaweb2-module-businessprocess.git'
|
||||||
ref: 'tags/v2.1.0'
|
ref: 'tags/v2.1.0'
|
||||||
latest: true
|
latest: true
|
||||||
target: 'businessprocess'
|
target: 'businessprocess'
|
||||||
docs_dir: 'doc'
|
docs_dir: 'doc'
|
||||||
|
category: 'Modules'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user