hexpm / hex

Package manager for the Erlang ecosystem.
https://hex.pm
961 stars 184 forks source link

`hex.publish` does not respect the docs output folder #1025

Closed pnezis closed 2 months ago

pnezis commented 2 months ago

If you have set a different output folder for the docs in your project config then hex.publish will raise because it expects the docs to be under a doc or docs folder

 def project do
   [
     app: :my_app,
     version: "0.1.0",
     docs: [output: "another_path"]
   ]
 end

I can see two ways to address this:

WDYT? Glad to send a PR.

wojtekmach commented 2 months ago

Good catch. --docs-path would be the most extensible way to go about it. Before doing that though I'm curious if we should go with something easier, i.e. mix hex.publish when publishing docs would look at Mix.Project.config()[:docs][:output] first. WDYT?

pnezis commented 2 months ago

Mix.Project.config()[:docs][:output] was also my first approach and I am fine going with this but:

wojtekmach commented 2 months ago

Good call, imho let's go with --docs-dir then. wdyt @ericmj @supersimple?

ericmj commented 2 months ago

I don't mind having defaults that match ex_doc since that's probably what 99%+ of mix+hex users are using. I think we should start by reading Mix.Project.config()[:docs] and if there is a need for --docs-dir we can add it later.