~subsetpark/bagatto

dabc238c730f5eca7209fe3d4ad4edf3ee5fb91e — Zach Smith 12 days ago 4fc04b3 master
Update docs to reflect template syntax
4 files changed, 13 insertions(+), 12 deletions(-)

M MANUAL.md
M bagatto.janet
M demo/mmd/index.janet
M lockfile.jdn
M MANUAL.md => MANUAL.md +1 -1
@@ 615,7 615,7 @@ I am known for my {{ (args "topic") }} skills.
Then we can render out page contents like so:

```
repl:5:> (bagatto/render "templates/simple" {"topic" "Web Design"})
repl:5:> (bagatto/render "/templates/simple" {"topic" "Web Design"})
@"I am known for my Web Design skills.\n"
```


M bagatto.janet => bagatto.janet +3 -4
@@ 391,10 391,9 @@
     (def prev-template ((dyn :cxt) :current-template))
     (put (dyn :cxt) :current-template ,template)
     (let [env (require ,template)
           render-dict ((env 'render-dict) :value)
           out (render-dict args)]
       (put (dyn :cxt) :current-template prev-template)
       out)))
           render-dict ((env 'render-dict) :value)]
       (render-dict args))
     (put (dyn :cxt) :current-template prev-template)))

(defn markdown->html
  "Render a markdown string into HTML."

M demo/mmd/index.janet => demo/mmd/index.janet +1 -1
@@ 4,4 4,4 @@
                   :attrs bagatto/parse-mmarkdown}})
(def site {:pages {:each :pages
                   :dest (bagatto/%p "pages" '%i "title" '% ".html")
                   :out (bagatto/renderer "templates/page") }})
                   :out (bagatto/renderer "templates/page")}})

M lockfile.jdn => lockfile.jdn +8 -6
@@ 1,10 1,12 @@
@[{:sha "c0951f6978555268a24d86eee2f118327328b40b" :repo "https://github.com/andrewchambers/janet-jdn.git"}
@[{:sha "b0fdfff39a192cef46449c93f3a1ff46cc0d41f3" :repo "https://github.com/janet-lang/pkgs.git"}
  {:sha "c24d1b7b15f9c576e0d48bb78b351e88ce51cfcd" :repo "https://github.com/janet-lang/json.git"}
  {:sha "51a147f9c667fa4b96c796f83c90b0478466feed" :repo "https://git.sr.ht/~subsetpark/mago"}
  {:sha "fd552e880cb3510f10a230ea5f9dcc227fcb521f" :repo "https://github.com/janet-lang/path.git"}
  {:sha "cc95921acbdcddf9e4b99602fbdd8288cf4e8747" :repo "https://github.com/janet-lang/spork.git"}
  {:sha "5d1bea51664cf2f076ce6ac4786c2fb744f2c02c" :repo "https://github.com/janet-lang/argparse.git"}
  {:sha "5a3689c250a207186bcb1a30f131d71e45b8cea6" :repo "https://github.com/andrewchambers/janet-posix-spawn.git"}
  {:sha "ce2c6308fdfbd344d2c17b2712f02bbc1fb69bf3" :repo "https://github.com/pyrmont/testament"}
  {:sha "ed7e83e8779e2a54e23bbbcc75366ade2dd5372a" :repo "https://git.sr.ht/~bakpakin/temple"}
  {:sha "12e2e338cba69b02f284d8082804d8e811436651" :repo "https://github.com/pyrmont/testament"}
  {:sha "fd552e880cb3510f10a230ea5f9dcc227fcb521f" :repo "https://github.com/janet-lang/path.git"}
  {:sha "61437d96b5df6eb7e524f88847e7d7521201662d" :repo "https://github.com/janet-lang/json.git"}
  {:sha "4226a4cae548fde38358aa1fdb6d6a90bf5fe175" :repo "https://github.com/andrewchambers/janet-sh.git"}
  {:sha "077ec6b7618d4e775e59705b28806c865ba67238" :repo "https://github.com/pyrmont/markable"}]
  {:sha "c0951f6978555268a24d86eee2f118327328b40b" :repo "https://github.com/andrewchambers/janet-jdn.git"}
  {:sha "599495ba4099f1aa6ddea67d1102f514f15237cd" :repo "https://github.com/andrewchambers/janet-sh.git"}
  {:sha "1be2628f85d4062581cd20551f519b9c1de1a8fc" :repo "https://github.com/pyrmont/markable"}]