From 9d73151ca91b13af91daed1ad5a19eab80bdca91 Mon Sep 17 00:00:00 2001 From: Ottatop Date: Sat, 9 Sep 2023 20:52:52 -0500 Subject: [PATCH] Update API docs --- api/lua/input.lua | 4 ++++ api/lua/process.lua | 3 +++ api/lua/tag.lua | 11 +++++++++++ 3 files changed, 18 insertions(+) diff --git a/api/lua/input.lua b/api/lua/input.lua index b807191..c4f4e2c 100644 --- a/api/lua/input.lua +++ b/api/lua/input.lua @@ -1,7 +1,11 @@ -- SPDX-License-Identifier: GPL-3.0-or-later +---Input management. +--- +---This module provides utilities to set keybinds. ---@class InputModule local input_module = { + --- A table with every key provided by xkbcommon. keys = require("keys"), } diff --git a/api/lua/process.lua b/api/lua/process.lua index f63b353..89d2017 100644 --- a/api/lua/process.lua +++ b/api/lua/process.lua @@ -2,6 +2,9 @@ ---@diagnostic disable: redefined-local +---Process management. +--- +---This module provides utilities to spawn processes and capture their output. ---@class ProcessModule local process_module = {} diff --git a/api/lua/tag.lua b/api/lua/tag.lua index ad4736f..3dec48f 100644 --- a/api/lua/tag.lua +++ b/api/lua/tag.lua @@ -468,6 +468,17 @@ end ---Given an array of layouts, this will create two functions; one will cycle forward the layout ---for the provided tag, and one will cycle backward. +--- +--- ### Example +---```lua +---local layout_cycler = tag.layout_cycler({ "Dwindle", "Spiral", "MasterStack" }) +--- +---layout_cycler.next() -- Go to the next layout on the first tag of the focused output +---layout_cycler.prev() -- Go to the previous layout on the first tag of the focused output +--- +---layout_cycler.next("DP-1") -- Do the above but on "DP-1" instead +---layout_cycler.prev(output.get_by_name("DP-1")) -- With an output object +---``` ---@param layouts Layout[] The available layouts. ---@return LayoutCycler layout_cycler A table with the functions `next` and `prev`, which will cycle layouts for the given tag. function tag_module.layout_cycler(layouts)