Skip to content

[improve][doc] Improve the links to reference docs with versions and anchors#459

Merged
momo-jun merged 6 commits intoapache:mainfrom
momo-jun:Improve-ref-site-link
Mar 9, 2023
Merged

[improve][doc] Improve the links to reference docs with versions and anchors#459
momo-jun merged 6 commits intoapache:mainfrom
momo-jun:Improve-ref-site-link

Conversation

@momo-jun
Copy link
Contributor

@momo-jun momo-jun commented Mar 7, 2023

Fixes apache/pulsar#19676.

This improvement is enabled by #456 and only applies to 2.8.x docs and later versions that are actively maintained.

Modifications

  1. replace the existing links https://pulsar.apache.org/tools/ with pathname:///reference/
    • apply to more occurrences containing https://pulsar.apache.org/, like: /download/, /api/admin/, /swagger/ and /admin-rest-api/....
  2. add a version variable @pulsar:version_origin@ to version-specific links to redirect with the expected doc version.
  3. add a query string to each link pointing to a specific command with an anchored position.
  4. minor fixes, such as removing the extra /docs/next/ from several links.

Note that @pulsar:version_origin@ is the variable used as doc version numbers of the reference doc site.
//cc @Anonymitaet @DaveDuggins

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@github-actions github-actions bot added the doc Improvements or additions to documentation label Mar 7, 2023
@momo-jun momo-jun self-assigned this Mar 7, 2023
This page only shows **some frequently used operations**.

- For the latest and complete information about `Pulsar admin`, including commands, flags, descriptions, and more information, see [Pulsar admin doc](/tools/pulsar-admin/).
- For the latest and complete information about `Pulsar admin`, including commands, flags, descriptions, and more information, see [Pulsar admin doc](https://pulsar.apache.org/reference/#/@pulsar:version_origin@/pulsar-admin/).
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest use /reference/... or pathname:///reference so that we can locally debug (instead of always link to the online version).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did you mean that we can directly use pathname:// to replace the domain prefix https://pulsar.apache.org for all these occurrences?

Copy link
Member

Choose a reason for hiding this comment

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

Yes.

Copy link
Contributor Author

@momo-jun momo-jun Mar 7, 2023

Choose a reason for hiding this comment

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

Good to know that. I can update them as long as the logic is stable:) Does it also apply to REST API links like https://pulsar.apache.org/admin-rest-api/?version=@pulsar:version_number@?
And do you know whether the built-in link checker can cover broken internal links like this?

Copy link
Member

Choose a reason for hiding this comment

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

Does it also apply to REST API links

Yes.

whether the built-in link checker can cover broken internal links like this

I don't know. One case is that we may not bundle all static files, so it can produce false positives. But IIRC we bundle all recent versions.

Copy link
Member

Choose a reason for hiding this comment

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

Said that for references, we bundle all pages: https://github.com/apache/pulsar-site/tree/main/static/reference

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've applied this change to more occurrences containing https://pulsar.apache.org/, such as /download/, /api/admin/, /swagger/ and /admin-rest-api/.

@momo-jun momo-jun requested a review from tisonkun March 8, 2023 07:30
docs/about.md Outdated
Comment on lines 29 to 32
<BlockLink title="Get Started" url="/docs/next/getting-started-home" />
<BlockLink title="Install, Deploy, Upgrade" url="/docs/next/install-deploy-upgrade-landing" />
<BlockLink title="Pulsar for Developers" url="/docs/next/developers-landing" />
<BlockLink title="How To" url="/docs/next/how-to-landing" />
Copy link
Member

Choose a reason for hiding this comment

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

Shall we apply the relative path for these tags consistently also?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right! Thanks for finding out more occurrences that I missed.

@momo-jun momo-jun merged commit 837303d into apache:main Mar 9, 2023
@Anonymitaet Anonymitaet added this to the 3.0.0 milestone Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Doc] Use the reference site (replacing tools) with versioned links

4 participants