about summary refs log tree commit diff stats
path: root/src/main.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2021-08-10 15:19:32 +0200
committerbptato <nincsnevem662@gmail.com>2021-08-10 15:19:32 +0200
commita5f7da0428fdb74d9691cd6d589047478f422898 (patch)
tree0bbea58202a8f509c83378a4b57bbe419131c7d5 /src/main.nim
parent3d24875924b088e5d771e4b901f692659c5281c0 (diff)
downloadchawan-a5f7da0428fdb74d9691cd6d589047478f422898.tar.gz
Some refactoring
Diffstat (limited to 'src/main.nim')
-rw-r--r--src/main.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.nim b/src/main.nim
index 4ce11f79..b1345ce2 100644
--- a/src/main.nim
+++ b/src/main.nim
@@ -5,6 +5,7 @@ import streams
 
 import html/parser
 import html/dom
+import html/renderer
 import io/buffer
 import io/term
 import config/config
@@ -32,7 +33,6 @@ proc getPageUri(uri: Uri): Stream =
 
 var buffers: seq[Buffer]
 
-
 proc main*() =
   if paramCount() != 1:
     eprint "Invalid parameters. Usage:\ntwt <url>"
@@ -42,10 +42,11 @@ proc main*() =
   let buffer = newBuffer(attrs)
   let uri = parseUri(paramStr(1))
   buffers.add(buffer)
-  buffer.source = getPageUri(uri).readAll() #TODO buffer.renderPlainText(getPageUri(uri).readAll())
+  buffer.source = getPageUri(uri).readAll() #TODO get rid of this
   buffer.document = parseHtml(newStringStream(buffer.source))
   buffer.setLocation(uri)
   buffer.document.applyDefaultStylesheet()
+  buffer.alignBoxes()
   buffer.renderDocument()
   var lastUri = uri
   while displayPage(attrs, buffer):