From a4033e682b658ceaf399779fb86ed14c0de641bb Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Wed, 14 Aug 2024 07:33:37 -0500 Subject: [PATCH] docs: add manpage Signed-off-by: Tim Culverhouse --- build.zig | 11 +++++ build.zig.zon | 4 ++ docs/comlink.1.scd | 120 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+) create mode 100644 docs/comlink.1.scd diff --git a/build.zig b/build.zig index 05defa4..df6c457 100644 --- a/build.zig +++ b/build.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const zzdoc = @import("zzdoc"); /// Must be kept in sync with git tags const comlink_version: std.SemanticVersion = .{ .major = 0, .minor = 0, .patch = 0 }; @@ -7,6 +8,16 @@ pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); + // manpages + { + var man_step = zzdoc.addManpageStep(b, .{ + .root_doc_dir = b.path("docs/"), + }); + + const install_step = man_step.addInstallStep(.{}); + b.default_step.dependOn(&install_step.step); + } + const ziglua_dep = b.dependency("ziglua", .{ .target = target, .optimize = optimize, diff --git a/build.zig.zon b/build.zig.zon index 926fd7e..f2fec35 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -18,6 +18,10 @@ .url = "git+https://github.com/ianic/tls.zig#36ae29b0e51fae564222767ffd5d7f60f9a8dd0b", .hash = "1220319a215975c0ac3d251b334bfb915765adf21f7e64904028b1ec5ebcf00ea3cd", }, + .zzdoc = .{ + .url = "git+https://github.com/rockorager/zzdoc?ref=v0.2.0#4952c59aa4eaacb8e58c651022ca200d0def2e8c", + .hash = "12202a808ac9b32753cf4e093ef95a1c56aa595f7e3d331092ebd8883350c48da930", + }, }, .paths = .{""}, } diff --git a/docs/comlink.1.scd b/docs/comlink.1.scd new file mode 100644 index 0000000..8516d23 --- /dev/null +++ b/docs/comlink.1.scd @@ -0,0 +1,120 @@ +comlink(1) + +# NAME + +comlink - an IRC client + +# SYNOPSIS + +*comlink* [options...] + +# OPTIONS + +*-v*, *--version* + Print the version and exit. + +# CONFIGURATION + +Comlink is configured using *lua 5.4*. A lua file defining the API for +configuration should be available in _$PREFIX/share/comlink/lua/comlink.lua_. +Configuration will be loaded from _$XDG_CONFIG_HOME/comlink/init.lua_. Local lua +modules will be searched for within this directory. The search paths are: + +``` + $XDG_CONFIG_HOME/comlink/\*.lua + $XDG_CONFIG_HOME/comlink/lua/\*.lua + $XDG_CONFIG_HOME/comlink/lua/\*/init.lua +``` + +The most simple configuration is + +``` + local comlink = require("comlink") + comlink.connect({ + server = "chat.sr.ht", + user = "rockorager", + nick = "rockorager", + password = "password", + real_name = "Tim Culverhouse", + }) +``` + +# KEYBOARD SHORTCUTS + +Many keyboard shortcuts may be configured in the configuration file. The +shortcuts shown here are the defaults. + +## NAVIGATION AND UI + +*CTRL-C* + Quit comlink. + +*ALT-UP* + Select the previous channel or buffer. + +*ALT-DOWN* + Select the next channel or buffer. + +*CTRL-L* + Redraw the entire screen. + +*PAGE_UP* + Scroll the channel up 3 messages. + +*PAGE_DOWN* + Scroll the channel down 3 messages. + +*HOME* + Scroll the channel to the most recent message. + +*TAB* + Open completion options for the last word in the input field. Cycle + through options when the completion menu is open. + +*SHIFT-TAB* + If the compeletion menu is open, cycle through options. + + + +## EDITING + +*CTRL-A* + Move the cursor to the beginning of the input field. + +*CTRL-E*, *END* + Move the cursor to the end of the input field. + +*CTRL-B* + Move the cursor left one character. + +*CTRL-F* + Move the cursor right one character. + +*CTRL-K* + Delete from the cursor to the end of the input field. + +*CTRL-U* + Delete from the cursor to the start of the input field. + +*CTRL-D* + Delete the character after the cursor + +*ALT-B*, *ALT-LEFT* + Move the cursor backwards one word. + +*ALT-F*, *ALT-RIGHT* + Move the cursor forwards one word. + +*CTRL-W*, *ALT-BACKSPACE* + Delete the word before the cursor. + +*ALT-D* + Delete the word after the cursor. + +*ENTER* + Send the text in the input field. + +# AUTHORS + +Maintained by Tim Culverhouse . Source code available at +https://git.sr.ht/~rockorager/comlink. -- 2.51.2