You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Liquid template that renders the data definition into an AsciiDoc table.
// The data context passed in is called `context`.
{% liquidassigntable_name = context.nameassigntable_anchor = "tab-" | concat:context.name | replace" ", "_"
%}
[[{{ table_anchor }}]]
.{{ table_name }}
|===
| Name | Data Type | Data Description
{% foritemincontext.attributes %}
| *{{ item.name }}*
{% caseitem.data_type.kind %}
{% when"Array" %}
| Array _<{{ item.data_type.inner_kind }}>_[*{{ item.data_type.occurrence }}*]
{% else %}
| _{{ item.data_type.kind }}_
{% endcase %}
| {% ifitem.required %}(Required){% else %}(Optional){% endif %}
{{ item.description }}
{% endfor %}
|===
Entity_schema_definition.yaml
Data definition of the Entity_schema_definition object.
Entity_schema_definition.yaml
---
name: Entity_schema_definitionattributes:
- name: entity_typedata_type:
kind: UnsignedIntegerdescription: entity_type represents the entity type, that is being described by the array of schema tokens.required: true
- name: token_countdata_type:
kind: UnsignedIntegerdescription: Number of tokens describing this entity typerequired: true
- name: schema_tokensdata_type:
kind: Arrayinner_kind: UnsignedIntegeroccurrence: token_countdescription: Array of schema tokens describing this entity typerequired: true
Afterthoughts
If you'd like to apply this to multiple tables you could use Arnaud's approach here with nested blocks:
Potential guest post from @stuartgalt 😉
issue-385.zip
Output:
issue-385.pdf
The files are:
document.adoc
: holder of content that includes the[yaml2text]
block.data_definition_table.liquid
: Liquid template that renders the data definition into an AsciiDoc table.Entity_schema_definition.yaml
: Data definition of theEntity_schema_definition
object.document.adoc
Holder of content that includes the
[yaml2text]
block.data_definition_table.liquid
Liquid template that renders the data definition into an AsciiDoc table.
Entity_schema_definition.yaml
Data definition of the
Entity_schema_definition
object.Entity_schema_definition.yaml
Afterthoughts
If you'd like to apply this to multiple tables you could use Arnaud's approach here with nested blocks:
Which would look like this
Where
sections/profiles.json
is a list of YAML file paths to be read.Originally posted by @ronaldtse in metanorma/metanorma#385 (comment)
The text was updated successfully, but these errors were encountered: