Docs/frontmatter: init automatic reference for frontmatter

This commit is contained in:
Johannes Kirschbauer
2024-11-19 10:35:13 +01:00
parent 6f5ba08118
commit 8544387d65
8 changed files with 123 additions and 77 deletions

View File

@@ -63,7 +63,7 @@ description = "Module A"
This is the example module that does xyz.
```
See the [frontmatter reference](#frontmatter-reference) for all supported attributes.
See the [Full Frontmatter reference](../reference/clanModules/frontmatter/index.md) further details and all supported attributes.
## Roles
@@ -148,61 +148,4 @@ Assuming that there is a common code path or a common interface between `server`
# ...
imports = [ ../common.nix ];
}
```
## Frontmatter Reference
`description` (**Required** `String`)
: Short description of the module
`categories` (Optional `[ String ]`)
: default `[ "Uncategorized" ]`
Categories are used for Grouping and searching.
While initial oriented on [freedesktop](https://specifications.freedesktop.org/menu-spec/latest/category-registry.html) the following categories are allowed
- AudioVideo
- Audio
- Video
- Development
- Education
- Game
- Graphics
- Social
- Network
- Office
- Science
- System
- Settings
- Utility
- Uncategorized
`features` (Optional `[ String ]`)
: default `[]`
Clans Features that the module implements support for.
Available feature flags are:
- `inventory`
!!! warning "Important"
Every ClanModule, that specifies `features = [ "inventory" ]` MUST have at least one role.
Many modules use `roles/default.nix` which registers the role `default`.
If you are a clan module author and your module has only one role where you cannot determine the name, then we would like you to follow the convention.
`constraints.roles.<roleName>.<constraintType>` (Optional `int`) (Experimental)
: Contraints for the module
The following example requires exactly one `server`
and supports up to `7` clients
```md
---
constraints.roles.server.eq = 1
constraints.roles.client.max = 7
---
```
```