about summary refs log tree commit diff stats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* man: rewrite in Nimbptato2024-03-131-3/+8
| | | | | | | | | | | | Depending on Perl just for this is silly. Now we use libregexp for filtering basically the same things as w3mman2html did. This required another patch to QuickJS to avoid pulling in the entire JS engine, but in return, we can now run regexes without a dummy JS context global variable. Also, man.nim now tries to find a man command on the system even if it's not in /usr/bin/man.
* Separate ANSI text decoding from main binarybptato2024-02-251-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling text/plain as ANSI colored text was problematic for two reasons: * You couldn't actually look at the real source of HTML pages or text files that used ANSI colors in the source. In general, I only want ANSI colors when piping something into my pager, not when viewing any random file. * More importantly, it introduced a separate rendering mode for plaintext documents, which resulted in the problem that only some buffers had DOMs. This made it impossible to add functionality that would operate on the buffer's DOM, to e.g. implement w3m's MARK_URL. Also, it locked us into the horribly inefficient line-based rendering model of entire documents. Now we solve the problem in two separate parts: * text/x-ansi is used automatically for documents received through stdin. A text/x-ansi handler ansi2html converts ANSI formatting to HTML. text/x-ansi is also used for .ans, .asc file extensions. * text/plain is a separate input mode in buffer, which places all text in a single <plaintext> tag. Crucially, this does not invoke the HTML parser; that would eat NUL characters, which we should avoid. One blind spot still remains: copiousoutput used to display ANSI colors, and now it doesn't. To solve this, users can put the x-ansioutput extension field to their mailcap entries, which behaves like x-htmloutput except it first pipes the output into ansi2html.
* nim.cfg: disable threadsbptato2024-02-061-1/+1
| | | | | | | We do not use threads at the moment, so there's no need to link to pthreads either. (Also, add nim.cfg to the cha target in the Makefile.)
* Makefile: fix about.nim depsbptato2024-02-011-1/+2
|
* Add default md2html converterbptato2024-01-301-1/+9
|
* Add mancha man page viewerbptato2024-01-261-4/+24
| | | | | | | | | | derived from w3mman2html.cgi, there are only a few minor differences: * different man page opener command * use man:, man-k:, man-l: instead of query string to specify action * no form input (C-lC-uman:pageC-m is faster anyway) TODO rewrite in Nim so we don't have to depend on Perl...
* Add urlenc, urldec; fix a URL encoding bug; improve trans.cgibptato2024-01-081-1/+16
| | | | | | | | | | * Fix incorrect internal definition of the fragment percent-encode set * urlenc, urldec: these are simple utility programs mainly for use with shell local CGI scripts. (Sadly the printf + xargs solution is not portable.) * Pass libexec directory as an env var to local CGI scripts * Update trans.cgi to use urldec and add an example for combining it with selections
* charwidth: use pre-generated map filebptato2024-01-041-6/+15
| | | | Also for reducing compilation time.
* idna: use pre-generated map file, misc changesbptato2024-01-041-1/+9
| | | | | | | | | Speeds up compilation somewhat. Included in the repository because it's not that huge. misc changes: * use seq, not set for UCS-16 sets (it takes up less space) * remove unnecessary noSideEffects casts
* Add spartan supportbptato2024-01-031-1/+8
| | | | why not
* gmi2html: rewritebptato2023-12-221-5/+5
| | | | | | | | * Rewrite in Nim * This time, do not use a state machine (it was a very bad idea) * Do not emit <br> for every line; use CSS instead * Avoid double-newline caused by margins using CSS * Properly support list items
* Fix for sourcehut markdown parsing, small doc improvementsbptato2023-12-151-1/+1
| | | | hopefully this works
* Add doc/protocolsbptato2023-12-151-1/+3
|
* ftp: fix unnecessary slashes being added to path; move bindings/curlbptato2023-12-151-3/+3
| | | | also in ftp: clean up resources before exit
* socketstream, serversocket: portable bindUnixbptato2023-12-141-1/+1
| | | | | reimplementing it portably in Nim seems incredibly annoying, so we just use C
* Makefile: add missing mkdir commandsbptato2023-12-141-0/+9
|
* Makefile: add fwrapv to QJS buildbptato2023-12-141-1/+1
| | | | as done in upstream
* Various fixesbptato2023-12-131-19/+25
| | | | | | | * Makefile: fix parallel build, add new binaries to install target * twtstr: split out libunicode-related stuff to luwrap * config: quote default gopher2html URL env var for unquote * adapter/: get rid of types/url dependency, use CURL url in all cases
* break up twtstr somewhatbptato2023-12-131-2/+4
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* Move http out of main binarybptato2023-12-131-14/+23
| | | | | | | | | | | | Now it is (technically) no longer mandatory to link to libcurl. Also, Chawan is at last completely protocol and network backend agnostic :) * Implement multipart requests in local CGI * Implement simultaneous download of CGI data * Add REQUEST_HEADERS env var with all headers * cssparser: add a missing check in consumeEscape
* Move gopher to adapter/bptato2023-12-121-2/+12
| | | | Also, move default urimethodmap config to res.
* Move out ftp: protocol; fix some local CGI bugsbptato2023-12-121-2/+10
|
* Move out file: protocol handling to adapter/bptato2023-12-121-3/+6
|
* adapter/: re-structurebptato2023-12-121-12/+12
|
* local CGI improvements, move data: to cgi-binbptato2023-12-121-1/+5
| | | | error codes are WIP, not final yet...
* local CGI: add mapped URI env vars; move about: to adaptersbptato2023-12-121-1/+5
| | | | | | | | | | | | | | | * Add MAPPED_URI_* as environment variables when a request is coming from urimethodmap It costs us compatibility with w3m, but it seems to be a massive improvement over smuggling in the URL as a query string and then writing an ad-hoc parser for every single urimethodmap script. The variables are set for every urimethodmap request, to avoid accidental leaking of global environment variables. * Move about: to adapters (an obvious improvement over the previous solution)
* Makefile: clean up libexecdir on uninstallbptato2023-12-111-2/+8
|
* Add support for gemini by default, update readmebptato2023-12-101-1/+11
| | | | | No need to leave gemini support in the bonus folder. Still TODO: proxy support.
* Separate gopher conversion from main binarybptato2023-12-101-17/+40
| | | | | | | | | | | | | | | | | | | | | Now we use a (much simplified) gopher2html binary in libexec, instead of converting gopher directories to HTML in loader/gopher. This has two advantages: * Less ugly conversion logic in the loader module; we can just convert the file line by line. (The previous converter also had some correctness issues, that is fixed now as well.) * If the user desires, they can replace the gopher converter with another binary using the mailcap mechanism. The disadvantages are: * For now, source display is broken. This is a problem with all mailcap filters in general, and should be fixed in the future. (That said, the previous version also only displayed the converted HTML source, which was not really useful anyway.) * The proper directory structure is required for this to work; OTOH plenty of work has been done so that this is as frictionless as possible, so it should not really be a problem.
* Enable finger protocol by defaultbptato2023-12-101-2/+16
| | | | | | * Add a default urimethodmap that points finger: to cha-finger * Install cha-finger to /usr/local/libexec/cha/cgi-bin by default * cha-finger: use ALL_PROXY if given, die if curl is not installed
* Makefile: also remove QJSOBJbptato2023-12-091-0/+1
|
* Makefile: only remove target's objdir on cleanbptato2023-12-091-2/+1
|
* Makefile: properly list QJS object file dependenciesbptato2023-12-091-0/+13
|
* Makefile: disable CONFIG_BIGNUM for QJSbptato2023-12-051-2/+1
| | | | We do only use BigInt, so the flag is no longer necessary.
* Makefile: fix $(FLAGS) not being usedbptato2023-11-301-2/+3
|
* Makefile: rewritebptato2023-11-281-65/+60
| | | | | | | * Get rid of useless targets * Use real recipes instead of command runner targets * When given, use environment variables * Document Makefile stuff in doc/build.md
* Makefile: create manpage directories, fix wrong file modesbptato2023-10-141-6/+8
| | | | | | | * mkdir manpage directories too (not just prefix/bin) * use 0644 file mode instead of the nonsensical 0655 See https://todo.sr.ht/~bptato/chawan/1
* slightly refactor md to man preprocessing, update manpagebptato2023-10-131-4/+1
|
* makefile fixesbptato2023-10-011-2/+6
|
* Makefile: fix permsbptato2023-09-301-6/+6
|
* Makefile: fix manpage copybptato2023-09-301-1/+1
|
* Add urimethodmap supportbptato2023-09-301-1/+3
| | | | yay
* loader: add local-cgibptato2023-09-301-10/+14
| | | | | | | | | | | Add w3m-style local CGI support. It is not quite as powerful as w3m's local CGI, because it lacks an equivalent to W3m-control. Not sure if it's worth adding; we certainly shouldn't allow passing JS in headers, but a custom language for headers does not sound like a great idea either... eh, idk. also, TODO add multipart
* small Makefile improvementbptato2023-09-261-2/+5
|
* Build quickjs with bignum enabledbptato2023-09-231-2/+3
| | | | | | | BigInt is standard and widely available in browsers. We have no reason to exclude it. (BigFloat/BigDecimal are not, so we do not add them for now.)
* improve manpagesbptato2023-09-201-7/+14
|
* config.md: more preprocessingbptato2023-09-201-1/+3
|
* add table_rewrite.shbptato2023-09-201-1/+1
| | | | | | pandoc can only generate manpage tables from markdown tables, but the markdown pipe table syntax is horrible. So instead of rewriting our markdown documentation to use that syntax, just programmatically rewrite it.
* add manpagesbptato2023-09-201-0/+11
| | | | still needs some work
* Makefile: add debugger:native to debug targetbptato2023-09-111-1/+1
|