115 lines
2.2 KiB
Plaintext
115 lines
2.2 KiB
Plaintext
---
|
|
id: {{ id }}
|
|
type: guideline
|
|
title: {{ title }}
|
|
created: {{ created }}
|
|
modified: {{ modified }}
|
|
tags: [{% for tag in tags %}"{{ tag }}"{% if not loop.last %}, {% endif %}{% endfor %}]
|
|
status: {{ status | default(value="active") }}
|
|
{% if language -%}
|
|
language: {{ language }}
|
|
{% endif -%}
|
|
{% if category -%}
|
|
category: {{ category }}
|
|
{% endif -%}
|
|
{% if relates_to and relates_to | length > 0 -%}
|
|
relates_to:
|
|
{% for rel in relates_to %} - {{ rel }}
|
|
{% endfor %}
|
|
{%- endif %}
|
|
{% if extends and extends | length > 0 -%}
|
|
extends:
|
|
{% for ext in extends %} - {{ ext }}
|
|
{% endfor %}
|
|
{%- endif %}
|
|
{% if project -%}
|
|
project: {{ project }}
|
|
{% endif -%}
|
|
---
|
|
|
|
# {{ title }}
|
|
|
|
{% if language %}**Language:** {{ language }}{% endif %}
|
|
{% if category %}**Category:** {{ category }}{% endif %}
|
|
|
|
## Overview
|
|
|
|
{{ overview | default(value="TODO: Brief overview of this guideline") }}
|
|
|
|
## Rules
|
|
|
|
{% if rules and rules | length > 0 %}
|
|
{% for rule in rules %}
|
|
{{ loop.index }}. **{{ rule.title }}**
|
|
{{ rule.description }}
|
|
{% if rule.rationale %}
|
|
*Rationale:* {{ rule.rationale }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% else %}
|
|
TODO: List the specific rules or best practices
|
|
|
|
1. **Rule Name**
|
|
Description of the rule
|
|
|
|
*Rationale:* Why this rule exists
|
|
{% endif %}
|
|
|
|
## Examples
|
|
|
|
{% if examples and examples | length > 0 %}
|
|
{% for example in examples %}
|
|
### {{ example.title }}
|
|
|
|
{% if example.description %}{{ example.description }}{% endif %}
|
|
|
|
{% if example.good %}
|
|
**✅ Good:**
|
|
```{{ language | default(value="") }}
|
|
{{ example.good }}
|
|
```
|
|
{% endif %}
|
|
|
|
{% if example.bad %}
|
|
**❌ Bad:**
|
|
```{{ language | default(value="") }}
|
|
{{ example.bad }}
|
|
```
|
|
{% endif %}
|
|
|
|
{% if example.explanation %}
|
|
{{ example.explanation }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% else %}
|
|
TODO: Provide examples of good and bad practices
|
|
|
|
### Example 1
|
|
|
|
**✅ Good:**
|
|
```{{ language | default(value="") }}
|
|
// Good example
|
|
```
|
|
|
|
**❌ Bad:**
|
|
```{{ language | default(value="") }}
|
|
// Bad example
|
|
```
|
|
{% endif %}
|
|
|
|
{% if exceptions and exceptions | length > 0 %}
|
|
## Exceptions
|
|
|
|
{% for exception in exceptions %}
|
|
- {{ exception }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
|
|
{% if references and references | length > 0 %}
|
|
## References
|
|
|
|
{% for ref in references %}
|
|
- [[{{ ref }}]]
|
|
{% endfor %}
|
|
{% endif %}
|