Permalink
Browse files

more work on the namespace api stuff

  • Loading branch information...
1 parent 1aa7ade commit fdf0196886648d20cee0801eb6dd617cb6f59378 @tomfaulhaber committed Jul 6, 2009
Showing with 20 additions and 13 deletions.
  1. +17 −9 com/infolace/gen_docs/build_html.clj
  2. +1 −1 templates/local-toc.html
  3. +2 −3 templates/namespace-api.html
@@ -79,6 +79,17 @@ partial html data leaving a vector of nodes which we then wrap in a <div> tag"
:else %)
see-also-seq))
+(defn see-also-links [ns]
+ (if-let [see-also (seq (:see-also ns))]
+ #(at %
+ [:span#see-also-link]
+ (clone-for [[link text] (process-see-also (:see-also ns))]
+ (fn [t]
+ (at t
+ [:a] (do->
+ (set-attr :href link)
+ (content text))))))))
+
(defn namespace-overview [ns template]
(at template
[:#namespace-tag]
@@ -94,15 +105,7 @@ partial html data leaving a vector of nodes which we then wrap in a <div> tag"
#(at %
[:span#name] (content (:short-name s))
[:span#sub-var-link] (add-ns-vars s))))
- [:span#see-also] (if-let [see-also (seq (:see-also ns))]
- #(at %
- [:span#see-also-link]
- (clone-for [[link text] (process-see-also (:see-also ns))]
- (fn [t]
- (at t
- [:a] (do->
- (set-attr :href link)
- (content text)))))))))
+ [:span#see-also] (see-also-links ns)))
(deffragment make-overview-content *overview-file* [ns-info]
[:div#namespace-entry] (clone-for [ns ns-info] #(namespace-overview ns %))
@@ -140,6 +143,11 @@ partial html data leaving a vector of nodes which we then wrap in a <div> tag"
;; TODO: handle sub-namespaces
(deffragment make-ns-content *namespace-api-file* [ns]
+ [:span#namespace-name] (content (:short-name ns))
+ [:span#author] (content (or (:author ns) "Unknown"))
+ [:span#long-name] (content (:full-name ns))
+ [:pre#namespace-docstr] (content (:doc ns))
+ [:span#see-also] (see-also-links ns)
[:div#var-entry] (clone-for [v (:members ns)] #(var-details v %))
)
View
@@ -1,6 +1,6 @@
<div id="toc">
<h1 class="nopad">Table of Contents</h1>
- <div style="margin-left: 1em;"><a href="API.html#toc0">Overview</a></div>
+ <div style="margin-left: 1em;"><a href="#toc0">Overview</a></div>
<div class="toc-entry" style="margin-left: 3em;">
<a href="Entry anchor">Index entry</a></div>
</div>
@@ -1,18 +1,17 @@
<h1 id="overview">API for <span id="namespace-name">my-namespace</span></h1>
by <span id="author">the author</span><br />
-Usage:
+<br />Usage:
<pre>
(ns your-namespace
(:require <span id="long-name">my-namespace</span>))
<pre>
-<br />
<h2>Overview</h2>
<pre id="namespace-docstr">docstr here</pre>
<span id="see-also">See also:
<span id="see-also-link">
<a href="see-also-tag">see-also-text</a>
</span><br />
-</span>
+</span><br />
<h2>Public Variables and Functions</h2>
<div id="var-entry">
<hr />

0 comments on commit fdf0196

Please sign in to comment.