From c74cd71c055f22105fee256ed31b2fab4ac1fdf7 Mon Sep 17 00:00:00 2001 From: Sam Atman Date: Thu, 14 Mar 2024 22:25:06 -0400 Subject: [PATCH] Documentation pass --- .github/workflows/CI.yml | 2 +- docs/src/index.md | 12 ++++++++++-- src/ToggleMenus.jl | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b3360f7..ad6582e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: version: - - '1.0' + - '1.6' - '1.9' - 'nightly' os: diff --git a/docs/src/index.md b/docs/src/index.md index 5b3018a..bedb1ef 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -27,7 +27,8 @@ request(menu) = menu # it's how the sausage is made ## Using ToggleMenu -Like any other TerminalMenu, a ToggleMenu is launched with `request`. +Like any other TerminalMenu, a ToggleMenu is launched with [`request`](@extref +`REPL.TerminalMenus.request`). ```@repl tgm1 request(menu) @@ -88,7 +89,7 @@ is useful for interactively writing code to put the menu into the desired initia state. Note that `charset=:unicode` is one of the [configurations](@extref -`REPL.TerminalMenus.config`) for `TerminalMenus`. Any such keyword arguments are passed +`REPL.TerminalMenus.Config`) for `TerminalMenus`. Any such keyword arguments are passed through to `TerminalMenus`, except for `ToggleMenu`-specific ones, and `cursor`, which we override. Custom configurations are always passed to the `ToggleMenuMaker`, not to the menu itself. @@ -110,6 +111,13 @@ overloaded methods of [`request`](@extref `REPL.TerminalMenus.request`) defined toggle menus. This allows user functions to change the cursor line directly, in a way which the menu code understands. +In the case where the header of the menu should be custom to each menu, pass that first: + +```@example tgm2 +otherheader = "A different header, select [a], [b], [c]" +template(otherheader, options, selections) +``` + ### Settings and Icons Settings provide the possible states for any menu option. They have to be a diff --git a/src/ToggleMenus.jl b/src/ToggleMenus.jl index 6762cc5..e90565a 100644 --- a/src/ToggleMenus.jl +++ b/src/ToggleMenus.jl @@ -74,7 +74,7 @@ with further arguments to create one. return `true`. Other keyword arguments are passed through to [`TerminalMenus.Config`](@extref -`REPL.TerminalMenus.config`), and may be used to configure aspects of menu presentation +`REPL.TerminalMenus.Config`), and may be used to configure aspects of menu presentation and behavior. The `ToggleMenuMaker` is callable to produce a [`ToggleMenu`](@ref).