Skip to content

Commit

Permalink
other: add json schema (#1382) (#1394)
Browse files Browse the repository at this point in the history
* other: add json schema (#1382)

* docs: add some screenshots

* other: move around schema files

* docs: move around some docs around config files

---------

Co-authored-by: ClementTsang <[email protected]>
  • Loading branch information
Freed-Wu and ClementTsang authored Feb 2, 2024
1 parent 59b7650 commit 98d4c44
Show file tree
Hide file tree
Showing 5 changed files with 413 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
# Default Config
# Config File

A default config file is automatically generated at the following locations that bottom checks by default:
For persistent configuration, and for certain configuration options, bottom supports config files.

## Default Config File

If no config file argument is given, it will automatically look for a config file at these locations:

| OS | Default Config Location |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| macOS | `$HOME/Library/Application Support/bottom/bottom.toml`<br/> `~/.config/bottom/bottom.toml` <br/> `$XDG_CONFIG_HOME/bottom/bottom.toml` |
| Linux | `~/.config/bottom/bottom.toml` <br/> `$XDG_CONFIG_HOME/bottom/bottom.toml` |
| Windows | `C:\Users\<USER>\AppData\Roaming\bottom\bottom.toml` |

Furthermore, if a custom config path that does not exist is given (using `-C` or `--config`), bottom will attempt to create a default config file at that location.
Like if a path is passed with `-C`/`--config`, if a file doesn't exist at the path, bottom will automatically create a
new, default config file at that location.

## JSON Schema

The configuration file also has [JSON Schema](https://json-schema.org/) support to make it easier to manage, if your
IDE/editor supports it.
8 changes: 7 additions & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ theme:
- content.action.edit
- navigation.expand
- navigation.footer
- navigation.indexes
- navigation.instant
- navigation.instant.progress
- navigation.sections
Expand All @@ -28,6 +29,7 @@ theme:
- search.highlight
- search.suggest
- toc.integrate
- toc.follow
icon:
edit: material/pencil
palette:
Expand All @@ -39,12 +41,16 @@ theme:
name: Switch to light mode
# Light mode
- media: "(prefers-color-scheme: light)"
primary: indigo
accent: indigo
toggle:
icon: material/weather-sunny
name: Switch to dark mode
# Dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: black
accent: indigo
toggle:
icon: material/weather-night
name: Switch to system preference
Expand Down Expand Up @@ -158,7 +164,7 @@ nav:
- "Configuration":
- "Command-line Options": configuration/command-line-options.md
- "Config File":
- "Default Config": configuration/config-file/default-config.md
- configuration/config-file/index.md
- "Flags": configuration/config-file/flags.md
- "Theming": configuration/config-file/theming.md
- "Layout": configuration/config-file/layout.md
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mkdocs == 1.5.3
mkdocs-material == 9.5.3
mkdocs-material == 9.5.6
mdx_truly_sane_lists == 1.3
mike == 2.0.0
mkdocs-git-revision-date-localized-plugin == 1.2.2
7 changes: 7 additions & 0 deletions schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Config Schema

## Usage

## Development

### How to add a new version
Loading

0 comments on commit 98d4c44

Please sign in to comment.