Skip to content

okforest/type-template

errorOKForest conventions

Each type template in .okforest/types/ starts with front matter naming its type, and a type has one template.

A type can have a template beside its schema, in .okforest/types/ (metric.template.md): the page a new concept of that type starts as, like GitHub’s issue templates. okforest new and OKForest’s new-page form copy it as written, its front matter in its own order and its body, with the new page’s title and description; guidance for authors goes in HTML comments. A template needn’t satisfy its type’s schema: an empty field is how it says “fill this in”, and the new page is checked like any concept. The template’s own type says which type it’s for, so it must have front matter naming one; a second template for the same type is reported, and the first by path is used. A template is never a concept: nothing under .okforest/ is (Templates).

This file breaks the rule:

.okforest/types/metric.template.md
---
status: draft
owner:
---
<!-- What is counted, and over what period. -->
# Definition

okforest validate reports:

.okforest/types/metric.template.md
1:1 error A type template needs a `type`: the type it's for, as concepts write it. okforest/type-template

Fixed:

.okforest/types/metric.template.md
---
type: Metric
status: draft
owner:
---
<!-- What is counted, and over what period. -->
# Definition