Hoplon web development tools and libraries.
Clojure CSS


Hoplon build status epicycles

[hoplon "6.0.0-alpha16"] ;; latest release

Hoplon is a set of tools and libraries for making web applications. Hoplon provides a compiler for web application frontend development, and includes the following libraries as dependencies to complete the stack:

  • Javelin: a spreadsheet-like dataflow library for managing client state. Hoplon tightly integrates with Javelin to reactively bind DOM elements to the underlying Javelin cell graph.
  • Castra: a full-featured RPC library for Clojure and ClojureScript, providing the serverside environment.

Browser Support

Hoplon has been thoroughly tested on desktop and mobile devices against the following browsers:

  • IEdge 8+
  • Firefox 14+
  • Safari 5+
  • Chrome 26+
  • Opera 11+
  • Android 4.0+

Note that the object element is not implemented for IE 8, and that older browsers that predate HTML 5 elements such as Audio and Video will not render them. Additionally, boot development tasks such as boot-reload and boot-cljs-repl, which inject scripts into the browser to function, do not support IE 8 (which errors when output is written to the console without the developer tools open). Testing against these browsers is best done with simple or advanced optimizations turned on.




<script type="text/hoplon">
  ;; Page declaration specifies output file path.
  (page "index.html")

  ;; definitions are optional
  (defn my-list [& items]
      :class "my-list"
      (apply ul (map #(li (div :class "my-list-item" %)) items))))

  (def clicks (cell 0))

    <title>example page</title>
    <h1>Hello, Hoplon</h1>

    <!-- an HTML syntax call to the my-list function -->
      <span>first thing</span>
      <span>second thing</span>

    <!-- using dataflow to link DOM and Javelin cells -->
    <p><text>You've clicked ~{clicks} times, so far.</text></p>
    <button click="{{ #(swap! clicks inc) }}">click me</button>

Or, equivalently:

(page "index.html")

(defn my-list [& items]
    :class "my-list"
    (apply ul (map #(li (div :class "my-list-item" %)) items))))

(def clicks (cell 0))

    (title "example page"))
    (h1 "Hello, Hoplon")

      (span "first thing")
      (span "second thing"))

    (p (text "You've clicked ~{clicks} times, so far."))
    (button :click #(swap! clicks inc) "click me")))


# build and install locally
boot build-jar
# push snapshot
boot build-jar push-snapshot
# push release
boot build-jar push-release


Copyright (c) Alan Dipert and Micha Niskin. All rights reserved.

The use and distribution terms for this software are covered by the Eclipse
Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which can
be found in the file epl-v10.html at the root of this distribution. By using
this software in any fashion, you are agreeing to be bound by the terms of
this license. You must not remove this notice, or any other, from this software.