Skip to content
Browse files

Merge branch 'master' of git://github.com/tomfaulhaber/autodoc

  • Loading branch information...
2 parents 6d9dc9c + a974633 commit 44bf1ff8a9e82c9c0281c703de60645413b5b911 @fxt fxt committed Jun 7, 2011
View
16 params/clojure/build-master.xml
@@ -0,0 +1,16 @@
+<project name="clojure-core" default="all">
+
+ <description>
+ The subsidiary autodoc build file for building the clojure core
+ </description>
+
+ <target name="all">
+ <ant dir="${src-dir}" inheritAll="false">
+ <target name="clean"/>
+ <target name="jar"/>
+ </ant>
+ </target>
+
+</project>
+
+
View
2 params/clojure/params.clj
@@ -34,7 +34,7 @@
:version "v1.3"
:status "in development"
:params {:built-clojure-jar
- "/home/tom/src/clj/autodoc-work-area/clojure/src/clojure-slim.jar"}},
+ "/home/tom/src/clj/autodoc-work-area/clojure/src/clojure.jar"}},
{:name "1.1.x"
:version "v1.1"
:status "stable"
View
6 params/incanter/params.clj
@@ -21,11 +21,13 @@
:branches [{:name "master"
:version "next"
:status "in development"
- :params {:built-clojure-jar (str root "lib/clojure-1.2.0.jar")}},
+ :params {:built-clojure-jar (str root "lib/clojure-1.2.0.jar")
+ :load-classpath [#"/modules/[^/]+/src$"]}},
{:name "1.0.x"
:version "1.0"
:status "stable"
- :params {:built-clojure-jar (str root "lib/clojure-slim.jar")}}]
+ :params {:built-clojure-jar (str root "lib/clojure-slim.jar")
+ :load-classpath [#"/modules/[^/]+/src/main/clojure$"]}}]
:load-except-list [#"/test/" #"/classes/" #"project.clj$"],
})
View
22 params/java.classpath/build.xml
@@ -0,0 +1,22 @@
+<project name="java.classpath" default="all">
+
+ <description>
+ The subsidiary autodoc build file for building java.classpath
+ </description>
+
+ <target name="all">
+ <!-- First clean out the lib directory so we don't get cross branch pollution -->
+ <delete>
+ <fileset dir="${src-dir}" includes="**/target/**"/>
+ </delete>
+ <mkdir dir="${src-dir}/lib"/>
+
+ <!-- now execute incanter's build/install script -->
+ <exec executable="mvn" dir="${src-dir}">
+ <arg value="test"/>
+ </exec>
+ </target>
+
+</project>
+
+
View
29 params/java.classpath/params.clj
@@ -0,0 +1,29 @@
+(import (java.io File))
+
+(let [file-prefix (.getAbsolutePath (File. "../autodoc-work-area/java.classpath"))
+ root (str file-prefix "/src/")]
+ {:name "Classpath Utilities",
+ :file-prefix file-prefix,
+ :root root,
+ :source-path "src/main/clojure",
+ :web-src-dir "https://github.com/clojure/java.classpath/blob/",
+
+ :web-home "http://clojure.github.com/java.classpath/",
+ :output-path (str file-prefix "/autodoc/"),
+ :external-doc-tmpdir "/tmp/autodoc/doc",
+;; :clojure-contrib-classes (str root "build"),
+
+ :load-jar-dirs [(str root "lib")],
+
+ :namespaces-to-document ["clojure.java.classpath"],
+ :trim-prefix "clojure.tools.",
+
+ :branches [{:name "master"
+ :version "0.1.2"
+ :status "in development"
+ :params {:built-clojure-jar "/home/tom/src/clj/clojure-1.3/clojure.jar"}},
+ ]
+
+ :load-except-list [#"/classes/"],
+ })
+
View
7 params/java.classpath/templates/description.html
@@ -0,0 +1,7 @@
+The classpath library provides utilities for dealing with the JVM's classpath.
+<p>
+This library is a contributed library to Clojure and can be found at
+<a href="https://github.com/clojure/java.classpath">https://github.com/clojure/java.classpath</a>.
+<p>
+Like all of Clojure and its contributed libraries, the classpath library is licensed under the
+<a href="http://opensource.org/licenses/eclipse-1.0.php">Eclipse Public License (EPL)</a>.
View
22 params/java.jdbc/build.xml
@@ -0,0 +1,22 @@
+<project name="java.jdbc" default="all">
+
+ <description>
+ The subsidiary autodoc build file for building java.jdbc
+ </description>
+
+ <target name="all">
+ <!-- First clean out the lib directory so we don't get cross branch pollution -->
+ <delete>
+ <fileset dir="${src-dir}" includes="**/target/**"/>
+ </delete>
+ <mkdir dir="${src-dir}/lib"/>
+
+ <!-- now execute incanter's build/install script -->
+ <exec executable="mvn" dir="${src-dir}">
+ <arg value="test"/>
+ </exec>
+ </target>
+
+</project>
+
+
View
29 params/java.jdbc/params.clj
@@ -0,0 +1,29 @@
+(import (java.io File))
+
+(let [file-prefix (.getAbsolutePath (File. "../autodoc-work-area/java.jdbc"))
+ root (str file-prefix "/src/")]
+ {:name "JDBC-based SQL Interface",
+ :file-prefix file-prefix,
+ :root root,
+ :source-path "src/main/clojure",
+ :web-src-dir "https://github.com/clojure/java.jdbc/blob/",
+
+ :web-home "http://clojure.github.com/java.jdbc/",
+ :output-path (str file-prefix "/autodoc/"),
+ :external-doc-tmpdir "/tmp/autodoc/doc",
+
+ :load-jar-dirs [(str root "lib")],
+
+ :namespaces-to-document ["clojure.java.jdbc"],
+ :trim-prefix nil,
+ :build-json-index nil,
+
+ :branches [{:name "master"
+ :version "0.0.1"
+ :status "in development"
+ :params {:built-clojure-jar "/home/tom/src/clj/clojure-1.3/clojure.jar"}},
+ ]
+
+ :load-except-list [#"/classes/"],
+ })
+
View
BIN params/java.jdbc/static/clojure-icon.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN params/java.jdbc/static/favicon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
7 params/java.jdbc/templates/description.html
@@ -0,0 +1,7 @@
+java.jdbc provides a Clojure interface to SQL databases via JDBC.
+<p>
+This library is a contributed library to Clojure and can be found at
+<a href="https://github.com/clojure/java.jdbc">https://github.com/clojure/java.jdbc</a>.
+<p>
+Like all of Clojure and its contributed libraries, the JDBC library is licensed under the
+<a href="http://opensource.org/licenses/eclipse-1.0.php">Eclipse Public License (EPL)</a>.
View
10 resources/templates/master-toc.html
@@ -6,10 +6,12 @@
<li><a href="index.html" class="wiki_link">Overview</a></li>
<li><a href="api-index.html" class="wiki_link">API Index</a></li>
</ul>
- <span class="toc-header">Namespaces</span>
- <ul id="left-sidebar-list">
- <li><a class="wiki_link" href="link target">Namespace short name</a></li>
- </ul>
+ <div class="NamespaceTOC">
+ <span class="toc-header">Namespaces</span>
+ <ul id="left-sidebar-list">
+ <li><a class="wiki_link" href="link target">Namespace short name</a></li>
+ </ul>
+ </div>
<div class="BranchTOC">
<span class="toc-header">Other Versions</span>
<ul id="left-sidebar-branch-list">
View
42 src/autodoc/build_html.clj
@@ -214,12 +214,16 @@ looks in the base template directory."
(deffragment make-master-toc *master-toc-file* [ns-info branch-info all-branch-info prefix]
[:#project-name] (content (:name params))
[:#version] (content (:version branch-info))
- [:ul#left-sidebar-list :li] (clone-for [ns ns-info]
- #(at %
+ [:div.NamespaceTOC] #(when (> (count ns-info) 1)
+ (at %
+ [:ul#left-sidebar-list :li]
+ (clone-for [ns ns-info]
+ (fn [n]
+ (at n
[:a] (do->
(set-attr :href (ns-html-file ns))
- (content (:short-name ns)))))
- [:div.BranchTOC] #(when all-branch-info
+ (content (:short-name ns))))))))
+ [:div.BranchTOC] #(when (> (count all-branch-info) 1)
(at %
[:ul#left-sidebar-branch-list :li]
(clone-for [{:keys [version name status]}
@@ -403,10 +407,11 @@ actually changed). This reduces the amount of random doc file changes that happe
[:div#sub-namespaces]
(substitute (map #(render-sub-namespace-api % branch-info external-docs) (:subspaces ns))))))
-(defn make-ns-page [ns master-toc external-docs branch-info prefix]
- (create-page (ns-html-file ns)
+(defn make-ns-page [unique-ns? ns master-toc external-docs branch-info prefix]
+ (create-page (if unique-ns? "index.html" (ns-html-file ns))
(when (not (:first? branch-info)) (:name branch-info))
- (cl-format nil "~a - ~a ~a API documentation" (:short-name ns) (params :name) (:version branch-info))
+ (cl-format nil "~a - ~a ~a API documentation"
+ (:short-name ns) (params :name) (:version branch-info))
prefix
master-toc
(make-local-toc (ns-toc-data ns))
@@ -435,15 +440,16 @@ vars in ns-info that begin with that letter"
"\n *" " ")
suffix)))
-(defn gen-index-line [v ns]
+(defn gen-index-line [v ns unique-ns?]
(let [var-name (:name v)
overhead (count var-name)
short-name (:short-name ns)
doc-len (+ 50 (min 0 (- 18 (count short-name))))]
#(at %
[:a] (do->
(set-attr :href
- (str (ns-html-file ns) "#" (:full-name ns) "/" (:name v)))
+ (str (if unique-ns? "index.html" (ns-html-file ns))
+ "#" (:full-name ns) "/" (:name v)))
(content (:name v)))
[:#line-content] (content
(cl-format nil "~vt~a~vt~a~vt~a~%"
@@ -453,7 +459,7 @@ vars in ns-info that begin with that letter"
(doc-prefix v doc-len))))))
;; TODO: skip entries for letters with no members
-(deffragment make-index-content *index-html-file* [branch-info vars-by-letter]
+(deffragment make-index-content *index-html-file* [branch-info vars-by-letter unique-ns?]
[:#header-project] (content (:name params))
[:#header-version] (content (:version branch-info))
[:#header-status] (content (:status branch-info))
@@ -463,16 +469,18 @@ vars in ns-info that begin with that letter"
[:h2] (set-attr :id letter)
[:span#section-head] (content letter)
[:span#section-content] (clone-for [[v ns] vars]
- (gen-index-line v ns)))))
+ (gen-index-line v ns unique-ns?)))))
(defn make-index-html [ns-info master-toc branch-info prefix]
(create-page *index-html-file*
(when (not (:first? branch-info)) (:name branch-info))
- (cl-format nil "Index - ~a ~a API documentation" (params :name) (:version branch-info))
+ (cl-format nil "Index - ~a ~a API documentation"
+ (params :name) (:version branch-info))
prefix
master-toc
nil
- (make-index-content branch-info (vars-by-letter ns-info))))
+ (make-index-content branch-info (vars-by-letter ns-info)
+ (<= (count ns-info) 1))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
@@ -591,9 +599,11 @@ vars in ns-info that begin with that letter"
(let [prefix (if (:first? branch-info) nil "../")
master-toc (make-master-toc ns-info branch-info all-branch-info prefix)
external-docs (wrap-external-doc doc-dir master-toc)]
- (make-overview ns-info master-toc branch-info prefix)
- (doseq [ns ns-info]
- (make-ns-page ns master-toc external-docs branch-info prefix))
+ (if (> (count ns-info) 1)
+ (do (make-overview ns-info master-toc branch-info prefix)
+ (doseq [ns ns-info]
+ (make-ns-page false ns master-toc external-docs branch-info prefix)))
+ (make-ns-page true (first ns-info) master-toc external-docs branch-info prefix))
(make-index-html ns-info master-toc branch-info prefix)
(make-index-clj ns-info branch-info)
(make-index-json ns-info branch-info)))))
View
6 src/autodoc/doc_files.clj
@@ -43,6 +43,12 @@ transformations along the way."
(File. (File. dst) (.replaceFirst relative "\\.markdown$" ".html"))
(:out (sh "markdown" (.getPath src-file)))))
+(defmethod xform-file "md"
+ [src-file dst relative]
+ (spit
+ (File. (File. dst) (.replaceFirst relative "\\.md$" ".html"))
+ (:out (sh "markdown" (.getPath src-file)))))
+
(defn xform-tree
"Takes source and destination directories and copies the source to the destination,
transforming files as appropriate."

0 comments on commit 44bf1ff

Please sign in to comment.
Something went wrong with that request. Please try again.