codox icon indicating copy to clipboard operation
codox copied to clipboard

Documentation on manual usage

Open sli opened this issue 6 years ago • 1 comments

I'm currently using the Codox manually with a shadow-cljs project, which doesn't seem to be officially supported, but does work mostly fine. I'm not sure if I just haven't found it, but there don't seem to be any docs on using the library directly, outside of lein.

A few features don't seem accessible when running generate-docs manually. Namely, {git-commit} in the :source-uri setting seems to be stripped out (no errors, but no commit hashes either), and the :project map does not seem to be used. I'm invoking Codox using the shadow-cljs Clojure runner:

$ shadow-cljs clj-run user/build-docs

And the code that does the work is as follows (with some confidential stuff removed):

(defn build-docs
  []
  (generate-docs
    {:project {:name "frontend"
               :version "0.1.0-SNAPSHOT"
               :description "Frontend for the application."}
     :language :clojurescript
     :source-paths ["src"]
     :source-uri "https://our.git.server/dev/frontend/blob/{git-commit}/{filepath}#L{line}"
     :metadata {:doc/format :markdown :doc "FIXME: Write documentation."}
     :doc-paths ["doc"]
     :themes [:dark]}))

Installed codox version is 0.10.7.

sli avatar Sep 12 '19 21:09 sli

Take a look at the options passed to generate-docs by the Leiningen plugin.

You want something more like:

(defn build-docs
  []
  (generate-docs
    {:name "frontend"
     :version "0.1.0-SNAPSHOT"
     :description "Frontend for the application."
     :language :clojurescript
     :source-paths ["src"]
     :output-path "doc"
     :root-path "."
     :source-uri "https://our.git.server/dev/frontend/blob/{git-commit}/{filepath}#L{line}"
     :metadata {:doc/format :markdown :doc "FIXME: Write documentation."}
     :doc-paths ["doc"]
     :themes [:dark]}))

weavejester avatar Sep 13 '19 04:09 weavejester