From 3b4e41ea4e03690596dbc0d6af48fd9b95577b89 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sun, 14 May 2023 16:47:10 +0200 Subject: [PATCH] Add example config to config documentation --- cove-config/src/doc.rs | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/cove-config/src/doc.rs b/cove-config/src/doc.rs index 062a5bd..3221eb5 100644 --- a/cove-config/src/doc.rs +++ b/cove-config/src/doc.rs @@ -11,7 +11,40 @@ const MARKDOWN_INTRODUCTION: &str = r#"# Config file format Cove's config file uses the [TOML](https://toml.io/) format. -## Key binding format +Here is an example config that changes a few different options: + +```toml +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" + +[keys] +general.abort = ["esc", "ctrl+c"] +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 a main key and zero or more modifier keys. The modifier keys (if any) are listed @@ -42,7 +75,7 @@ Available modifiers: - `alt` - `any` (matches as long as at least one modifier is pressed) -## Config options +## Available options "#; pub fn toml_value_as_markdown(value: &T) -> String {