diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-07 19:53:42 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-07 19:53:42 +0100 |
commit | cbe4d8faa1b0de9b01048ad094bb8e8295ea7653 (patch) | |
tree | a4391960356b97aed0a9e86a9ebdfd8ecdd18be9 /doc/config.md | |
parent | 31162225df672187e4b73423ac2f4bc25937fd3f (diff) | |
download | chawan-cbe4d8faa1b0de9b01048ad094bb8e8295ea7653.tar.gz |
Update documentation
Diffstat (limited to 'doc/config.md')
-rw-r--r-- | doc/config.md | 145 |
1 files changed, 128 insertions, 17 deletions
diff --git a/doc/config.md b/doc/config.md index bfb1ee7c..dcd88b79 100644 --- a/doc/config.md +++ b/doc/config.md @@ -9,18 +9,33 @@ configuration. A list of configurable options follows. -## General +## External -General options must be placed in a section called `[general]`. +External options must be placed in a section called `[external]`. -Following is a list of general options: +Following is a list of external options: <table> -<tr><th>**Name**<th>**Value**<th>**Function** -<tr><td>double-width-ambiguous<td>boolean -<td>Assume the terminal displays characters in the East Asian Ambiguous -category as double-width characters. If you don't know what this means, you -probably won't need to enable it. + +<tr> +<th>**Name**</th> +<th>**Value**</th> +<th>**Function**</th> +</tr> + +<tr> +<td>tmpdir</td> +<td>path</td> +<td>Directory used to save temporary files.</td> +</tr> + +<tr> +<td>editor</td> +<td>shell command</td> +<td>External editor command. %s is substituted for the file name, %d for +the line number.</td> +</tr> + </table> ## Display @@ -30,10 +45,105 @@ Display options must be placed in a section called `[display]`. Following is a list of display options: <table> -<tr><th>**Name**<th>**Value**<th>**Function** -<tr><td>mark-color<td>color<td>Set the marker's color. Valid options are -"black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", -"terminal". + +<tr> +<th>**Name**</th> +<th>**Value**</th> +<th>**Function**</th> +</tr> + +<tr> +<td>color-mode</td> +<td>"monochrome"/"ansi"/"8bit"/"24bit"/"auto"</td> +<td>Set the color mode. "auto" for automatic detection, "monochrome"</td> +for black on white, "ansi" for ansi colors, "24bit" for true colors. "8bit" +is currently unimplemented (and fallbacks to ansi).</td> +</tr> + +<tr> +<td>format-mode</td> +<td>"auto"/["bold", "italic", "underline", "reverse", "strike", "overline", +"blink"]</td> +<td>Specifies output formatting modes. Accepts the string "auto" or an array +of specific attributes. An empty array (`[]`) disables formatting +completely.</td> +</tr> + +<tr> +<td>no-format-mode +<td>["bold", "italic", "underline", "reverse", "strike", "overline", "blink"] +<td>Disable specified formatting modes.</td> +</tr> + +<tr> +<td>emulate-overline</td> +<td>boolean</td> +<td>When set to true and the overline formatting attribute is not enabled, +overlines are substituted by underlines on the previous line.</td> +</tr> + +<tr> +<td>alt-screen</td> +<td>"auto"/boolean</td> +<td>Enable/disable the alternative screen.</td> +</tr> + +<tr> +<td>highlight-color</td> +<td>color</td> +<td>Set the highlight color. Both hex values and CSS color names are +accepted.</td> +</tr> + +<tr> +<td>double-width-ambiguous</td> +<td>boolean</td> +<td>Assume the terminal displays characters in the East Asian Ambiguous +category as double-width characters. Useful when e.g. ○ occupies two +cells.</td> +</tr> + +<tr> +<td>minimum-contrast</td> +<td>number</td> +<td>Specify the minimum number of euclidian distance of the background and +foreground colors on the RGB plane. -1 disables this function (i.e. allows +black letters on black background, etc).</td> +</tr> + +<tr> +<td>force-clear</td> +<td>boolean</td> +<td>Force the screen to be completely cleared every time it is redrawn.</td> +</tr> + +</table> + +## Siteconf + +Configuration options can be specified for individual sites. Each entry must +be in the table array `[[siteconf]]`. + +<table> + +<tr> +<th>**Name**</th> +<th>**Value**</th> +<th>**Function**</th> +</tr> + +<tr> +<td>url</td> +<td>regex</td> +<td>Regular expression used to match the URL.</td> +</tr> + +<tr> +<td>substitute_url</td> +<td>JS function</td> +<td>A JavaScript function returning the substituted url.</td> +</tr> + </table> ## Stylesheets @@ -45,7 +155,7 @@ There are two ways to import user stylesheets: 1. Include a user stylesheet using the format `include = 'path-to-user.css'`. To include multiple stylesheets, use `include = ['first-stylesheet.css, second-stylesheet.css']`. - Relative paths are interpreted as relative to the config directory. + Relative paths are interpreted relative to the config directory. 2. Place your stylesheet directly in your configuration file using `inline = """your-style"""`. @@ -54,7 +164,7 @@ There are two ways to import user stylesheets: Keybindings must be placed in these sections: -* for page browsing: `[page]` +* for pager interaction: `[page]` * for line editing: `[line]` Keybindings are configured using the syntax @@ -66,9 +176,6 @@ modifiers. Modifiers are the prefixes `C-` and `M-`, which add control or escape to the keybinding respectively (essentially making `M-` the same as `C-[`). Modifiers can be escaped with the `\` sign. -(Note: it is highly recommended to use single quotes here; escaping can get -quite ugly with double quotes.) - ```Examples: 'C-M-j' = 'pager.changeLocation()' # change URL when Control, Escape and j are pressed 'gg' = 'pager.cursorFirstLine()' # go to the first line of the page when g is pressed twice @@ -121,6 +228,8 @@ is typed in. A list of built-in pager functions can be found below. <tr><td>`pager.isearchBackward()`<td>Search and highlight the first result, backwards <tr><td>`pager.searchPrev()`<td>Jump to the next search result <tr><td>`pager.searchNext()`<td>Jump to the previous search result +<tr><td>`pager.peek()`<td>Display an alert of the current URL +<tr><td>`pager.peekCursor()`<td>Display an alert of the URL under the cursor </table> ### Line-editing actions @@ -142,6 +251,8 @@ is typed in. A list of built-in pager functions can be found below. <tr><td>`line.begin()`<td>Move cursor to the previous word by one character <tr><td>`line.end()`<td>Move cursor to the previous word by one character <tr><td>`line.escape()`<td>Ignore keybindings for next character +<tr><td>`line.prevHist()`<td>Jump to the previous history entry +<tr><td>`line.nextHist()`<td>Jump to the next history entry </table> Some entries have an optional `bounds` parameter. If passed, this must be a |