From 4e0fd8c7ef2ad2f61c1ac0572e02b92b1c42b688 Mon Sep 17 00:00:00 2001 From: bptato Date: Tue, 16 May 2023 13:17:41 +0200 Subject: Refactor config, add charset opts Only document-charset supported for now. --- doc/config.md | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 69 insertions(+), 8 deletions(-) (limited to 'doc/config.md') diff --git a/doc/config.md b/doc/config.md index e8421f4d..d18c3fa1 100644 --- a/doc/config.md +++ b/doc/config.md @@ -22,6 +22,8 @@ bonus configuration files in the bonus/ folder for further examples. **Table of contents** * [Start](#start) +* [Search](#search) +* [Encoding](#encoding) * [External](#external) * [Network](#network) * [Display](#display) @@ -49,22 +51,79 @@ Following is a list of start-up options: visual-home url -Page opened when Chawan is called with the -V option (and no other pages are -passed as arguments.) +Page opened when Chawan is called with the -V option (and no other +pages are passed as arguments.) -run-script +startup-script JavaScript code -Script Chawan runs on start. Pages will not be loaded until this function -exits. (setTimeout & friends do not block loading, though.) +Script Chawan runs on start-up. Pages will not be loaded until this +function exits. (Note however that asynchronous functions like setTimeout +do not block loading.) headless boolean -Whether Chawan should always start in headless mode. Enabled when Chawan is -called with -r. +Whether Chawan should always start in headless mode. Automatically +enabled when Chawan is called with -r. + + + + +## Search + +Search options are to be placed in the `[search]` section. + +Following is a list of search options: + + + + + + + + + + + + + + + +
**Name****Value****Function**
wrapbooleanWhen set to true, searchNext/searchPrev wraps around the document.
+ +## Encoding + +Encoding options are to be placed in the `[encoding]` section. + +Following is a list of encoding options: + + + + + + + + + + + + + + + + + + +
**Name****Value****Function**
fallback-charsetstring/arrayDefault character set for loading documents.
+For text +documents, all listed character sets are enumerated until the document has been +decoded without errors.
document-charsetstring/arrayList of forced character sets for loading documents.
+All listed character sets are enumerated until the document has been decoded +without errors.
+Overrides fallback-charset.
@@ -641,7 +700,9 @@ press again -> URL) `pager.ask(prompt)` -Ask the user for confirmation. Useful for e.g. an exit prompt: +Ask the user for confirmation. Returns a promise which resolves to a +boolean value indicating whether the user responded with yes.
+Can be used to implement an exit prompt like this: ``` q = 'pager.ask("Do you want to exit Chawan?").then(x => x ? pager.quit() : void(0))' ``` -- cgit 1.4.1-2-gfad0