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

Scaladoc features parity with old scaladoc/docs.scala-lang #13954

Merged
merged 15 commits into from Nov 30, 2021

Conversation

BarkingBad
Copy link
Member

@BarkingBad BarkingBad commented Nov 15, 2021

This PR adds:

  • redirects for removed pages
  • arrows for easier reading static site (move to previous/next page)
  • contributors listing for static site docs
  • add Edit on github widget

I will update the docs with links/screens once CI will deploy the demo version

Copy link
Collaborator

@julienrf julienrf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting work, thank you @BarkingBad! However, it would be definitely easier to review these changes feature by feature instead of having a single PR with everything in it.

scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala Outdated Show resolved Hide resolved
docs/_layouts/main.html Show resolved Hide resolved
scaladoc/src/dotty/tools/scaladoc/renderers/Renderer.scala Outdated Show resolved Hide resolved
scaladoc/src/dotty/tools/scaladoc/renderers/Renderer.scala Outdated Show resolved Hide resolved
mainFiles.flatMap { loadedTemplate =>
loadedTemplate.templateFile.settings.getOrElse("page", Map.empty).asInstanceOf[Map[String, Object]].get("redirectFrom").map { case redirectFrom: String =>
val fakeFile = new File(docsPath.toFile, redirectFrom)
val redirectTo = fakeFile.toPath.getParent.relativize(loadedTemplate.file.toPath).toString.stripSuffix(".md") + ".html"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean that we can’t redirect from a directory, like e.g. /foo/bar/?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed that we can redirect from html but cat change that, though I would need some test cases which paths should be valid

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the diff, I can’t tell whether this discussion is resolved or not. What’s its status? I recommend adding more tests.

@BarkingBad
Copy link
Member Author

@BarkingBad
Copy link
Member Author

obraz

Arrows and contributors list

@BarkingBad
Copy link
Member Author

https://scala3doc.virtuslab.com/pr-new-frame-poc/scala3/docs/reference/other-new-features/named-typeargs.html

Automatic redirect to experimentals subscetion since it was moved

@BarkingBad BarkingBad force-pushed the scaladoc/new-frame-poc branch 2 times, most recently from 09c4690 to 150448c Compare November 29, 2021 09:47
@BarkingBad BarkingBad marked this pull request as ready for review November 29, 2021 09:47
project/Build.scala Outdated Show resolved Hide resolved
project/Build.scala Outdated Show resolved Hide resolved
project/Build.scala Show resolved Hide resolved
project/CopyDocs.scala Show resolved Hide resolved
scaladoc-js/common/resources/code-snippets.css Outdated Show resolved Hide resolved
scaladoc-js/src/Main.scala Show resolved Hide resolved
@julienrf julienrf removed their assignment Nov 29, 2021
@BarkingBad BarkingBad force-pushed the scaladoc/new-frame-poc branch 2 times, most recently from 2cfbd52 to 28d15ca Compare November 29, 2021 16:52
@BarkingBad
Copy link
Member Author

I think I addressed all of your concerns @julienrf, could you take a look?

Copy link
Collaborator

@julienrf julienrf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good to me!

Please squash your commits before merging the PR.

@BarkingBad BarkingBad merged commit f6b6e50 into scala:master Nov 30, 2021
olsdavis pushed a commit to olsdavis/dotty that referenced this pull request Apr 4, 2022
* POC

* Walk in order and collect previous/next

* Add `Edit on Github` button and `Contriubuted` sections

* Polish gathering the contributors. CSSes fixes.

* Fix tooltipping snippets

* Fix handling relative links for static site

* Add redirects mechanism for scaladoc

* Fix leftover

* Fix tests

* Fix gathering index html for sections without explicit index

* Apply requested changes to scaladoc

* Decouple Scala.js jses. Move contributors to be independent asset/

* Add support for multiple redirects

* Apply requested changes. Add static site for testcases. Fix minor bugs in scaladoc.

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

Successfully merging this pull request may close these issues.

None yet

2 participants