From 6031a3e8befc4ff88a78f8c974bbacfe3215a38b Mon Sep 17 00:00:00 2001 From: Mark Cornick Date: Tue, 20 Feb 2024 21:08:22 -0500 Subject: [PATCH] docs: restore mkdocs-material theme Signed-off-by: Mark Cornick --- docs/index.md | 107 +++++++++++++++++------------------ mkdocs.yml | 28 ++++++++- readthedocs-requirements.txt | 3 + 3 files changed, 83 insertions(+), 55 deletions(-) create mode 100644 readthedocs-requirements.txt diff --git a/docs/index.md b/docs/index.md index 25c5401..3893a97 100644 --- a/docs/index.md +++ b/docs/index.md @@ -127,33 +127,32 @@ The configuration file should be named either `config.yaml`, `config.toml` or `c The file should look like one of these, substituting your own details: -config.yaml: - -```yaml ---- -address: tomservo -email: tomservo@gizmonics.invalid -apikey: 0123456789abcdef0123456789abcdef -``` - -config.toml: - -```toml -address = "tomservo" -email = "tomservo@gizmonics.invalid" -apikey = "0123456789abcdef0123456789abcdef" -``` - -config.json: - -```json -{ - "address": "tomservo", - "email": "tomservo@gizmonics.invalid", - "apikey": "0123456789abcdef0123456789abcdef" -} -``` - +=== "config.yaml" + + ```yaml + --- + address: tomservo + email: tomservo@gizmonics.invalid + apikey: 0123456789abcdef0123456789abcdef + ``` + +=== "config.toml" + + ```toml + address = "tomservo" + email = "tomservo@gizmonics.invalid" + apikey = "0123456789abcdef0123456789abcdef" + ``` + +=== "config.json" + + ```json + { + "address": "tomservo", + "email": "tomservo@gizmonics.invalid", + "apikey": "0123456789abcdef0123456789abcdef" + } + ``` A [JSON Schema](https://raw.githubusercontent.com/mcornick/clilol/main/docs/config.schema.json) for the configuration file is available, for editors that support it. !!! Note @@ -186,40 +185,40 @@ Environment variables take precedence over any configuration file. Rather than hardcoding your API key in the configuration file or environment, you can specify a command which, when run, will return the API key on standard output, such as: -config.yaml: +=== "config.yaml" -```yaml ---- -address: tomservo -email: tomservo@gizmonics.invalid -apikeycmd: gopass -o omg.lol/tomservo -``` + ```yaml + --- + address: tomservo + email: tomservo@gizmonics.invalid + apikeycmd: gopass -o omg.lol/tomservo + ``` -config.toml: +=== "config.toml" -```toml -address = "tomservo" -email = "tomservo@gizmonics.invalid" -apikeycmd = "gopass -o omg.lol/tomservo" -``` + ```toml + address = "tomservo" + email = "tomservo@gizmonics.invalid" + apikeycmd = "gopass -o omg.lol/tomservo" + ``` -config.json: +=== "config.json" -```json -{ - "address": "tomservo", - "email": "tomservo@gizmonics.invalid", - "apikeycmd": "gopass -o omg.lol/tomservo" -} -``` + ```json + { + "address": "tomservo", + "email": "tomservo@gizmonics.invalid", + "apikeycmd": "gopass -o omg.lol/tomservo" + } + ``` -environment: +=== "environment" -```sh -export CLILOL_ADDRESS="tomservo" -export CLILOL_EMAIL="tomservo@gizmonics.invalid" -export CLILOL_APIKEYCMD="gopass -o omg.lol/tomservo" -``` + ```sh + export CLILOL_ADDRESS="tomservo" + export CLILOL_EMAIL="tomservo@gizmonics.invalid" + export CLILOL_APIKEYCMD="gopass -o omg.lol/tomservo" + ``` In this example, clilol would use the output of `gopass -o omg.lol/tomservo` as the API key. If the command fails, clilol will print an error stating that the API key is missing. diff --git a/mkdocs.yml b/mkdocs.yml index 8a0c21e..12e0126 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,6 +8,9 @@ extra: link: https://social.sdf.org/@mcornick markdown_extensions: - admonition + - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true plugins: - search repo_name: mcornick/clilol @@ -17,4 +20,27 @@ site_description: a CLI for omg.lol site_name: clilol, a CLI for omg.lol site_url: https://clilol.readthedocs.io/ theme: - name: readthedocs + features: + - content.action.edit + - content.action.view + - content.code.copy + icon: + logo: fontawesome/solid/heart + repo: fontawesome/brands/github + name: material + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + primary: pink + accent: pink + toggle: + icon: material/brightness-7 + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: pink + accent: pink + toggle: + icon: material/brightness-4 + name: Switch to light mode +# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json diff --git a/readthedocs-requirements.txt b/readthedocs-requirements.txt new file mode 100644 index 0000000..d26ecd3 --- /dev/null +++ b/readthedocs-requirements.txt @@ -0,0 +1,3 @@ +mkdocs-material +mkdocs-material-extensions +pymdown-extensions