Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial metadata registry #244

Merged
merged 7 commits into from
Jul 15, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions _data/metadata_registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# User Metadata
- name: User Metadata
values:
- key: avatar
description: Avatar that graphical clients can show alongside the user's name
format: URL with an optional `{size}` substitution denoting the size to load in pixels
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it height or width?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original issue stated "square dimension" so both.

examples: https://example.com/avatar/{size}/asdf.jpg
- key: bot-url
DanielOaks marked this conversation as resolved.
Show resolved Hide resolved
description: >-
Lets bot runners provide a URL for more info on a bot user so they can be
identified as such in UI
format: Valid URL
examples: |-
https://example.com/bot-info.html
- key: display-name
description: >-
Alternative name to use instead of a nick for display purposes. Useful for gateways
to chat services that allow spaces and other characters in nicks. A nick is
required for standard protocol level stuff but can be less prominent in the UI
format: Any string
examples: |-
James Wheare
DanielOaks marked this conversation as resolved.
Show resolved Hide resolved
Posiden🦑
ダニエル
Борис
- key: status
description: Status text that can be shown for users without making them 'away'
format: Any string
examples: |-
Working from home
19 changes: 19 additions & 0 deletions _data/validation/metadata_registry.meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root:
type: listofdicts
kids:
name:
type: string
values:
type: listofdicts
kids:
key:
type: string
format:
type: string
description:
type: string
examples:
type: string
specs:
type: listofstrings
required: false
3 changes: 3 additions & 0 deletions css/style.sass
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ table
margin-top: 0
&:last-child
margin-top: 0
code.examples
margin-top: 0.4em
display: block
th
font-weight: 500
text-align: left
Expand Down
40 changes: 40 additions & 0 deletions registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ This page lists the tags, capabilities, commands, batches and metadata keys that
{% for type in site.data.registry %}
<a href="#{{ type.name | slugify }}">{{ type.name }}</a>
{% endfor %}
{% for type in site.data.metadata_registry %}
DanielOaks marked this conversation as resolved.
Show resolved Hide resolved
<a href="#{{ type.name | slugify }}">{{ type.name }}</a>
{% endfor %}
{% for type in site.data.standard_replies_registry %}
<a href="#{{ type.name | slugify }}">{{ type.name }}</a>
{% endfor %}
Expand Down Expand Up @@ -56,6 +59,43 @@ This page lists the tags, capabilities, commands, batches and metadata keys that
</table>
{% endfor %}

{% for type in site.data.metadata_registry %}
<h2 id="{{ type.name | slugify }}">{{ type.name }}</h2>
<table class="fullwidth">
<thead>
<tr>
<th style="text-align: center">Key</th>
<th>Format</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for val in type.values %}
<tr>
<td style="min-width: 5rem; white-space: nowrap">
<code>{{ val.key }}</code>
</td>
<td style="min-width: 10rem">
{% if val.format-mono %}<code>{{ val.format }}</code>{% else %}{{ val.format | markdownify | replace:"<p>","" | replace:"</p>","" }}{% endif %}
<br>
{% if val.examples %}
<code class="examples">{{ val.examples | newline_to_br }}</code>
{% endif %}
</td>
<td>
{{ val.description | markdownify | replace:"<p>","" | replace:"</p>","" }}
{% assign i = 1 %}
{% for link in val.links %}
<sup><a href="{{ site.baseurl }}{{ link }}">({{i}})</a></sup>
{% assign i = i | plus: 1 %}
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}

{% for type in site.data.standard_replies_registry %}
<h2 id="{{ type.name | slugify }}">{{ type.name }}</h2>
<table class="fullwidth">
Expand Down