codox icon indicating copy to clipboard operation
codox copied to clipboard

Multiple codox descriptions

Open BenjaminVanRyseghem opened this issue 11 years ago • 6 comments

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

BenjaminVanRyseghem avatar Nov 14 '14 15:11 BenjaminVanRyseghem

It should be possible to do this with Leiningen profiles.

weavejester avatar Nov 14 '14 16:11 weavejester

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:

BenjaminVanRyseghem avatar Nov 14 '14 16:11 BenjaminVanRyseghem

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

weavejester avatar Nov 14 '14 17:11 weavejester

Awesome :)

Thanks a lot :+1:

BenjaminVanRyseghem avatar Nov 14 '14 17:11 BenjaminVanRyseghem

Good timing! Thanks for the tip, @weavejester.

yurrriq avatar Nov 16 '14 20:11 yurrriq

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.

RyanMcG avatar Dec 29 '14 20:12 RyanMcG