[Feat] Automatically link glossary entries#106
Conversation
✅ Deploy Preview for gardenlinux-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
1b9afe9 to
9298e07
Compare
9298e07 to
19692aa
Compare
Signed-off-by: Tiara Lena Hock <hock@b1-systems.de> On-behalf-of: SAP <tiara.hock@sap.com>
c79122f to
3fbd693
Compare
Signed-off-by: Tiara Lena Hock <hock@b1-systems.de> On-behalf-of: SAP <tiara.hock@sap.com>
3fbd693 to
783fc3e
Compare
yeoldegrove
left a comment
There was a problem hiding this comment.
In general, I would like this search/replace to not run on the make aggregate(-|) steps but only on the make build steps to not leave unstaged files in git.
| ::: details Developer Information | ||
| The auto glossary system is designed to accept a new custom `entry_format` through which | ||
| the shortcode `{glossary:*}` can be replaced with a new custom pattern. | ||
|
|
||
| Check the source code for more information. | ||
| ::: |
There was a problem hiding this comment.
I like that we hide this behind a developer block as I guess "nobody will use this feature". It's good to have it, though.
| ## Auto-Linking | ||
|
|
||
|
|
||
|
|
||
| Auto-linking creates links for glossary terms without requiring explicit markers. This feature is disabled by default. | ||
|
|
||
| With auto-linking enabled, input text: | ||
|
|
||
| ``` | ||
| Deploy Gardenlinux on AWS using KVM virtualization. | ||
| ``` | ||
|
|
||
| Becomes: | ||
|
|
||
| ```markdown | ||
| Deploy [Garden Linux](/reference/glossary#garden-linux) on [AWS](/reference/glossary#aws) using [KVM](/reference/glossary#kvm) virtualization. | ||
| ``` | ||
|
|
||
| Auto-linking rules: | ||
| - Links only the first occurrence of each term | ||
| - Matches longer terms first (`Garden Linux` before `Linux`) | ||
| - Case-insensitive matching | ||
| - Respects word boundaries | ||
| - Preserves code blocks and inline code | ||
| - Does not modify existing links | ||
|
|
||
| ::: warning | ||
| This feature is disabled by default as it is highly experimental and intended for research work only. | ||
|
|
||
| **Contributors must not rely on this feature when contributing documentation.** | ||
| ::: |
There was a problem hiding this comment.
Could you remove this and also the feature until it is ready? It adds a lot of new code and in it's current state it is not very helpful.
I like the feature, though and would be happy if we get this included if it works properly.
| Process glossary links manually: | ||
|
|
||
| ```bash | ||
| make glossary |
There was a problem hiding this comment.
This does not work for me currently. No files are touched.
What this PR does / why we need it:
This PR adds a new feature to allow users to quickly link a given abbreviation or name to a glossary entry.
This will look like this in any given text:
This shorthand will then be replaced into a clickable link automatically during aggregation or by running
make glossary.In addition, this PR fixes a bunch of formatting and linting issues throughout the codebase, strengthens our linters by minor configuration changes and introduces a new testsuite for this feature.
Preliminary usage documentation can be found in the deploy preview: https://deploy-preview-106--gardenlinux-docs.netlify.app/contributing/documentation/auto-glossary.html
Which issue(s) this PR fixes:
Fixes: gardenlinux/gardenlinux#4637
Definition of Done:
main)Special notes for your reviewer:
Release note: