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

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

Closed
pnezis opened this issue May 15, 2024 · 4 comments · Fixed by #1026
Closed

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

pnezis opened this issue May 15, 2024 · 4 comments · Fixed by #1026

Comments

@pnezis
Copy link
Contributor

pnezis commented May 15, 2024

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:

  • Accept an extra CLI option with the docs path, mix hex.publish --docs-path ....
  • Use the output folder specified in the project's config if set

WDYT? Glad to send a PR.

@wojtekmach
Copy link
Member

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
Copy link
Contributor Author

pnezis commented May 15, 2024

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

  • It introduces more coupling with ex_doc
  • We should handle the case where :docs is a function instead of keyword list

@wojtekmach
Copy link
Member

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

@ericmj
Copy link
Member

ericmj commented May 15, 2024

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.

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

Successfully merging a pull request may close this issue.

3 participants