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

Handlebars spills through into API viewer #1873

Open
KitsuneRal opened this issue Jun 17, 2024 · 2 comments
Open

Handlebars spills through into API viewer #1873

KitsuneRal opened this issue Jun 17, 2024 · 2 comments
Labels
aesthetic A suggestion or issue relating to the representation of the spec

Comments

@KitsuneRal
Copy link
Member

Link to problem area:
https://github.com/matrix-org/matrix-spec/blob/main/data/api/client-server/content-repo.yaml#L226 and elsewhere in the same file.

Issue
API description files can be used by code generation tools, and our own API viewer consumes them. While it's still sort of readable through the handlebars, I'd rather stick to Markdown in API files.

@KitsuneRal KitsuneRal added the aesthetic A suggestion or issue relating to the representation of the spec label Jun 17, 2024
@turt2live
Copy link
Member

fwiw, I did this deliberately to improve readability of the rendered spec - the fallback to text isn't great, but still readable enough.

I prefer we stay away from **Note**: syntax as much as possible, as we cannot keep the style consistent (sometimes bold, sometimes italic, sometimes lower/upper case, etc)

KitsuneRal added a commit to quotient-im/libQuotient that referenced this issue Jun 30, 2024
Namely, GTAD itself had to be updated to support patternProperties and
mx-* format names; and gtad.yaml now substitutes `{{% boxes/note %}}`
with a Doxygen \note tag (see also
matrix-org/matrix-spec#1873).
@KitsuneRal
Copy link
Member Author

KitsuneRal commented Jun 30, 2024

Okay, I think I agree with the rationale. That makes for an interesting precedent of using a more structured markup layer over Markdown - I wonder if there was prior art here, we are likely not the first ones stumbling over it. I don't seem to find anything quickly though.

In the meantime, what we could do then is to replace handlebars with Markdown when preparing a consolidated API description for the API Viewer; and owners of other generated code can do replacements that work best for them (e.g. for Quotient I would replace handlebars with Doxygen tags in generated C++ code).

KitsuneRal added a commit to quotient-im/libQuotient that referenced this issue Jun 30, 2024
- GTAD itself had to be updated to support patternProperties and
  mx-* format names
- gtad.yaml now substitutes `{{% boxes/note %}}` with a Doxygen \note
  tag (see also matrix-org/matrix-spec#1873)
- endpoint deprecation is supported now (desirable for content-repo.*
  to make the message about moving to authed media very clear).
@KitsuneRal KitsuneRal changed the title Handlebars in API description files Handlebars spills through into API viewer Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aesthetic A suggestion or issue relating to the representation of the spec
Projects
None yet
Development

No branches or pull requests

2 participants