From f94eb00dcd068878223306a90efc81348bddaa09 Mon Sep 17 00:00:00 2001 From: Joscha Date: Wed, 3 Jan 2024 16:30:01 +0100 Subject: [PATCH] Clean up config docs --- cove-config/src/doc.rs | 25 +++++-------------------- cove-config/src/lib.rs | 6 +----- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/cove-config/src/doc.rs b/cove-config/src/doc.rs index 3221eb5..16ed3ac 100644 --- a/cove-config/src/doc.rs +++ b/cove-config/src/doc.rs @@ -17,15 +17,11 @@ Here is an example config that changes a few different options: measure_widths = true rooms_sort_order = "importance" -[euph.rooms.welcome] -autojoin = true - -[euph.rooms.test] -username = "badingle" -force_username = true - -[euph.rooms.private] -password = "foobar" +[euph.servers."euphoria.leet.nu".rooms] +welcome.autojoin = true +test.username = "badingle" +test.force_username = true +private.password = "foobar" [keys] general.abort = ["esc", "ctrl+c"] @@ -33,17 +29,6 @@ general.exit = "ctrl+q" tree.action.fold_tree = "f" ``` -If you want to configure lots of rooms, TOML lets you write this in a more -compact way: - -```toml -[euph.rooms] -foo = { autojoin = true } -bar = { autojoin = true } -baz = { autojoin = true } -private = { autojoin = true, password = "foobar" } -``` - ## Key bindings Key bindings are specified as strings or lists of strings. Each string specifies diff --git a/cove-config/src/lib.rs b/cove-config/src/lib.rs index 5d88867..4b5e2fe 100644 --- a/cove-config/src/lib.rs +++ b/cove-config/src/lib.rs @@ -49,7 +49,6 @@ pub struct Config { /// /// See also the `--ephemeral` command line option. #[serde(default)] - #[document(default = "`false`")] pub ephemeral: bool, /// Whether to measure the width of characters as displayed by the terminal @@ -61,7 +60,6 @@ pub struct Config { /// /// See also the `--measure-graphemes` command line option. #[serde(default)] - #[document(default = "`false`")] pub measure_widths: bool, /// Whether to start in offline mode. @@ -72,7 +70,6 @@ pub struct Config { /// /// See also the `--offline` command line option. #[serde(default)] - #[document(default = "`false`")] pub offline: bool, /// Initial sort order of rooms list. @@ -86,7 +83,6 @@ pub struct Config { /// 2. rooms with unread messages before rooms without /// 3. alphabetic order #[serde(default)] - #[document(default = "`\"alphabet\"`")] pub rooms_sort_order: RoomsSortOrder, /// Time zone that chat timestamps should be displayed in. @@ -108,7 +104,7 @@ pub struct Config { /// instead. However, you can still specify a path to a tz data file or a /// custom time zone string. #[serde(default)] - #[document(default = "$TZ or local time zone")] + #[document(default = "`$TZ` or local system time zone")] pub time_zone: Option, #[serde(default)]