Skip to content

Conversation

@yufeih
Copy link
Contributor

@yufeih yufeih commented Oct 4, 2023

This PR proposes the draft shape of the ApiPage schema.

#9266

@yufeih yufeih added the new-feature Makes the pull request to appear in "New Features" section of the next release note label Oct 4, 2023
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

📢 Thoughts on this report? Let us know!.

@yufeih yufeih closed this Oct 4, 2023
@yufeih yufeih reopened this Oct 4, 2023
@yufeih yufeih changed the title feat: Generic API page feat: Generic API page schema Oct 7, 2023
@yufeih yufeih merged commit 6033dcf into main Oct 7, 2023
@yufeih yufeih deleted the apipage branch October 7, 2023 05:55
/** Code text */
code: string;

/** Code [langauge identifier](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) */

Choose a reason for hiding this comment

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

Suggested change
/** Code [langauge identifier](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) */
/** Code [language identifier](https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers) */

Comment on lines +47 to +48
/** Opaque metadata about the API as HTML data-* attributes */
metadata?: { [key: string]: string };

Choose a reason for hiding this comment

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

Not clear whether the "data-" prefix is part of the key here, or added during the conversion to HTML.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

data- is added to key, will adjust the comment to clarify.

/** Page title */
title: string;

/** Opaque metadata about the page as HTML <meta> tags */

Choose a reason for hiding this comment

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

Willl this documentation be parsed as Markdown? If so, <meta> should be quoted or escaped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, properties using markdown formats are explicitly typed as markdown, such as parameters.description.

Copy link

@KalleOlaviNiemitalo KalleOlaviNiemitalo Oct 7, 2023

Choose a reason for hiding this comment

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

I meant the documentation of the property, not the value of the property.

 /** Opaque metadata about the page as HTML `<meta>` tags  */

because you used Markdown syntax for hyperlinks in the documentation of other properties.

Comment on lines +22 to +29
/** Represents a heading */
type Heading =
| { /** Heading title */ h1: string; /** URL fragment */ id?: string }
| { /** Heading title */ h2: string; /** URL fragment */ id?: string }
| { /** Heading title */ h3: string; /** URL fragment */ id?: string }
| { /** Heading title */ h4: string; /** URL fragment */ id?: string }
| { /** Heading title */ h5: string; /** URL fragment */ id?: string }
| { /** Heading title */ h6: string; /** URL fragment */ id?: string };

Choose a reason for hiding this comment

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

Does "URL fragment" mean it is expected to match the fragment definition in https://www.rfc-editor.org/rfc/rfc3986#section-3.5? I.e. does not include #, and can contain pct-encoded.

Copy link
Contributor Author

@yufeih yufeih Oct 7, 2023

Choose a reason for hiding this comment

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

Yes, renderers are not expected to change this id to match rfc3986, renders MAY encode the id to produce valid HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature Makes the pull request to appear in "New Features" section of the next release note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants