Compare commits
3 Commits
043c09da50
...
0018f122a5
Author | SHA1 | Date |
---|---|---|
Emery Hemingway | 0018f122a5 | |
Emery Hemingway | cd042fbf44 | |
Emery Hemingway | 8150a19612 |
15
README.md
15
README.md
|
@ -5,3 +5,18 @@
|
||||||
- Network transparent
|
- Network transparent
|
||||||
- Reimplementable
|
- Reimplementable
|
||||||
- Display device agnostic (LCD, E-ink, ocular-bypass)
|
- Display device agnostic (LCD, E-ink, ocular-bypass)
|
||||||
|
|
||||||
|
## Further reading
|
||||||
|
* [Eaglemode](http://eaglemode.sourceforge.net/)
|
||||||
|
* [Pad++](./doc/spe-98-padimplementation.pdf)
|
||||||
|
* [A2](https://en.wikipedia.org/wiki/A2_(operating_system))
|
||||||
|
* [Sigma Lenses: Focus-Context Transitions Combining Space, Time and Translucence](https://hal.inria.fr/inria-00271301)
|
||||||
|
* [Approaches for visualizing large graphs](https://notes.andymatuschak.org/Approaches_for_visualizing_large_graphs)
|
||||||
|
* [ZVTM](http://zvtm.sourceforge.net/)
|
||||||
|
* [Archy](https://en.wikipedia.org/wiki/Archy_(software))
|
||||||
|
* [ZOOMABLE USER INTERFACES IN SCALABLE VECTOR GRAPHICS ](./doc/SvgOpen2007.pdf)
|
||||||
|
* [NeWS](https://en.wikipedia.org/wiki/NeWS)
|
||||||
|
|
||||||
|
### Text encoding
|
||||||
|
* [TEI](https://en.wikipedia.org/wiki/Text_Encoding_Initiative)
|
||||||
|
* [XHTML Basic](http://www.w3.org/TR/xhtml-basic)
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -1,58 +0,0 @@
|
||||||
# SPDX-FileCopyrightText: ☭ 2021 Emery Hemingway
|
|
||||||
# SPDX-License-Identifier: Unlicense
|
|
||||||
|
|
||||||
import std/[asyncdispatch, os, parseopt, strutils, tables, xmltree]
|
|
||||||
import preserves, preserves/xmlhooks
|
|
||||||
import syndicate, syndicate/[actors, capabilities, relay]
|
|
||||||
import parsegemini
|
|
||||||
import gemclient
|
|
||||||
import nimsvg
|
|
||||||
import svui
|
|
||||||
import eris
|
|
||||||
|
|
||||||
type Svui = svui.Svui[Ref]
|
|
||||||
|
|
||||||
proc main() =
|
|
||||||
proc quitHook() {.noconv.} = quit()
|
|
||||||
setControlCHook(quitHook)
|
|
||||||
|
|
||||||
waitFor runActor("client") do (turn: var Turn):
|
|
||||||
|
|
||||||
let cap = mint()
|
|
||||||
|
|
||||||
connectUnix(turn, "/run/syndicate/ds", cap) do (turn: var Turn; a: Assertion) -> TurnAction:
|
|
||||||
let ds = unembed a
|
|
||||||
let client = newGeminiClient()
|
|
||||||
|
|
||||||
for kind, arg, _ in getopt():
|
|
||||||
if kind == cmdArgument and arg.startsWith"gemini":
|
|
||||||
var
|
|
||||||
nodes: seq[Nodes]
|
|
||||||
p: GeminiParser
|
|
||||||
let resp = client.fetch(arg)
|
|
||||||
open(p, resp.bodyStream)
|
|
||||||
# TODO: append to a text block until running into verbatim text,
|
|
||||||
# then push the current text and open a new block
|
|
||||||
while true:
|
|
||||||
p.next()
|
|
||||||
case p.kind
|
|
||||||
of gmiEof: break
|
|
||||||
else:
|
|
||||||
let n = buildSvg:
|
|
||||||
t: xmltree.escape p.text
|
|
||||||
nodes.add n
|
|
||||||
close(p)
|
|
||||||
let doc = buildSvg:
|
|
||||||
svg(viewBox="0 0 600 800", `font-family` = "Gentium Plus", `font-size`="20"):
|
|
||||||
g(fill="white"):
|
|
||||||
text(fill="black"):
|
|
||||||
for n in nodes: embed n
|
|
||||||
let
|
|
||||||
buf = render doc
|
|
||||||
bs = if buf.len < (16 shl 10): bs1k else: bs32k
|
|
||||||
capPr = toPreserve($erisCap(buf, bs), Ref)
|
|
||||||
discard publish(turn, ds, Svui(attrs: toTable {"urn": capPr}, svg: buf))
|
|
||||||
|
|
||||||
stderr.writeLine "done"
|
|
||||||
|
|
||||||
main()
|
|
Loading…
Reference in New Issue