codox
codox copied to clipboard
Multiple codox descriptions
I have a project using clojure for the server side and clojurescript for the client side. And of course, I would like codox to be able to generate both documentations.
I did not find a way to do it so far. And I was thinking that something like :
:codox [{:language :clojurescript
:sources ["src/client"]
:output-dir "doc/client"}
{:language :clojure
:sources ["src/server"]
:output-dir "doc/server"}]
Could be awesome :smile: (and hopefully, not to hard to implement)
Or mm I missing a feature here?
Thanks in advance, Benjamin Van Ryseghem
It should be possible to do this with Leiningen profiles.
Do you have some pointers? (since I am quite a newbie here still :panda_face: )
Edit: I had a look at Leiningen profiles. It could resolves this issue. Nevertheless I think I could be a cool feature for codox to have multiple specs :smile_cat:
Sure. Create two profiles:
:profiles
{:codox-cljs {:codox {:language :clojurescript
:sources ["src/client"]
:output-dir "doc/client"}}
:codox-clj {:codox {:language :clojure
:sources ["src/server"]
:output-dir "doc/server"}}}
Then use them with an alias:
:aliases {"doc" ["do" ["with-profile" "codox-cljs" "doc"]
["with-profile" "codox-clj" "doc"]]}
Awesome :)
Thanks a lot :+1:
Good timing! Thanks for the tip, @weavejester.
What about when the output directory should be the same? In my case, I am looking to merge the api documentation of several projects which are under the same namespace.
{:name "incise"
:defaults {:doc/format :markdown}
:sources ["../core/src" "../markdown-parser/src"]
:output-dir "api"
:src-uri "https://github.com/RyanMcG/incise-core"
:src-dir-uri "https://github.com/RyanMcG/incise-core/blob/master/"
:src-linenum-anchor-prefix "L"}
The src uri and dir are different for the various source directories.