Permalink
Browse files

Basic HTML documentation writer

  • Loading branch information...
1 parent 2ff2211 commit 9811f6e1a6bf4a820b3bc54c9c19b278beb607d9 @weavejester committed Oct 30, 2011
Showing with 20 additions and 1 deletion.
  1. +2 −1 project.clj
  2. +18 −0 src/codox/writer/html.clj
View
@@ -1,4 +1,5 @@
(defproject codox "0.0.1"
:description "Generate documentation from Clojure source files"
:dependencies [[org.clojure/clojure "1.2.1"]
- [org.clojure/tools.namespace "0.1.0"]])
+ [org.clojure/tools.namespace "0.1.0"]
+ [hiccup "0.3.7"]])
View
@@ -0,0 +1,18 @@
+(ns codox.writer.html
+ "Documentation writer that outputs HTML."
+ (:use [hiccup core page-helpers]))
+
+(defn- make-index
+ [namespaces]
+ (html5
+ [:head
+ [:title "Documentation"]]
+ [:body
+ (for [namespace namespaces]
+ [:div.namespace
+ [:h1 (:name namespace)]])]))
+
+(defn write-docs
+ "Take raw documentation info and turn it into formatted HTML."
+ [info]
+ (spit "index.html" (make-index info)))

0 comments on commit 9811f6e

Please sign in to comment.