Skip to content

Update scaladoc docs #12787

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

Merged
merged 3 commits into from
Jun 18, 2021
Merged

Conversation

BarkingBad
Copy link
Contributor

Could you take a look @julienrf? I will update docs.scala-lang New features for Scaladoc chapter after dotty nightly will be published with the docs so I could point them here.

@BarkingBad BarkingBad requested a review from julienrf June 11, 2021 12:06
@julienrf julienrf self-assigned this Jun 11, 2021
@julienrf julienrf requested a review from vincenzobaz June 11, 2021 12:11
@BarkingBad
Copy link
Contributor Author

BarkingBad commented Jun 11, 2021

https://scala3doc.virtuslab.com/pr-version-browser-docs/scala3/docs/usage/scaladoc/changing-versions.html
https://scala3doc.virtuslab.com/pr-version-browser-docs/scala3/docs/usage/scaladoc/settings.html

In case of colourings are wrong check if this action completed OK (it is still running when I'm writing it), but I see they are OK at my local copy

obraz

@vincenzobaz
Copy link
Contributor

I am very excited about this feature, especially for the simplicity of having a JSON with URLs. I was experimenting with Docusaurus which also has a similar mechanism relying on making copies of folders.

From this doc it is not clear to me how we should treat the JSON document. For example, if I reuse your example:

{
  "versions": {
    "3.0.X": "https://dotty.epfl.ch/3.0.X/docs/index.html",
    "Nightly": "https://dotty.epfl.ch/docs/index.html"
  }
}

Does this fille need to be present in both https://dotty.epfl.ch/3.0.X/ and https://dotty.epfl.ch/? In other words, when we generate a new version of the site, do we need to propagate the new JSON to the old folder in order to have the same menu in both sites?

@BarkingBad
Copy link
Contributor Author

Good point, I will elaborate this topic in the docs then. The general idea is that you keep only one JSON file that should be broadly available across the web at given url, let's say http://my.page/my_json.json. Now when you create docs you should pass this url with setting -versions-dictionary-url http://my.page/my_json.json. The docs will do dynamic Ajax call to retireve the json and feed the drop down menu. If you have, for example, 3 different docs they all should have been generated with this setting. This enable you to generate 4th docs and just update JSON file without changing its location. The drawback is that you have to prepare location for JSON file before generating the first docs, but I guess, if you are able host web page, you can as well just drop the json file somewhere top-level at your hosting domain.

@vincenzobaz
Copy link
Contributor

Thank you for clarifying @BarkingBad!
So there is only one JSON at a fixed and known address which is updated when a new version is released.
My first remark is that this address should be written in a single place for each "site" so that it can be easily modified, for example a siteConfig.json (again drawing inspiration from docusaurus), with the -versions-dictionary-url writing to this file.

I already see myself writing regexps to change the URL because something changed in my build 😆

This config file could be the beginning of the customization story of sites: fonts, css paths, vcs links etc

Copy link
Contributor

@vincenzobaz vincenzobaz left a comment

Choose a reason for hiding this comment

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

Thank you for documenting this very useful feature

@BarkingBad
Copy link
Contributor Author

Currently, the link is embedded into HTML head metadata. It should not be that hard to connect it via the intermediate JSON, though we could make convention out of it, and decide that the siteConfig.json can appear at top-level of each documentation respectively and should be read in such case, then we should not pass any setting, just fill in correctly the config json.

Unfortunately I have little time recently (I'm finishing things at the university) so if you'd like to contribute feel free, though I'm not sure that we need all the configuration stuff with css etc., albeit I see your concerns with changing build.

Copy link
Contributor

@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.

Thank you, I agree with Vinenzo’s suggestions and I have added a couple of other remarks.

@julienrf julienrf assigned BarkingBad and unassigned julienrf Jun 14, 2021
@romanowski romanowski assigned julienrf and unassigned julienrf Jun 14, 2021
@BarkingBad
Copy link
Contributor Author

Hi, sorry for absence, I was busy with my university exams. I applied your suggested changes. I hope I covered all the problems and we could merge it.

@BarkingBad BarkingBad force-pushed the scaladoc/version-browser-docs branch from eb004dd to 123b286 Compare June 18, 2021 12:30
Copy link
Contributor

@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.

Thank you @BarkingBad!

@BarkingBad BarkingBad enabled auto-merge June 18, 2021 13:00
@BarkingBad BarkingBad merged commit 515cb9f into scala:master Jun 18, 2021
@Kordyjan Kordyjan added this to the 3.0.2 milestone Aug 2, 2023
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.

4 participants