/ns

Primary LanguageCBSD 2-Clause "Simplified" LicenseBSD-2-Clause

WIP
===

ns - maybe a web browser in the far, far future (for unix, plan9)

files:
 ~> html.c - html parser (works!)
 ~> render.c (wip) {X11(wip),plan9(wip),console(in the future)} frontend
 ~> css.c - No.
 ~> ns.c - main

unix:
  $ make OS=unix
  $ ./ns
unix+p9p:
  $ make OS=plan9port
  $ ./ns
plan9:
  ; mk
  ; ./ns

note: on GNU/Linux you might need to install BSD-compatible make (e.g. bmake)

keybinds
--------
{j, space} - scroll down
k          - scroll up
{1, Esc}   - quit
d          - dump html tree to stdout
l          - highlight links
r          - create the rendermap again (redraw)

left click - go to link
scroll     - scroll

references
----------
- https://github.com/jsynacek/xft-example/blob/master/main.c
- https://keithp.com/~keithp/render/Xft.tutorial
- http://wiki.9front.org/programming-gui
- http://man.9front.org/1/mk
- https://en.wikipedia.org/wiki/Five_stages_of_grief


log:
  23 oct 2022: Fix render.c font rendering issues, speed up rendering on X11
               after initial generation of the rendermap. The codebase _needs_
               refactoring. Fix 'DO NOT FUCKING RENDER PAGE EVERY TIME AN
               EVENT IS REGISTERED' todo when using X11. Changed the default
               font in css.c from Comic Sans to monospace for sanity's sake.
               Broke links. Fixed links. Fixed compiler warnings.
  24 oct 2022: Very ghetto speed up.
  29 oct 2022: Very ghetto console rendering implementation (console.c).
  31 oct 2022: added default_font in render.c to speed up rendering big blocks
               of text in default font (via x_load_render_destroy()).
  01 nov 2022: css.c now accepts html color notation (#xxxxxx), rgb(), rgba().
               started implementing hsl() by ripping off Michael Jackson - it
               went poorly :^). Fix plan9, better mkfile. Faster rgb() etc.
               (snprintf() -> bit fiddling).
  19 nov 2022: r key to redraw, document keybinds.