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 all 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
40 changes: 40 additions & 0 deletions _data/metadata_registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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/16/asdf.jpg
- key: bot
description: >-
Lets bot runners provide the name of their bot software. Setting this key
identifies the client as a bot.
format: Any string
examples: |-
PacketBot v1.2
JitiBot
melo3
- 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.
May contain emoji.
format: Any string
examples: |-
James Wheare
DanielOaks marked this conversation as resolved.
Show resolved Hide resolved
Posiden
ダニエル
Борис
- key: homepage
description: >-
URL of a webpage that contains more information about the user/bot themselves,
or bot software in use.
format: Valid URL
examples: |-
https://example.com/bot-info.html
- 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
42 changes: 41 additions & 1 deletion registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ page-header: >

This page lists the tags, capabilities, commands, batches and metadata keys that have been defined by the IRCv3 Working Group, are described by our specifications, or that we otherwise recommend using.

<div class="irc-sw-list flexy-list">
<div class="irc-sw-list flexy-list" style="max-width: 60rem;">
{% 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