Source

pico-org / org-http.l

Full commit
(load "@lib/http.l")
(load "org.l")
(load "picostache.l")

(de readLines (File)
  (filter '((X) X) 
      (make
         (in File
             (until (eof)
                (link (pack (line))))))))

(de passoc (Key Lst) (cadr (seek '((X) (= Key (car X))) Lst)))
(setq lookup passoc) #hack to override picostache to use plists

(de start() 
  (let (Html (pack (readLines "org-html.html"))
         TemplateTree (parse Html)
         Lines (readLines "example.org.bak")
         Org (org-parse Lines 0)
         Model (cons 'org (list Org))
         HeaderTemplate (cdr TemplateTree))
         
         #need to find a more robust way to do this
         (push 'Model '((X) (if View (renderTree (cons 'org (list (list View))) HeaderTemplate))))
         (push 'Model 'orgt)
         (prinl (renderTree Model TemplateTree))))

(de go ()
 (server 21000 "!start") )