|
1 |
| -# Linking to a glossary entry |
| 1 | +# Linking to Glossary Terms |
2 | 2 |
|
3 |
| -## Basic |
| 3 | +## Basic Usage |
4 | 4 |
|
5 |
| -Link to this glossary definition using the following |
6 |
| -syntax. This will produce a link to the definition in your documentation: |
| 5 | +To link to a glossary term, use the following syntax: |
7 | 6 |
|
8 |
| -``` markdown |
9 |
| -- See the <section:term> for details |
| 7 | +```markdown |
| 8 | +See the <section:term> for more details |
10 | 9 | ```
|
11 | 10 |
|
12 |
| -!!! Example |
| 11 | +This creates a link to the term's definition in your documentation. |
13 | 12 |
|
14 |
| - Link to the previously defined `glossary` term in the `term` section: |
| 13 | +!!! Example |
15 | 14 |
|
16 |
| - ``` markdown |
17 |
| - - See the <demo:my_term1> for definition of term 1 |
18 |
| - - See the <demo:my term 2> for definition of term 2 |
| 15 | + ```markdown |
| 16 | + See the <demo:my_term1> for definition of term 1 |
| 17 | + See the <demo:my term 2> for definition of term 2 |
19 | 18 | ```
|
20 | 19 |
|
21 |
| - - See the <demo:my_term1> for definition of term 1 |
22 |
| - - See the <demo:my term 2> for definition of term 1 |
| 20 | + Output: |
| 21 | + - See the <demo:my_term1> for definition of term 1 |
| 22 | + - See the <demo:my term 2> for definition of term 2 |
23 | 23 |
|
24 |
| -## Case sensitivity |
25 |
| -> starting from version `1.7.0` [beta] |
| 24 | +## Case Sensitivity |
| 25 | +> Available since version 1.7.0 |
26 | 26 |
|
27 |
| -By default, this term definitions and references are case-sensitive, i.e. you need to use |
28 |
| -the exact spelling in your links as used in your term definition. |
| 27 | +By default, term definitions and references are case-sensitive. You must use |
| 28 | +the exact spelling in your links as used in the term definition. |
29 | 29 |
|
30 |
| -By setting <configuration:ignore_case> to `true`, the plugin will ignore the case in order |
31 |
| -to find definitions for your links. |
| 30 | +To enable case-insensitive matching, set `ignore_case` to `true`: |
32 | 31 |
|
33 |
| -!!! Example |
| 32 | +```yaml |
| 33 | +plugins: |
| 34 | + ezglossary: |
| 35 | + ignore_case: true |
| 36 | +``` |
34 | 37 |
|
35 |
| - ``` yaml |
36 |
| - plugins: |
37 |
| - search |
38 |
| - ezglossary: |
39 |
| - ignore_case: true |
| 38 | +!!! Example |
| 39 | + With `ignore_case: true`, all these links point to the same term: |
| 40 | + ```markdown |
| 41 | + - <demo:my_term> |
| 42 | + - <demo:My_Term> |
| 43 | + - <demo:MY_TERM> |
40 | 44 | ```
|
41 | 45 |
|
42 |
| - - See the <demo:MY_term1> for definition of term 1 |
| 46 | +## Custom Link Text |
43 | 47 |
|
44 |
| -## Individual reference texts |
| 48 | +By default, the term itself is used as the link text. You can override this |
| 49 | +using the `|` modifier: |
45 | 50 |
|
46 |
| -By default the <term:term> is used as text for the link, however, |
47 |
| -you can override the term using the `|` modifier: |
| 51 | +```markdown |
| 52 | +See our <term:section|glossary sections> documentation |
| 53 | +``` |
48 | 54 |
|
49 | 55 | !!! Example
|
50 |
| - |
51 |
| - ``` markdown |
52 |
| - - You can define multiple <term:section|glossary sections> |
| 56 | + ```markdown |
| 57 | + Learn about <demo:my_term1|our first concept> |
53 | 58 | ```
|
54 | 59 |
|
55 |
| - - You can define multiple <term:section|glossary sections> |
| 60 | + Output: |
| 61 | + - Learn about <demo:my_term1|our first concept> |
56 | 62 |
|
57 | 63 | !!! Note
|
58 |
| - |
59 |
| - When using a link with individual reference texts in a table, |
60 |
| - you need to quote the `|`. |
61 |
| - |
62 |
| - ``` markdown |
63 |
| - | row1 | row2 | |
64 |
| - |-----------------------------------|------| |
65 |
| - | <term:section\|glossary sections> | ... | |
| 64 | + When using custom link text in tables, escape the `|` character: |
| 65 | + ```markdown |
| 66 | + | Description | Reference | |
| 67 | + |------------|-----------| |
| 68 | + | First term | <demo:first_term\|see details> | |
66 | 69 | ```
|
67 | 70 |
|
68 |
| -## Handling plurals |
69 |
| -> starting from version `1.7.0a2` (not stable released yet) |
| 71 | +## Handling Plurals |
| 72 | +> Available since version 1.7.0 |
70 | 73 |
|
71 |
| -A most common problem when linking to glossary terms is that you want to use |
72 |
| -the plural form of the word in the link text while linking to the term in singular. |
| 74 | +The plugin can automatically match plural forms to their singular definitions. |
| 75 | +This is useful when you want to use the plural form in your text while linking |
| 76 | +to the singular definition. |
73 | 77 |
|
74 | 78 | !!! Example
|
75 |
| - |
76 | 79 | Definition:
|
77 |
| - |
78 |
| - ``` markdown |
| 80 | + ```markdown |
79 | 81 | GPU
|
80 |
| - : A GPU is a .... |
| 82 | + : A Graphics Processing Unit is... |
81 | 83 | ```
|
82 | 84 |
|
83 |
| - Linking: |
84 |
| - |
85 |
| - ``` markdown |
86 |
| - Many <term:GPUs> support ... |
| 85 | + Usage: |
| 86 | + ```markdown |
| 87 | + Many <term:GPUs> support parallel processing |
87 | 88 | ```
|
88 | 89 |
|
89 |
| -!!! Note |
90 |
| - |
91 |
| - At this point of time, plural lookup is only available for the english language. |
| 90 | +### Supported Languages |
92 | 91 |
|
93 |
| - However, future versions may support additional langugaes (with your help). Furthermore |
94 |
| - a feature is planned to allow you to define your own rules for the lookup. |
| 92 | +Plural handling is available for: |
| 93 | +- English (en) |
| 94 | +- Spanish (es) |
| 95 | +- French (fr) |
| 96 | +- German (de) |
95 | 97 |
|
96 |
| -### Lookup using the inflect library |
| 98 | +Enable plural handling in your configuration: |
97 | 99 |
|
98 |
| -The [inflect library](https://github.com/jaraco/inflect) supports converting plurals to singulars, |
99 |
| -it has some advantages and drawbacks. If you want to use this library to convert plurals to singulars, |
100 |
| -you can add the following entry to the configuration: |
101 |
| - |
102 |
| -``` yaml |
| 100 | +```yaml |
103 | 101 | plugins:
|
104 |
| - search |
105 | 102 | ezglossary:
|
106 |
| - plurals: inflect |
| 103 | + plurals: en # Use 'en', 'es', 'fr', or 'de' |
107 | 104 | ```
|
108 | 105 |
|
109 |
| -### Looking up using the plugin's logic |
| 106 | +### Plural Lookup Methods |
110 | 107 |
|
111 |
| -This plugin has an own implementation logic to lookup singulars, which might not be perfect as well, |
112 |
| -but might catch some edge cases which the inflect library does not catch. |
| 108 | +#### Using the inflect Library |
113 | 109 |
|
114 |
| -Try the own implementation by adding this configuration entry: |
| 110 | +The [inflect library](https://github.com/jaraco/inflect) provides robust plural-to-singular |
| 111 | +conversion for English terms: |
115 | 112 |
|
116 |
| -``` yaml |
| 113 | +```yaml |
117 | 114 | plugins:
|
118 |
| - search |
119 | 115 | ezglossary:
|
120 |
| - plurals: en |
| 116 | + plurals: inflect |
121 | 117 | ```
|
122 | 118 |
|
123 |
| -## Using markdown links |
124 |
| -> starting from version `1.6.0` |
125 |
| - |
126 |
| -When setting the <configuration:markdown_links> to `true`, |
127 |
| -ezglossary will also search for markdown links. If it identifies that |
128 |
| -a link points to a glossary entry, it will link it as well: |
129 |
| - |
130 |
| -!!! Note |
131 |
| - |
132 |
| - When using unicode characters in term definitions, linking them |
133 |
| - using the `<section:term>` syntax might not work. In this case |
134 |
| - you have to use markdown links in order to link to those terms. |
135 |
| - |
136 |
| -!!! Note |
| 119 | +#### Using Built-in Rules |
137 | 120 |
|
138 |
| - In case your definition contains emojis, linking them using |
139 |
| - the `<section:term>` syntax will not work as well. In this case |
140 |
| - you have to use markdown links. |
| 121 | +The plugin includes basic plural rules for supported languages: |
141 | 122 |
|
142 |
| - !!! Example |
| 123 | +```yaml |
| 124 | +plugins: |
| 125 | + ezglossary: |
| 126 | + plurals: en # or 'es', 'fr', 'de' |
| 127 | +``` |
143 | 128 |
|
144 |
| - ``` markdown |
145 |
| - my happy term :smile: |
146 |
| - : I am so happy |
| 129 | +## Using Markdown Links |
| 130 | +> Available since version 1.6.0 |
147 | 131 |
|
148 |
| - - See [](my happy term) |
149 |
| - ``` |
| 132 | +When <configuration:markdown_links> is enabled, the plugin also processes standard Markdown links: |
150 | 133 |
|
151 |
| -``` yaml |
| 134 | +```yaml |
152 | 135 | plugins:
|
153 |
| - search |
154 | 136 | ezglossary:
|
155 |
| - markdown_links: true |
| 137 | + markdown_links: true |
156 | 138 | ```
|
157 | 139 |
|
158 |
| -!!! Example |
| 140 | +This is especially useful for: |
| 141 | +- Terms containing Unicode characters |
| 142 | +- Terms with emojis |
| 143 | +- Integration with other Markdown tools |
159 | 144 |
|
160 |
| - ``` markdown |
161 |
| - - See [](configuration:tooltip) for details |
162 |
| - - See [tooltips](configuration:tooltip) for details |
| 145 | +!!! Example |
| 146 | + ```markdown |
| 147 | + - See [](configuration:tooltip) for details |
| 148 | + - See [tooltips](configuration:tooltip) for details |
163 | 149 | ```
|
164 | 150 |
|
165 |
| - !!! Output |
166 |
| - |
167 |
| - - See [](configuration:tooltip) for details |
168 |
| - - See [tooltips](configuration:tooltip) for details |
169 |
| - |
170 |
| - |
171 |
| -configuration:markdown_links |
172 |
| -: Defines wether ezglossary should also link markdown links to |
173 |
| - glossary entries. |
174 |
| - |
| 151 | + Output: |
| 152 | + - See [](configuration:tooltip) for details |
| 153 | + - See [tooltips](configuration:tooltip) for details |
175 | 154 |
|
176 | 155 | ## Tooltips
|
177 | 156 |
|
178 |
| -The <configuration:tooltip> configuration allows you to control wether |
179 |
| -tooltips should be displayed with a preview on the definition: |
| 157 | +Control whether hovering over links shows definition previews using the <configuration:tooltip> option: |
180 | 158 |
|
181 |
| -``` yaml |
| 159 | +```yaml |
182 | 160 | plugins:
|
183 |
| - search |
184 | 161 | ezglossary:
|
185 |
| - tooltip: [none, short, full] |
| 162 | + tooltip: short # Options: none, short, full |
186 | 163 | ```
|
187 | 164 |
|
188 | 165 | Options:
|
189 |
| - |
190 |
| -none |
191 |
| -: Tooltips are disabled |
192 |
| - |
193 |
| -short |
194 |
| -: The <term:reference> link shows the first line of the definition as a tooltip |
195 |
| - (link title) |
196 |
| - |
197 |
| -full |
198 |
| -: The reference link shows the full definition as a tooltip. |
| 166 | +- `none`: No tooltips (default) |
| 167 | +- `short`: Show first line of definition |
| 168 | +- `full`: Show complete definition |
199 | 169 |
|
200 | 170 | !!! Example
|
201 |
| - |
202 |
| - ```markdown |
203 |
| - plugins: |
204 |
| - search |
205 |
| - ezglossary: |
206 |
| - tooltip: full |
207 |
| - ``` |
208 |
| - |
209 |
| - !!! Quote "Active tooltips" |
210 |
| - |
211 |
| -  |
212 |
| - |
| 171 | + With `tooltip: full`: |
| 172 | + |
| 173 | +  |
213 | 174 |
|
214 | 175 | ## Configuration
|
215 | 176 |
|
216 | 177 | configuration:tooltip
|
217 |
| -: Configure [tooltips](#tooltips) for reference links. Default is `none`. |
| 178 | +: Configure [tooltips](#tooltips) for reference links. Default: `none` |
218 | 179 |
|
219 | 180 | configuration:plurals
|
220 |
| -: Configure if and how the plugin shall lookup the term in singular if a plural |
221 |
| - is provided in the link text. See [handling plurals](#handling-plurals) for more details. |
| 181 | +: Configure plural handling. Options: `none` (default), `en`, `es`, `fr`, `de`, `inflect` |
222 | 182 |
|
223 | 183 | configuration:ignore_case
|
224 |
| -: Set to `true` to ignore the case for terms in the definition lookup. |
| 184 | +: Enable case-insensitive term matching. Default: `false` |
225 | 185 |
|
| 186 | +configuration:markdown_links |
| 187 | +: Enable processing of standard Markdown links. Default: `false` |
0 commit comments