-
Notifications
You must be signed in to change notification settings - Fork 21
/
class.md.jinja2
85 lines (66 loc) · 2.22 KB
/
class.md.jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{%- if element.is_a == "Checklist" -%}
{%- set type = "Checklist" -%}
{%- elif element.is_a == "Extension" -%}
{%- set type = "Extension" -%}
{%- elif element.mixins and element.is_a -%}
{%- set type = "Combination" -%}
{%- else -%}
{%- set type = "Class" -%}
{%- endif -%}
{%- if element.title %}
{%- set title = element.title ~ ' (' ~ element.name ~ ')' -%}
{%- else %}
{%- if gen.use_class_uris -%}
{%- set title = element.name -%}
{%- else -%}
{%- set title = gen.name(element) -%}
{%- endif -%}
{%- endif -%}
# {{ type }}: {{ title }} {% if element.deprecated %} <span style="color: red;"><strong> (DEPRECATED) </strong> {% endif %}
{%- if header -%}
{{header}}
{%- endif -%}
{% if element.description %}
{% set element_description_lines = element.description.split('\n') %}
{% for element_description_line in element_description_lines %}
_{{ element_description_line }}_
{% endfor %}
{% endif %}
{% if element.abstract %}
* __NOTE__: this is an abstract class and should not be instantiated directly
{% endif %}
{% if element.mixins and element.is_a -%}
## Composition
{{ gen.link(element.mixins[0]) }} [Checklist] + {{ gen.link(element.is_a) }} [Extension]
{% endif %}
## Terms
| MIXS ID | Name | Cardinality and Range | Description |
| --- | --- | --- | --- |
{% if gen.get_direct_slots(element)|length > 0 %}
{%- for slot in gen.get_direct_slots(element) -%}
| {{ gen.uri_link(slot) }} | {{ gen.link(slot) }} | {{ gen.cardinality(slot) }} <br/> {{ gen.link(slot.range) }} | {{ slot.description|enshorten }} |
{% endfor -%}
{% endif -%}
{% if gen.get_indirect_slots(element)|length > 0 %}
{%- for slot in gen.get_indirect_slots(element) -%}
| {{ gen.uri_link(slot) }} | {{ gen.link(slot) }} | {{ gen.cardinality(slot) }} <br/> {{ gen.link(slot.range) }} | {{ slot.description|enshorten }} |
{% endfor -%}
{% endif %}
{% include "common_metadata.md.jinja2" %}
## LinkML Source
<!-- TODO: investigate https://stackoverflow.com/questions/37606292/how-to-create-tabbed-code-blocks-in-mkdocs-or-sphinx -->
### Direct
<details>
```yaml
{{gen.yaml(element)}}
```
</details>
### Induced
<details>
```yaml
{{gen.yaml(element, inferred=True)}}
```
</details>
{%- if footer -%}
{{footer}}
{%- endif -%}