Skip to content

Conversation

theletterf
Copy link
Contributor

This PR adds crosslinks as accepted item types in docset.yml toc directives.

For example:

toc:
  - file: index.md
  - title: External Documentation
    crosslink: docs-content://directory/file.md

@theletterf theletterf self-assigned this Jul 25, 2025
@theletterf theletterf requested a review from a team as a code owner July 25, 2025 23:54
@theletterf theletterf requested a review from a team as a code owner July 25, 2025 23:54
@theletterf theletterf requested a review from Mpdreamz July 25, 2025 23:54
Copy link

github-actions bot commented Jul 25, 2025

🔍 Preview links for changed docs

@theletterf
Copy link
Contributor Author

@Mpdreamz @bmorelli25 Wanted to give this one a try. Seems to work (check the Testing section, last two items).

If the code is ugly, please feel free to salvage whatever looks useful in this PR, or commit directly.

@theletterf theletterf requested a review from Mpdreamz July 28, 2025 17:45
@theletterf
Copy link
Contributor Author

@Mpdreamz Anything missing for this one? Minus the remaining comment.

@Mpdreamz
Copy link
Member

Mpdreamz commented Aug 8, 2025

Not sure @theletterf, I need some time to get to this PR still :)

@theletterf
Copy link
Contributor Author

No probs!

@theletterf
Copy link
Contributor Author

@Mpdreamz Seems like I broke link resolution with the last commit. Checking.

@theletterf theletterf requested a review from Mpdreamz August 22, 2025 10:12
@Mpdreamz
Copy link
Member

This PR is finally failing like I was expecting it too :)

https://github.com/elastic/docs-builder/actions/runs/17245378751/job/48933555065?pr=1615#step:5:154

The sitemap builder does not yet know about the new CrosslinkReference type, will amend the PR.

Mpdreamz and others added 3 commits August 26, 2025 19:44
…slinks (#1784)

* Remove `Fetch` from CrossLinkResolver, enforce eager fetching of crosslinks.

This removes a hidden requirement on `DocumentationSet` that its resolver is not usable until `DocumentationGenerator.GenerateAll()` has been called.

We now enforce `DocumentationSet` receives a `ICrossLinkResolver` that is ready to resolve crosslinks.

* Found more cases of unhandled navigation types

* Remove new caching behavior in DocSetConfigurationCrossLinkFetcher
Copy link
Member

@Mpdreamz Mpdreamz left a comment

Choose a reason for hiding this comment

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

LGTM but want @cotti to review as well since I did a bunch of changes here as well.

Copy link
Contributor

@cotti cotti left a comment

Choose a reason for hiding this comment

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

👍

@theletterf
Copy link
Contributor Author

Excitedly jumps around

Time to merge? :)

@KOTungseth
Copy link
Contributor

KOTungseth commented Sep 4, 2025

Before you merge, I have questions:

  • Where are we merging this change? Staging or Production? While this change may seem small, it has the potential to create a ripple of problems when used incorrectly. We would benefit from merging to only Staging and testing before we make it live in Production.
  • Do we want to merge this change in our public-facing docs, or would it be better suited behind a log in where users can personalize their Docs experience? My vision for this type of functionality was always to live behind the Cloud account log in.
  • Do we have docs that explain this functionality?
  • Where did the requirement for this functionality come from?

@theletterf
Copy link
Contributor Author

theletterf commented Sep 5, 2025

@KOTungseth The way this is being implemented is to allow crosslinks in the nav. In that sense, a doc will only exist once and in one repo only, but we'll be able to link to it from other navs.

Answering your questions:

Use of crosslinks might be unnecessary if @georgewallace's proposal for a unified nav UI prospers, but that might take a while. In the meantime, the need to solve some immediate navigation pains seems to exist.

@theletterf
Copy link
Contributor Author

@Mpdreamz Could you comment with @KOTungseth? Can we move ahead?

@yetanothertw
Copy link
Contributor

👋 just adding another use-case for this feature:

The way this is being implemented is to allow crosslinks in the nav. In that sense, a doc will only exist once and in one repo only, but we'll be able to link to it from other navs.

I'm looking forward to this PR being merged as it will help with closing #2738 and #2218, and avoid duplicated pages and drifting info.

@shainaraskas
Copy link
Contributor

@KOTungseth I view this as another tool in our toolbox to solve some of our visibility issues in a lightweight way. agree that we shouldn't use it everywhere all the time, but I would like to see it merged.

@KOTungseth
Copy link
Contributor

Approved ✅

@Mpdreamz Mpdreamz merged commit 5bccabc into main Sep 9, 2025
19 checks passed
@Mpdreamz Mpdreamz deleted the crosslinks-in-toc-take-three branch September 9, 2025 08:14
@Mpdreamz
Copy link
Member

Mpdreamz commented Sep 9, 2025

@theletterf 🙏 thanks for this big contribution and bearing with us! 😸

Please wait for a release with this change to production before actually using the feature, will ping when its on production.

Let's also trial 1/2 crosslinks in the navigation before going all in.

@theletterf
Copy link
Contributor Author

@Mpdreamz Sounds good — thank you! Will start a small test after you give me green light to go ahead. :)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants