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

[Feature] External docset links #145

Open
Mpdreamz opened this issue Jan 7, 2025 · 3 comments
Open

[Feature] External docset links #145

Mpdreamz opened this issue Jan 7, 2025 · 3 comments
Assignees
Labels
authoring Relates to our markdown parser automation packaging, ci/cd.

Comments

@Mpdreamz
Copy link
Member

Mpdreamz commented Jan 7, 2025

Right now docsbuilder only validates:

  • internal links to the docset itself
    • relative, full paths supported
    • includes deep link (anchor) validation
  • external URI links
    • follows an opt-in mechanism to allow list hosts so we don't link to unknown places from PR's.

What we don't support is linking to other people's docset's.

We don't want documentation authors to create links such as:

[read about elasticsearch here](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html)

This will require crawling and live link validation which comes with its own set of challenges but most importantly won't be fast.

Instead the syntax we would be after is:

[read about elasticsearch here](es:/index.md)

Where es is a prefix moniker that gets declared in docset.yml

external_docsets:
  es: elastic/elasticsearch

As part of each build today we publish a links.json file.

By opting in explicitly we can pull these links map down at build down to validate a single docsets outbound links ahead of time.

To that end we need to extend our GitHub action to be able to publish these to a known guessable folder scheme to S3 and expose them under a nice URL through CloudFront so docs-builder can download them.

We need some form of caching e.g if the url ends up being:

/links/elasticsearch/main/links.json

We don't want to pull it down every time.

@Mpdreamz Mpdreamz added authoring Relates to our markdown parser automation packaging, ci/cd. labels Jan 7, 2025
@Mpdreamz
Copy link
Member Author

Mpdreamz commented Jan 7, 2025

Dev note the links will be easy to parse with Uri.TryCreate:

if (Uri.TryCreate("es:/somepath/asdasd/index.md", UriKind.Absolute, out var uri)) {
	Console.WriteLine(uri.AbsolutePath);
	Console.WriteLine(uri.Scheme);
}

will yield:

/somepath/asdasd/index.md
es

@bmorelli25
Copy link
Member

bmorelli25 commented Jan 7, 2025

With the migration to docs-builder, we will move away from product documentation books and towards more goal-focussed documentation sets (docsets). Here are the new docsets and a starting point for what their prefixes could be:

  • Elastic basics (basics:)
  • Solutions and use cases (solutions:)
  • Manage data (manage:)
  • Explore and analyze (explore:)
  • Deploy and manage (deploy:)
  • Manage your Cloud account (cloud:)
  • Troubleshoot (troubleshoot:)
  • Extend (extend:)
  • What's new (new:)
  • APIs and reference (ref:)

In addition, a dir and docset.yml file now exists in https://github.com/elastic/docs-content for each of these docsets.

@reakaleek
Copy link
Member

Please take a look at my RFC and let's continue our discussion there!

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authoring Relates to our markdown parser automation packaging, ci/cd.
Projects
None yet
Development

No branches or pull requests

3 participants