Clojure
(ns my.project
(:require [silk.core.server :as silk]
[silk.cli.api :as silkcli]))
(def data
[{:title "Room - Hall"
:description "The Hall of at home"
:links [{:transition-type "Door"
:direction "West"
:title "Enter"
:href "http://www.silkyweb.org"}]}])
; Bind markup with data and inject into tag ID
(silk/spin-by-id "index.html" "my-id" data)
; Bind data for each `data-sw-source` in markup
(silk/spin-by-data-sw-source "index.html")
; Spins an entire project stiching together templates, views, components
; and injects data where specifed. Params are reload? directory live? trace?
(silkcli/spin-or-reload false "~/path/to/project" false false)
ClojureScript
(ns my.project
(:require [silk.core.browser :as silk]))
(def data
[{:title "Room - Hall"
:description "The Hall of at home"
:links [{:transition-type "Door"
:direction "West"
:title "Enter"
:href "http://www.silkyweb.org"}]}])
; Bind markup with data and inject into tag ID
(silk/spin-by-id js/document "my-id" data)
; Bind data for each `data-sw-source` in markup
(silk/spin-by-data-sw-source js/document)
Clojure
ClojureScript