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

Fix markdown links to multi-version CRDs #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

antonincms
Copy link

Implementation

This PR fixes links to multi-version CRDs by adding a reference to the version in the anchor and the link.

Approach

I considered implementing links in pure Markdown, like #### v1.Embedded1, but preferred to use HTML links instead, like #### <a id="github-com-elastic-crd-ref-docs-api-v1-embedded1">Embedded1</a>. This approach is closer to what is done in Asciidoc and the final result seems more readable to me (especially in multigroup APIs where it would look like #### mygroupname-v2alpha1.Embedded1). I guess supporting both methods could be an option, but it would require two functions to render links, and users would need to know how to adjust their templating accordingly.

This change will also break existing links in custom Markdown templates, as it now uses GroupVersionID to link to resources. To fix this, replace ## {{ $gv.GroupVersionString }} in gv_details.tpl with ## <a id="{{ markdownGroupVersionID $gv | markdownSafeID }}">{{ $gv.GroupVersionString }}</a>.
I could not find a way to implement this change in a backward-compatible manner for users having custom markdown templating.

Fixes #60

This change will break existing links in custom Markdown templates, as it now uses GroupVersionID to link to resources.
To fix this, replace `## {{ $gv.GroupVersionString }}` in gv_details.tpl with `## <a id="{{ markdownGroupVersionID $gv | markdownSafeID }}">{{ $gv.GroupVersionString }}</a>`.
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
33543b4

Please, read and sign the above mentioned agreement if you want to contribute to this project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Incorrect links to multi-version CRDs
1 participant