From fe713529a691632edf9d3919d1d439cd118f9ee9 Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Mon, 20 Nov 2023 12:50:03 -0700 Subject: [PATCH] chore: update themes docs --- docs/themes.md | 75 ++++++++++---------------------------------------- 1 file changed, 15 insertions(+), 60 deletions(-) diff --git a/docs/themes.md b/docs/themes.md index eecebef4..61d30b56 100644 --- a/docs/themes.md +++ b/docs/themes.md @@ -6,49 +6,27 @@ oclif supports themes that users can either define for themselves or select from By default, the theme only applies to help output but you can extend the theme for your own purposes if you want. See [Extending Themes](#extending-themes) section below. -## themes.json +## theme.json -By default oclif will read themes from `~/.config//themes.json`. +By default oclif will read themes from `~/.config//theme.json`. This file takes the following shape: ```json { - // the theme that oclif will use. Must correspond to one of the themes under the `themes` property - "selected": "dark" - // the list of themes that the user can choose from - "themes": { - "dark": { - "bin": "white", - "command": "cyan", - "commandSummary": "white", - "dollarSign": "white", - "flag": "white", - "flagDefaultValue": "blue", - "flagOptions": "white", - "flagRequired": "red", - "flagSeparator": "white", - "sectionDescription": "white", - "sectionHeader": "underline", - "topic": "white", - "version": "white" - }, - "light": { - "bin": "black", - "command": "cyan", - "commandSummary": "black", - "dollarSign": "black", - "flag": "black", - "flagDefaultValue": "blue", - "flagOptions": "black", - "flagRequired": "red", - "flagSeparator": "black", - "sectionDescription": "black", - "sectionHeader": "underline", - "topic": "black", - "version": "black" - } - } + "bin": "white", + "command": "cyan", + "commandSummary": "white", + "dollarSign": "white", + "flag": "white", + "flagDefaultValue": "blue", + "flagOptions": "white", + "flagRequired": "red", + "flagSeparator": "white", + "sectionDescription": "white", + "sectionHeader": "underline", + "topic": "white", + "version": "white" } ``` @@ -78,29 +56,6 @@ The values for each of these must be one of the following: Any invalid values will be ignored. -## Shipping Themes with Your CLI - -If you'd like to ship one or more themes with your CLI you only need to do a couple of things: - -In your CLI's package.json you need to point oclif to your themes JSON file and be sure to include the file in the `files` section so that it gets included in the published package: - -```json -// package.json -"files": ["themes.json"], -"oclif": { - "themesFile": "themes.json" -} -``` - -oclif will now read themes from the configured themes files instead of the default `~/.config//themes.json`. - -## Managing Themes - -Users can manage themes in a couple of different ways. - -1. They can modify the themes file directly. If your CLI configures a `themesFile` (as described above) then they will modify that file. If not, then they would need to modify the default `~/.config//themes.json`. -2. They can install `@oclif/plugin-theme` to get a set of commands for managing themes. - ## Disabling Themes Themes can be disabled by using `_DISABLE_THEME` environment variable.