eui icon indicating copy to clipboard operation
eui copied to clipboard

[Docs] Investigate Markdown link replacement

Open weronikaolejniczak opened this issue 8 months ago • 1 comments

[!WARNING] We should investigate this just before releasing M1. We can potentially move it to M2 if it turns out to be a big task.

The purpose of this spike is to investigate Markdown link replacement by Docusaurus and come up with possible solutions.


Currently, we use both URL and file paths in Markdown links. The Markdown loader will convert the file path to the target file's URL path. If the path cannot be resolved, it triggers a warning (as defined in docusaurus.config.ts). The link gets replaced with an anchor tag. Other Markdown links get wrapped with a swizzled MDXContent.A component (which in our case is an EuiLink component). Both types of links have different styles.

We have decided to use relative file paths to reap the benefits:

  • Links will keep working on the GitHub interface and many Markdown editors
  • You can customize the files' slugs without having to update all the links
  • Moving files around the folders can be tracked by your editor, and some editors may automatically update file links
  • A versioned doc will link to another doc of the exact same version
  • Relative URL links are very likely to break if you update the trailingSlash config

Source: Markdown links | Docusaurus

After https://github.com/elastic/eui/issues/8158 has been concluded the majority of links will use relative file paths except for external links which should use Link component directly (it adds target="_blank" rel="noopener noreferrer" automatically). None of the links will use our EuiLink.


Additionally, all links in the Homepage are not reported broken. We should either make them use Docusaurus Link component or useBrokenLinks hook.

Sometimes, we bold Eui* links (comment), most of the time we don't. We need to decide on a consistent way and if possible apply it globally, without the need for local ** syntax each time we deal with EUI components.

weronikaolejniczak avatar Mar 27 '25 15:03 weronikaolejniczak

👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

github-actions[bot] avatar Oct 27 '25 16:10 github-actions[bot]

Closing this because I don't think we're going to be planning it any time soon. It'll still be here in our repository if we decide to reconsider and open it back up in the future. But for now it'll be closed.

JasonStoltz avatar Dec 15 '25 21:12 JasonStoltz