Skip to content

Doctool: Extra "api" directory under target #11412

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

Closed
eed3si9n opened this issue Feb 14, 2021 · 12 comments
Closed

Doctool: Extra "api" directory under target #11412

eed3si9n opened this issue Feb 14, 2021 · 12 comments

Comments

@eed3si9n
Copy link
Member

eed3si9n commented Feb 14, 2021

Compiler version

3.0.0-M4-bin-20210212-0273336-NIGHTLY

Minimized code

package foo

final val foo = "Foo"

object A:
  /**
   * @param i An argument
   */
  def x(i:Int)=3

Then run doc from sbt 1.5.0-M2.

Output

It creates target/scala-3.0.0-M4/api/api directory.
For example target/scala-3.0.0-M4/api/api/foo/A$.html.

Expectation

I expect HTML files to be under target/scala-3.0.0-M4/api/ directory. Note that the term api is set by sbt as Compile/doc/target.

See the output of Scala 2.x's output - https://scopt.github.io/scopt/4.0.0/api/index.html

Directly under api/ it would create directory names corresponding to the package like scopt, and https://scopt.github.io/scopt/4.0.0/api/scopt/index.html would list the classes under scopt package.

@eed3si9n eed3si9n changed the title Doctool: Extra "api" directory under target Doctool: Missing top-level index.html Feb 14, 2021
@eed3si9n eed3si9n changed the title Doctool: Missing top-level index.html Doctool: Extra "api" directory under target Feb 14, 2021
@eed3si9n
Copy link
Member Author

cc @romanowski, @pikinier20

@pikinier20
Copy link
Contributor

@romanowski Maybe we should adjust our directory structure to match old scaladoc. If that is the case, we should move our resources inside lib/ folder and move documentation to root folder. I only wonder what to do in case when there's lib package in project because it leads to name conflict.

@eed3si9n
Copy link
Member Author

Maybe you could use a reserve word like object/.

@abgruszecki
Copy link
Contributor

@eed3si9n can you clarify what exactly is the problem with having two api directories?

@eed3si9n
Copy link
Member Author

Scaladoc is meant to be published to the web. Whenever possible we should maintain the backward compatibility of the URL since these pages are often linked from Stackoverflow or documentations.

@abgruszecki
Copy link
Contributor

@romanowski what's our current position on full backwards link compat with old Scaladoc?

@SethTisue
Copy link
Member

did #13130 affect this?

@BarkingBad
Copy link
Contributor

I guess #13130 should have "fixed" the issue (I can confirm that and close it tomorrow). At least as long as someone doesn't run the scaladoc with -Yapi-subdirectory setting toggled on.

@BarkingBad
Copy link
Contributor

I just checked it and indeed, the default behaviour now is to skip the api subdirectory, unless someone provides -Yapi-subdirectory flag, so I guess the issue is resolved. On the other hand, you demand to have index.html listing members of the package. Currently, if you have package foo.bar the listing will be under foo/bar.html. I don't know if we should change it.

@pikinier20
Copy link
Contributor

@BarkingBad Is this issue up-to-date?

@Dedelweiss
Copy link
Contributor

Dedelweiss commented Jul 17, 2023

Hello, as far as I can see from my test, the issue seems to have been corrected.

Input:

Screenshot 2023-07-17 at 11 58 56

Result:

Screenshot 2023-07-17 at 11 59 12 Screenshot 2023-07-17 at 12 04 41

@julienrf
Copy link
Contributor

Thank you for the investigation @Dedelweiss! I am closing the issue.

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

No branches or pull requests

7 participants