erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

Warn on prompt with instructions if no doc provider is configured #308

Closed starbelly closed 2 years ago

starbelly commented 2 years ago
Screen Shot 2022-04-10 at 5 13 26 PM

This is quite verbose, maybe too verbose, but I figured giving some helpful instructions and being a little noisy is a good way to go here. Especially since this will become an error in 7.1.

Edit:

The only other thing I think we can add is link to docs for rebar3_hex.

max-au commented 2 years ago

I am probably running into some different error. When I run rebar3 hex publish docs in the root of the https://github.com/max-au/erlperf repository, I get this error:

===> Verifying dependencies...
===> docs argument given, will not publish package
===> No documentation provider was configured, docs will not be generated.

(that is rebar3 from the master branch, fresh from the oven).

I don't exactly understand why adding --doc-root=doc fixes the problem. But it does:

rebar3 hex publish docs --doc-dir=doc
===> Verifying dependencies...
===> docs argument given, will not publish package
Local Password:                         
===> Published docs for erlperf 2.0.1   
starbelly commented 2 years ago

@max-au It's the same issue. You are required to configure your doc provider. If you're using edoc then it should be edoc, if rebar3_ex_doc, ...

The reason --doc-dir would work is if you generated your docs using edoc outside of rebar3_hex. --doc-dir to support cases where there is no doc provider (i.e. not using edoc or rebar3_ex_doc).

308 attempts to warn the user ahead of time, in a later version this will become an error.