diff options
-rw-r--r-- | doc/config.md | 16 | ||||
-rw-r--r-- | res/cha.html | 3 | ||||
-rw-r--r-- | res/chawan.html | 31 | ||||
-rw-r--r-- | res/config.toml | 2 | ||||
-rw-r--r-- | src/io/about.nim | 6 |
5 files changed, 43 insertions, 15 deletions
diff --git a/doc/config.md b/doc/config.md index 6e9f0ea4..8d288c45 100644 --- a/doc/config.md +++ b/doc/config.md @@ -49,21 +49,21 @@ Following is a list of start-up options: <tr> <td>visual-home</td> <td>url</td> -<td>Page opened when cha is called with the -V option (and no other pages are +<td>Page opened when Chawan is called with the -V option (and no other pages are passed as arguments.)</td> </tr> <tr> <td>run-script</td> <td>JavaScript code</td> -<td>Script cha runs on start. Pages will not be loaded until this function +<td>Script Chawan runs on start. Pages will not be loaded until this function exits. (setTimeout & friends do not block loading, though.)</td> </tr> <tr> <td>headless</td> <td>boolean</td> -<td>Whether cha should always start in headless mode. Enabled when cha is +<td>Whether Chawan should always start in headless mode. Enabled when Chawan is called with -r.</td> </tr> @@ -119,7 +119,7 @@ Network options are to be placed in the `[network]` section. <tr> <td>prepend-https</td> <td>boolean</td> -<td>Whether or not cha should attempt loading "raw" URLs without a scheme as +<td>Whether or not Chawan should attempt loading "raw" URLs without a scheme as https (e.g. wikipedia.org as https://wikipedia.org.)</td> </tr> @@ -244,7 +244,7 @@ passed as arguments are matched as well.</td> <tr> <td>substitute</td> <td>JavaScript function</td> -<td>A JavaScript function cha will pass the input string to. If a new string is +<td>A JavaScript function Chawan will pass the input string to. If a new string is returned, it will be parsed instead of the old one.</td> </tr> @@ -301,8 +301,8 @@ name/ip address.) Either this or the `url` option must be specified.</td> <tr> <td>rewrite-url</td> <td>JavaScript function</td> -<td>A JavaScript function cha will pass the URL to. If a new URL is returned, -it will replace the old one.</td> +<td>A JavaScript function Chawan will pass the URL to. If a new URL is +returned, it will replace the old one.</td> </tr> <tr> @@ -500,7 +500,7 @@ is typed in. A list of built-in pager functions can be found below. <td>Go to the specified URL. Opens a prompt with the current URL when no parameters are specified; otherwise, the string passed is displayed in the prompt. If this string ends with a newline -(e.g. `pager.load("about:cha\n")`), the URL is loaded directly.</td> +(e.g. `pager.load("about:chawan\n")`), the URL is loaded directly.</td> </tr> <tr> diff --git a/res/cha.html b/res/cha.html deleted file mode 100644 index f7ba93c8..00000000 --- a/res/cha.html +++ /dev/null @@ -1,3 +0,0 @@ -<body> -cha browser 0.1 -</body> diff --git a/res/chawan.html b/res/chawan.html new file mode 100644 index 00000000..7b022f9a --- /dev/null +++ b/res/chawan.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<head> + <title>Chawan Browser 0.1</title> + <style> + .u { + text-decoration: underline; + } + .logo { + position: absolute; + bottom: 0; + right: 0; + } + </style> +</head> +<body> + <center><h1>Welcome to Chawan!</h1></center> + This is the default visual home page. You might want to change it in + your configuration file. +<pre class=logo> + _......................._ +fr.,~.~,,~~.~~~,~,~~~~,,.bl +I!www~www~www~www~www~www!ds +lCHCHCHCHCHCHCHCHCHCHCHCHCp + kCHCHCHCHCHCHCHCHCHCHCHCp + sAAAAAAAAAAAAAAAAAAAAAp + l<span class=u>S</span>WWWWWWWWWWWWWWWWW<span class=u>Z</span>i + lSAAAAAAAAAAAAAZ/ + \<span class=u>ZM</span>NNNNNNN<span class=u>MZ</span>/ + \<span class=u>HHHHH</span>/ +</pre> +</body> diff --git a/res/config.toml b/res/config.toml index 17bfc574..dd15aebc 100644 --- a/res/config.toml +++ b/res/config.toml @@ -1,5 +1,5 @@ [start] -visual-home = "about:cha" +visual-home = "about:chawan" run-script = "" headless = false diff --git a/src/io/about.nim b/src/io/about.nim index f90e0c36..674885ba 100644 --- a/src/io/about.nim +++ b/src/io/about.nim @@ -5,18 +5,18 @@ import io/request import ips/serialize import types/url -const cha = staticRead"res/cha.html" +const chawan = staticRead"res/chawan.html" const Headers = { "Content-Type": "text/html" }.toTable() proc loadAbout*(request: Request, ostream: Stream) = - if request.url.pathname == "cha": + if request.url.pathname == "chawan": ostream.swrite(0) ostream.swrite(200) # ok let headers = newHeaderList(Headers) ostream.swrite(headers) - ostream.write(cha) + ostream.write(chawan) else: ostream.swrite(-1) ostream.flush() |