Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on manual usage #186

Open
sli opened this issue Sep 12, 2019 · 1 comment
Open

Documentation on manual usage #186

sli opened this issue Sep 12, 2019 · 1 comment

Comments

@sli
Copy link

sli commented Sep 12, 2019

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.

@weavejester
Copy link
Owner

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]}))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants