about summary refs log tree commit diff stats
path: root/src/main.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2021-08-04 17:54:27 +0200
committerbptato <nincsnevem662@gmail.com>2021-08-04 17:54:27 +0200
commitcaad7b577162a73524277a943050493c489bfb59 (patch)
treea149be40ceebc4303d94c797d2a62ef62b1a42a0 /src/main.nim
parent34b023515599bc746c10c597467ecb07f53c49fe (diff)
downloadchawan-caad7b577162a73524277a943050493c489bfb59.tar.gz
More css stuff
Diffstat (limited to 'src/main.nim')
-rw-r--r--src/main.nim13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main.nim b/src/main.nim
index 539527f1..92d6b3b9 100644
--- a/src/main.nim
+++ b/src/main.nim
@@ -3,8 +3,6 @@ import uri
 import os
 import streams
 
-import css/style
-
 import utils/termattrs
 
 import html/dom
@@ -12,8 +10,8 @@ import html/htmlparser
 
 import io/display
 import io/twtio
+import io/buffer
 
-import buffer
 import config
 
 let clientInstance = newHttpClient()
@@ -39,6 +37,9 @@ proc getPageUri(uri: Uri): Stream =
 
 var buffers: seq[Buffer]
 
+
+const defaultcss = staticRead"../res/default.css"
+
 proc main*() =
   if paramCount() != 1:
     eprint "Invalid parameters. Usage:\ntwt <url>"
@@ -50,10 +51,7 @@ proc main*() =
   let uri = parseUri(paramStr(1))
   buffers.add(buffer)
   buffer.document = parseHtml(getPageUri(uri))
-  let s = buffer.document.querySelector(":not(:first-child)")
-  eprint s.len
-  for q in s:
-    eprint q
+  buffer.document.applyDefaultStylesheet()
   buffer.setLocation(uri)
   buffer.renderHtml()
   var lastUri = uri
@@ -71,4 +69,3 @@ proc main*() =
       buffer.renderHtml()
     lastUri = newUri
 main()
-#parseCSS(newFileStream("default.css", fmRead))