Change BOLLUX_PRE_DISPLAY to T_PRE_DISPLAY; document
continuous-integration/drone/push Build is failing Details

It's really a typesetting option, so I changed the namespace.
This commit is contained in:
Case Duckworth 2021-02-26 20:51:25 -06:00
parent f77b42f7cf
commit 972d79a5c1
3 changed files with 23 additions and 9 deletions

18
bollux
View File

@ -136,7 +136,6 @@ bollux_config() {
: "${BOLLUX_PROTO:=gemini}" # default protocol
: "${BOLLUX_URL:=}" # start url
: "${BOLLUX_BYEMSG:=See You Space Cowboy ...}" # bye message
: "${BOLLUX_PRE_DISPLAY:=pre,alt,both}" # how to view PRE blocks
## files
: "${BOLLUX_DATADIR:=${XDG_DATA_DIR:-$HOME/.local/share}/bollux}"
: "${BOLLUX_DOWNDIR:=.}" # where to save downloads
@ -144,8 +143,9 @@ bollux_config() {
: "${BOLLUX_PAGESRC:=$BOLLUX_DATADIR/pagesrc}" # where to save source
BOLLUX_HISTFILE="$BOLLUX_DATADIR/history" # where to save history
## typesetting
: "${T_MARGIN:=4}" # left and right margin
: "${T_WIDTH:=0}" # width of the viewport -- 0 = get term width
: "${T_MARGIN:=4}" # left and right margin
: "${T_WIDTH:=0}" # width of the viewport -- 0 = get term width
: "${T_PRE_DISPLAY:=pre,alt,both}" # how to view PRE blocks
# colors -- these will be wrapped in \e[ __ m
C_RESET='\e[0m' # reset
: "${C_SIGIL:=35}" # sigil (=>, #, ##, ###, *, ```)
@ -743,7 +743,7 @@ mklesskey() { # mklesskey FILENAME
] quit 3 # 51 forward
r quit 4 # 52 re-request / download
G quit 5 # 53 goto a url (pre-filled)
` quit 6 # 54 cycle BOLLUX_PRE_DISPLAY and refresh
` quit 6 # 54 cycle T_PRE_DISPLAY and refresh
# other keybinds
\40 forw-screen-force
h left-scroll
@ -783,7 +783,7 @@ typeset_gemini() {
log d "T_WIDTH=$T_WIDTH"
log d "WIDTH=$WIDTH"
log d "$BOLLUX_PRE_DISPLAY"
log d "$T_PRE_DISPLAY"
while IFS= read -r; do
case "$REPLY" in
@ -794,7 +794,7 @@ typeset_gemini() {
else
pre=true
fi
case "${BOLLUX_PRE_DISPLAY%%,*}" in
case "${T_PRE_DISPLAY%%,*}" in
pre)
:
;;
@ -908,9 +908,9 @@ gemini_text() {
}
gemini_pre() {
# Print preformatted text, dependent on $BOLLUX_PRE_DISPLAY and
# Print preformatted text, dependent on $T_PRE_DISPLAY and
# $PRE_LINE_FORCE
if [[ alt != "${BOLLUX_PRE_DISPLAY%%,*}" ]] || $PRE_LINE_FORCE; then
if [[ alt != "${T_PRE_DISPLAY%%,*}" ]] || $PRE_LINE_FORCE; then
printf "\e[${C_SIGIL}m%${S_MARGIN}s " '```'
printf "\e[${C_PRE}m%s${C_RESET}\n" "$1"
fi
@ -1008,7 +1008,7 @@ handle_keypress() { # handle_keypress CODE
run blastoff -u "$REPLY"
;;
54) # ` - change alt-text visibility and refresh
run cycle_list BOLLUX_PRE_DISPLAY ,
run cycle_list T_PRE_DISPLAY ,
run blastoff "$BOLLUX_URL"
;;
55) # 55-57 -- still available for binding

View File

@ -56,6 +56,9 @@ goto a new URL - with current URL pre-filled
.B r
refresh the current page
.TP
.B `
cycle preformatted text visibility and refresh the current page
.TP
.B [
goto the previous page in history
.TP

View File

@ -92,6 +92,17 @@ The total width of the window, including
.BR T_MARGIN .
If set to 0, attempts to use the width of the terminal,
falling back to 80.
.TP
.BR T_PRE_DISPLAY
comma-separated list of items; default is pre,alt,both.
.br
How to display preformatted text blocks.
.I pre
shows only the preformatted lines, ignoring the delimiting fences.
.I alt
shows only the first fence line, along with whatever alt text might be there.
.I both
shows both.
.SS Colors
The different line-types in text/gemini documents are rendered with
.I m-class