Skip to content

Commit

Permalink
docs: improve individual readme usage sections (#1583)
Browse files Browse the repository at this point in the history
* docs: improve individual readme usage sections

* fix(userstyles.schema.json): disable `additionalProperties` for all objects
  • Loading branch information
uncenter authored Jan 21, 2025
1 parent 421cb76 commit d1e9fa4
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 53 deletions.
2 changes: 1 addition & 1 deletion scripts/generate/readme-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function generateStyleReadmes(userstyles: UserstylesSchema.Userstyles) {
const readmeContent = Handlebars.compile(stylesReadmeContent)({
heading: heading(name, readme["app-link"]),
slug,
usage: readme.usage,
note: readme.note,
faq: readme.faq,
collaborators: {
currentMaintainers: extractName(currentMaintainers),
Expand Down
8 changes: 6 additions & 2 deletions scripts/generate/templates/userstyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
<img src="preview.webp"/>
</p>

{{#if usage}}
## Usage
{{{ usage }}}

See [the userstyle usage instructions](../../docs/USAGE.md).

{{#if note}}
> [!NOTE]
> {{{ note }}}
{{/if}}

{{#if faq}}
Expand Down
6 changes: 3 additions & 3 deletions scripts/types/userstyles.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ export type Icon = string;
*/
export type ApplicationLink = [string, string, ...string[]] | string;
/**
* The Usage section of the userstyle README.
* An additional note for the Usage section of the userstyle README.
*/
export type Usage = string;
export type Note = string;
/**
* The FAQ section of the userstyle README.
*
Expand Down Expand Up @@ -184,7 +184,7 @@ export interface Userstyle {
*/
export interface README {
"app-link": ApplicationLink;
usage?: Usage;
note?: Note;
faq?: FAQ;
[k: string]: unknown;
}
31 changes: 17 additions & 14 deletions scripts/userstyles.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
"type": "object",
"description": "The directory of the userstyle.",
"examples": ["youtube"],
"required": [
"name",
"categories",
"readme",
"color",
"current-maintainers"
],
"additionalProperties": false,
"properties": {
"name": {
Expand Down Expand Up @@ -85,7 +78,7 @@
"title": "README",
"description": "Options to help in the auto-generation of the userstyle README.",
"type": "object",
"required": ["app-link"],
"additionalProperties": false,
"properties": {
"app-link": {
"$id": "#userstyles/userstyle/readme/app-link",
Expand All @@ -108,10 +101,10 @@
}
]
},
"usage": {
"$id": "#userstyles/userstyle/readme/usage",
"title": "Usage",
"description": "The Usage section of the userstyle README.",
"note": {
"$id": "#userstyles/userstyle/readme/note",
"title": "Note",
"description": "An additional note for the Usage section of the userstyle README.",
"type": "string"
},
"faq": {
Expand All @@ -122,6 +115,7 @@
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"question": {
"type": "string",
Expand All @@ -137,7 +131,8 @@
"required": ["question", "answer"]
}
}
}
},
"required": ["app-link"]
},
"current-maintainers": {
"$id": "#userstyles/userstyle/current-maintainers",
Expand All @@ -154,7 +149,14 @@
"description": "List of all users that have maintained this userstyle in the past.",
"$ref": "#/$defs/collaborators"
}
}
},
"required": [
"name",
"categories",
"readme",
"color",
"current-maintainers"
]
}
}
},
Expand All @@ -173,6 +175,7 @@
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
Expand Down
48 changes: 15 additions & 33 deletions scripts/userstyles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,7 @@ userstyles:
color: sky
readme:
app-link: [https://anilist.co, https://anichart.net]
usage: |+
> [!NOTE]
> This theme applies to [AniChart](https://anichart.net/) as well, which is an extension of AniList.
note: This theme also applies to [AniChart](https://anichart.net/), an extension of AniList.
current-maintainers: [*anubisnekhet]
arch-wiki:
name: Arch Wiki
Expand All @@ -199,7 +197,7 @@ userstyles:
color: blue
readme:
app-link: https://wiki.archlinux.org
usage: "Make sure to use the default **Light** theme"
note: "Make sure to use the default **Light** theme."
current-maintainers: []
past-maintainers: [*genshibe]
boringproxy:
Expand All @@ -216,7 +214,7 @@ userstyles:
color: peach
readme:
app-link: https://search.brave.com
usage: "Make sure to set the theme to either dark or light in Brave Search settings, as the automatic setting will not work."
note: "Make sure to set the theme to either dark or light in Brave Search settings, as the automatic setting will not work."
current-maintainers: [*ndsboy]
bsky:
name: Bluesky Social
Expand All @@ -232,7 +230,7 @@ userstyles:
color: green
readme:
app-link: https://bstats.org
usage: "Make sure to use the default **Teal** theme from the built-in color picker (located at the bottom of the page) for the best experience!"
note: "Make sure to use the default **Teal** theme from the built-in color picker (located at the bottom of the page) for the best experience!"
current-maintainers: [*rockquiet]
canvas-lms:
name: Canvas LMS
Expand Down Expand Up @@ -373,7 +371,7 @@ userstyles:
icon: github
color: text
readme:
usage: "Switch to a default GitHub light/dark theme via **Settings** > **Appearance** for the best experience!"
note: "Switch to a default GitHub light/dark theme via **Settings** > **Appearance** for the best experience!"
app-link: https://github.com
current-maintainers: [*uncenter]
past-maintainers: [*unseen-ninja, *pocco81, *glowingumbreon]
Expand All @@ -383,7 +381,7 @@ userstyles:
icon: gmail
color: peach
readme:
usage: "Switch to the default dark theme via the **Settings** > **Themes** > **View all** for the best experience!"
note: "Switch to the default dark theme via the **Settings** > **Themes** > **View all** for the best experience!"
app-link: https://mail.google.com
current-maintainers: [*uncenter]
past-maintainers: [*isabelroses]
Expand Down Expand Up @@ -471,9 +469,7 @@ userstyles:
color: pink
readme:
app-link: https://holodex.net
usage: |+
> [!NOTE]
> Holodex's selected theme is ignored.
note: Holodex's selected theme is ignored.
current-maintainers: [*Guaxinim5573]
home-manager-options-search:
name: Home Manager Options Search
Expand Down Expand Up @@ -622,7 +618,7 @@ userstyles:
icon: lichess
color: text
readme:
usage: "Switch to a default Lichess light/dark theme via **Username** > **Background** for the best experience!"
note: "Switch to a default Lichess light/dark theme via **Username** > **Background** for the best experience!"
app-link: https://lichess.org
current-maintainers: [*coopw1]
lingva:
Expand Down Expand Up @@ -707,9 +703,7 @@ userstyles:
color: blue
readme:
app-link: https://webmail.migadu.com
usage: |+
> [!NOTE]
> Set Migadu Webmail's built-in theme to 'Migadu' for the optimal experience.
note: Set Migadu Webmail's built-in theme to 'Migadu' for the optimal experience.
current-maintainers: [*uncenter]
minesweeper:
name: Minesweeper Online
Expand Down Expand Up @@ -871,9 +865,7 @@ userstyles:
color: mauve
readme:
app-link: https://proton.me
usage: |+
> [!NOTE]
> Set Proton Mail's built-in theme to 'Snow' if you're using Latte or 'Carbon' if you're using the others.
note: Set Proton Mail's built-in theme to 'Snow' if you're using Latte or 'Carbon' if you're using the others.
current-maintainers: [*soya-daizu]
pypi:
name: PyPI
Expand Down Expand Up @@ -1005,9 +997,7 @@ userstyles:
color: sapphire
readme:
app-link: https://syncthing.net
usage: |+
> [!NOTE]
> This theme is designed to be used with the default WebGUI and default theme provided by Syncthing. This does not theme syncthing.net.
note: This theme is designed to be used with the default WebGUI and default theme provided by Syncthing. This does not theme syncthing.net.
current-maintainers: [*BlankParticle]
tabnews:
name: TabNews
Expand All @@ -1023,9 +1013,7 @@ userstyles:
color: text
readme:
app-link: https://www.tldraw.com
usage: |+
> [!NOTE]
> This theme only changes how the colors appear on the tldraw canvas. Exported graphics **will not be Catppuccin-themed**.
note: This theme only changes how the colors appear on the tldraw canvas. Exported graphics **will not be Catppuccin-themed**.
current-maintainers: [*genshibe, *uncenter]
trinket:
name: Trinket
Expand All @@ -1041,9 +1029,7 @@ userstyles:
color: maroon
readme:
app-link: https://tuta.com
usage: |+
> [!NOTE]
> Set Tuta's built-in theme to either **light** if you're using Latte or **dark** if you're using the others.
note: Set Tuta's built-in theme to either **light** if you're using Latte or **dark** if you're using the others.
current-maintainers: [*ryanccn]
twitch:
name: Twitch
Expand All @@ -1060,9 +1046,7 @@ userstyles:
icon: twitter
readme:
app-link: https://twitter.com
usage: |+
> [!NOTE]
> Set Twitter's built-in theme to **Lights out** with the blue accent. Also requires the [:has()](https://developer.mozilla.org/en-US/docs/Web/CSS/:has) selector.
note: Set Twitter's built-in theme to **Lights out** with the blue accent.
current-maintainers: [*watatomo]
vercel:
name: ["Vercel", "Next.js"]
Expand All @@ -1071,9 +1055,7 @@ userstyles:
color: text
readme:
app-link: [https://vercel.com, https://nextjs.org]
usage: |+
> [!NOTE]
> This theme also applies to the [Next.js](https://nextjs.org/) website.
note: This theme also applies to the [Next.js](https://nextjs.org/) website.
current-maintainers: [*ryanccn, *Dandraghas]
vikunja:
name: Vikunja
Expand Down

0 comments on commit d1e9fa4

Please sign in to comment.