diff options
-rwxr-xr-x | bollux | 18 | ||||
-rw-r--r-- | bollux.1 | 3 | ||||
-rw-r--r-- | bollux.conf.5 | 11 |
3 files changed, 23 insertions, 9 deletions
diff --git a/bollux b/bollux index df27c92..ac17842 100755 --- a/bollux +++ b/bollux | |||
@@ -136,7 +136,6 @@ bollux_config() { | |||
136 | : "${BOLLUX_PROTO:=gemini}" # default protocol | 136 | : "${BOLLUX_PROTO:=gemini}" # default protocol |
137 | : "${BOLLUX_URL:=}" # start url | 137 | : "${BOLLUX_URL:=}" # start url |
138 | : "${BOLLUX_BYEMSG:=See You Space Cowboy ...}" # bye message | 138 | : "${BOLLUX_BYEMSG:=See You Space Cowboy ...}" # bye message |
139 | : "${BOLLUX_PRE_DISPLAY:=pre,alt,both}" # how to view PRE blocks | ||
140 | ## files | 139 | ## files |
141 | : "${BOLLUX_DATADIR:=${XDG_DATA_DIR:-$HOME/.local/share}/bollux}" | 140 | : "${BOLLUX_DATADIR:=${XDG_DATA_DIR:-$HOME/.local/share}/bollux}" |
142 | : "${BOLLUX_DOWNDIR:=.}" # where to save downloads | 141 | : "${BOLLUX_DOWNDIR:=.}" # where to save downloads |
@@ -144,8 +143,9 @@ bollux_config() { | |||
144 | : "${BOLLUX_PAGESRC:=$BOLLUX_DATADIR/pagesrc}" # where to save source | 143 | : "${BOLLUX_PAGESRC:=$BOLLUX_DATADIR/pagesrc}" # where to save source |
145 | BOLLUX_HISTFILE="$BOLLUX_DATADIR/history" # where to save history | 144 | BOLLUX_HISTFILE="$BOLLUX_DATADIR/history" # where to save history |
146 | ## typesetting | 145 | ## typesetting |
147 | : "${T_MARGIN:=4}" # left and right margin | 146 | : "${T_MARGIN:=4}" # left and right margin |
148 | : "${T_WIDTH:=0}" # width of the viewport -- 0 = get term width | 147 | : "${T_WIDTH:=0}" # width of the viewport -- 0 = get term width |
148 | : "${T_PRE_DISPLAY:=pre,alt,both}" # how to view PRE blocks | ||
149 | # colors -- these will be wrapped in \e[ __ m | 149 | # colors -- these will be wrapped in \e[ __ m |
150 | C_RESET='\e[0m' # reset | 150 | C_RESET='\e[0m' # reset |
151 | : "${C_SIGIL:=35}" # sigil (=>, #, ##, ###, *, ```) | 151 | : "${C_SIGIL:=35}" # sigil (=>, #, ##, ###, *, ```) |
@@ -743,7 +743,7 @@ mklesskey() { # mklesskey FILENAME | |||
743 | ] quit 3 # 51 forward | 743 | ] quit 3 # 51 forward |
744 | r quit 4 # 52 re-request / download | 744 | r quit 4 # 52 re-request / download |
745 | G quit 5 # 53 goto a url (pre-filled) | 745 | G quit 5 # 53 goto a url (pre-filled) |
746 | ` quit 6 # 54 cycle BOLLUX_PRE_DISPLAY and refresh | 746 | ` quit 6 # 54 cycle T_PRE_DISPLAY and refresh |
747 | # other keybinds | 747 | # other keybinds |
748 | \40 forw-screen-force | 748 | \40 forw-screen-force |
749 | h left-scroll | 749 | h left-scroll |
@@ -783,7 +783,7 @@ typeset_gemini() { | |||
783 | 783 | ||
784 | log d "T_WIDTH=$T_WIDTH" | 784 | log d "T_WIDTH=$T_WIDTH" |
785 | log d "WIDTH=$WIDTH" | 785 | log d "WIDTH=$WIDTH" |
786 | log d "$BOLLUX_PRE_DISPLAY" | 786 | log d "$T_PRE_DISPLAY" |
787 | 787 | ||
788 | while IFS= read -r; do | 788 | while IFS= read -r; do |
789 | case "$REPLY" in | 789 | case "$REPLY" in |
@@ -794,7 +794,7 @@ typeset_gemini() { | |||
794 | else | 794 | else |
795 | pre=true | 795 | pre=true |
796 | fi | 796 | fi |
797 | case "${BOLLUX_PRE_DISPLAY%%,*}" in | 797 | case "${T_PRE_DISPLAY%%,*}" in |
798 | pre) | 798 | pre) |
799 | : | 799 | : |
800 | ;; | 800 | ;; |
@@ -908,9 +908,9 @@ gemini_text() { | |||
908 | } | 908 | } |
909 | 909 | ||
910 | gemini_pre() { | 910 | gemini_pre() { |
911 | # Print preformatted text, dependent on $BOLLUX_PRE_DISPLAY and | 911 | # Print preformatted text, dependent on $T_PRE_DISPLAY and |
912 | # $PRE_LINE_FORCE | 912 | # $PRE_LINE_FORCE |
913 | if [[ alt != "${BOLLUX_PRE_DISPLAY%%,*}" ]] || $PRE_LINE_FORCE; then | 913 | if [[ alt != "${T_PRE_DISPLAY%%,*}" ]] || $PRE_LINE_FORCE; then |
914 | printf "\e[${C_SIGIL}m%${S_MARGIN}s " '```' | 914 | printf "\e[${C_SIGIL}m%${S_MARGIN}s " '```' |
915 | printf "\e[${C_PRE}m%s${C_RESET}\n" "$1" | 915 | printf "\e[${C_PRE}m%s${C_RESET}\n" "$1" |
916 | fi | 916 | fi |
@@ -1008,7 +1008,7 @@ handle_keypress() { # handle_keypress CODE | |||
1008 | run blastoff -u "$REPLY" | 1008 | run blastoff -u "$REPLY" |
1009 | ;; | 1009 | ;; |
1010 | 54) # ` - change alt-text visibility and refresh | 1010 | 54) # ` - change alt-text visibility and refresh |
1011 | run cycle_list BOLLUX_PRE_DISPLAY , | 1011 | run cycle_list T_PRE_DISPLAY , |
1012 | run blastoff "$BOLLUX_URL" | 1012 | run blastoff "$BOLLUX_URL" |
1013 | ;; | 1013 | ;; |
1014 | 55) # 55-57 -- still available for binding | 1014 | 55) # 55-57 -- still available for binding |
diff --git a/bollux.1 b/bollux.1 index ce32e8d..db965c5 100644 --- a/bollux.1 +++ b/bollux.1 | |||
@@ -56,6 +56,9 @@ goto a new URL - with current URL pre-filled | |||
56 | .B r | 56 | .B r |
57 | refresh the current page | 57 | refresh the current page |
58 | .TP | 58 | .TP |
59 | .B ` | ||
60 | cycle preformatted text visibility and refresh the current page | ||
61 | .TP | ||
59 | .B [ | 62 | .B [ |
60 | goto the previous page in history | 63 | goto the previous page in history |
61 | .TP | 64 | .TP |
diff --git a/bollux.conf.5 b/bollux.conf.5 index e4b2c54..b590397 100644 --- a/bollux.conf.5 +++ b/bollux.conf.5 | |||
@@ -92,6 +92,17 @@ The total width of the window, including | |||
92 | .BR T_MARGIN . | 92 | .BR T_MARGIN . |
93 | If set to 0, attempts to use the width of the terminal, | 93 | If set to 0, attempts to use the width of the terminal, |
94 | falling back to 80. | 94 | falling back to 80. |
95 | .TP | ||
96 | .BR T_PRE_DISPLAY | ||
97 | comma-separated list of items; default is pre,alt,both. | ||
98 | .br | ||
99 | How to display preformatted text blocks. | ||
100 | .I pre | ||
101 | shows only the preformatted lines, ignoring the delimiting fences. | ||
102 | .I alt | ||
103 | shows only the first fence line, along with whatever alt text might be there. | ||
104 | .I both | ||
105 | shows both. | ||
95 | .SS Colors | 106 | .SS Colors |
96 | The different line-types in text/gemini documents are rendered with | 107 | The different line-types in text/gemini documents are rendered with |
97 | .I m-class | 108 | .I m-class |