Plan 9: Dynamic HTML
Render Dynamic HTML using plot and qjs.
Render a simple website
Font zoom
E-Book Reader
eBook is a collection of HTML files in a ZIP archive. Follow same steps for Comic Book reader which are collection of JPG/PNG images in a ZIP/RAR archive.
For columns, pure HTML solution involves column-count CSS property. However, this works only for designed screen sizes. For non-standard sizes, the first column might span multiple pages before continuing in the second column. Hence, the page mode manages the split without relying on the column-count.
Keymap
t Table of Content
-/= Font zoom
1,2,3 Column
s Toggle scroll/page mode
Up/down Scroll
Prev/Next Chapter navigation
q Quit
Linkedom Fixes
- Use lowerCaseAttributeNames: isHTML to ignore case for attribute names.
Lessons Learnt
- Mouse click generates two events like a keypress. If you are doing a zero byte read, you're likely to miss an event as each read pops the event queue.
- Screen, keyboard and mouse are separate devices - obviously. However, only Plan 9 allows these to be interacted with via separate programs.
- Plan 9 draws a symmetrical line i.e. 2*thickness+1 pixels. Important to note for table calculations.
References
- HTML rendering in Emacs
- HTML rendering via SVG
- Browser in Javascript
- Plan 9: Tiled Map
- Comic Book Reader
Miscellaneous
Comments
Post a Comment