Skip to content

Conversation

@josh-wong
Copy link
Member

Description

This PR adds a feature that dynamically generates links to versioned Javadocs based on the version of the docs that the visitor is viewing. By implementing this feature, we can:

  • Move away from providing a generic link to our Javadocs, saving visitors time in finding our Java API class names.
  • Avoid adding links that include a specific version of a Javadoc link that must be updated when a new patch version is released.

Note

After implementing this feature, we'll need to use the following syntax to add links to Javadocs:

<JavadocLink packageName="<PACKAGE_NAME>" path="<PATH>" className="<CLASS_NAME>" />

The syntax for the Javadoc link above is as follows:

https://javadoc.io/static/com.scalar-labs/<PACKAGE_NAME>/3.10.0/<PATH>/<CLASS_NAME>.html

Related issues and/or PRs

N/A

Changes made

  • Created the JavadocLink component for generating the link based on the package name and class name.
  • Added className (a native field in Docusaurus) to the versions section of docusaurus.config.js. The className should be the latest version (major.minor.patch) version for that major.minor version.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have updated the side navigation as necessary.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

@josh-wong josh-wong added the enhancement New feature or request label Dec 26, 2024
@josh-wong josh-wong self-assigned this Dec 26, 2024
@josh-wong josh-wong merged commit d2075be into main Dec 26, 2024
1 check passed
@josh-wong josh-wong deleted the add-javadoc-dynamic-linking-feature branch December 26, 2024 08:09
josh-wong added a commit that referenced this pull request May 14, 2025
#817)

* Create JavadocLink.js

* Add `className` to versions for JavadocLink use

* Add instruction in comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant