Skip to main content

Crate ck

Crate ck 

Source
Expand description

ck: a terminal imageboard browser. The binary (main.rs) is a thin shell around this library, which is also what the fuzz targets in fuzz/ link against.

Modules§

input_log
CK_INPUT_LOG=<path>: a line for each input event as it’s read, as it’s handled, and for each frame drawn, with the time since ck started. For finding out what happened to a key; off, and free, unless the variable is set.

Structs§

App
Config
Unknown keys are errors, here and in [[site]] and [[image_search]]: a misspelled setting would otherwise do nothing, without a word.
DiskCache
Filters
Pages
Store

Enums§

ImagesMode

Functions§

builtin_sites_text
The built-in sites, as [[site]] tables (to copy one and change it).
catching
Run f; a panic in it comes back as its message.
choose_protocol
The image protocol to use: the one images names, or what the terminal said it can show. Zellij answers for the terminal it runs in, and says sixel whatever that terminal is (most can’t show it, and then nothing would show at all): there, half-blocks, unless images = "sixel" says otherwise.
download_root
Where files go unless download_dir says otherwise (in a folder per site, board and thread).
draw
fresh_config
A new config file: the default config without its [[site]] tables, so the built-in sites aren’t frozen in it (they’re added when it loads, and can change with ck).
sandboxed
Whether ck may reach outside itself: open a browser or player, write the clipboard, send notifications. Not in tests, nor with CK_NO_EXTERNAL set (the end-to-end fuzzer).
set_theme
spawn_detached
Start a program away from the terminal (no stdin, stdout or stderr, and on Unix a process group of its own, so ctrl-c in ck doesn’t reach it), and wait on it in the background so it doesn’t linger once it exits.
start_error
Why ck can’t start at input (ck URL), if it can’t, to say before the terminal is taken over. A link to a site that isn’t one of sites is fine: ck asks it, to add it.
theme_from_config
The theme the config asks for: theme = "name", or ck 0.2’s [theme] overrides on the default theme.