You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0449e4e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/.vitepress/config.mts
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ export default defineConfig({
85
85
86
86
footer: {
87
87
message:
88
-
'Code released under the MIT License. BinaryNoir name and logos are trademarks of BinaryNoir. <a href="/legal">Legal</a> · <a href="/terms">Terms</a>',
88
+
'Code released under the MIT License. BinaryNoir name and logos are trademarks of BinaryNoir. <a href="/legal">Legal</a> · <a href="/terms">Terms</a> · <a href="/privacy">Privacy</a>',
A live example of [section glossaries](/plugins/glossary#section-glossaries). This folder has its own [glossary file](/plugins/glossary-demo/section-glossary), so its terms apply to this page and nowhere else on the site. Hover, click or tap a dotted word to read it.
8
+
9
+
-**Gizmo** exists only in this folder's glossary.
10
+
-**CI** is defined by both this folder's glossary and the site's master glossary. The closer one wins, so you see the demo's definition here.
11
+
-**CLI** is defined only by the master glossary, so it still works. A section glossary adds to the master; it doesn't replace it.
12
+
13
+
On the [plugin page](/plugins/glossary), CI shows the master's definition and Gizmo has no tooltip.
A section glossary: its terms apply only to pages in this folder. This page opts out with `glossary: false` so its own headings don't tooltip themselves.
9
+
10
+
Back to the [demo](/plugins/glossary-demo/).
11
+
12
+
### CI
13
+
14
+
Demo section glossary: this definition of CI beats the master glossary's, but only in this folder.
15
+
16
+
### Gizmo
17
+
18
+
Demo section glossary: an invented term that exists only in this folder.
|`selector`|`'abbr[title]'`| Which elements carry a definition in their `title`. |
63
+
|`hover`|`true`| Show on mouse hover too. `false` for click and tap only. |
64
+
|`hoverDelay`|`500`| Milliseconds the mouse must rest on a term before the popover shows. `0` for instant. |
65
+
|`touchOnly`|`false`| Respond to touch input only, leaving mouse users the native tooltip. |
66
+
|`injectStyles`|`true`| Inject the default popover styles. `false` lets you style `.glossary-popover`. |
66
67
67
68
The default look follows VitePress theme colors and can be overridden with the `--glossary-popover-bg`, `--glossary-popover-fg`, and `--glossary-popover-border` CSS variables. `enableGlossaryTooltips()` returns a function that removes its listeners.
68
69
@@ -84,6 +85,58 @@ The block of YAML at the very top of a Markdown file that holds page settings.
84
85
- A comma-separated heading defines aliases: `### frontmatter, front matter` tooltips both spellings. Try it: frontmatter, front matter.
85
86
- A heading with a parenthetical qualifier is parsed but never tooltipped, for words that mean something else elsewhere. The last term in [the glossary](/reference/glossary) does this with the word Pages.
86
87
88
+
## Section glossaries
89
+
90
+
Parts of a site, like a team's docs, can have their own vocabulary. Set `root` to your docs folder and drop a `glossary.md` into any subfolder. It applies to that folder and everything below it, and nowhere else.
See it working on the [live section glossary demo](/plugins/glossary-demo/).
111
+
112
+
To apply a section glossary to the whole site instead, set `glossary-scope: site` in that file's frontmatter. Section glossaries are found when the config loads, so adding or editing one needs a dev-server restart.
113
+
114
+
### Which definition wins
115
+
116
+
When a term is defined in more than one glossary, **the closest glossary wins**. Closest means nearest to the page, measured in folders: a glossary in the page's own folder beats one a level up, and the master glossary is last. Only the conflicting term is replaced, so a section glossary adds to the master rather than replacing it.
| 1 | Page-local `*[Term]: …`| the page defines the term itself |
121
+
| 2 | Section glossary | its folder contains the page; the deepest folder ranks highest |
122
+
| 3 | Site-wide section glossary | it is marked `glossary-scope: site` and its folder does not contain the page |
123
+
| 4 | Master glossary | always, unless the page opts out |
124
+
125
+
For example, if `CI` is defined in the master, in `team-a/glossary.md`, and in `team-a/guides/glossary.md`, then `team-a/guides/deploy.md` uses the `guides` definition, `team-a/index.md` uses the `team-a` one, and `team-b/index.md` uses the master's.
126
+
127
+
A term marked as not tooltipped (the parenthetical heading) in a closer glossary hides that term from farther ones, so a section can say a word means something else there. If two site-wide glossaries define the same term, the folder that sorts first alphabetically wins and a warning is logged at startup.
128
+
129
+
### Choose which layers a page gets
130
+
131
+
```md
132
+
---
133
+
glossary:
134
+
master: false # keep section glossaries, skip the master
135
+
---
136
+
```
137
+
138
+
Use `local: false` to skip all section glossaries and keep the master. `glossary: false` still turns everything off.
139
+
87
140
## Opt a page out
88
141
89
142
```md
@@ -120,13 +173,16 @@ The same syntax works on a page that has _not_ opted out. A page-local definitio
|`file`| none | Path to a glossary Markdown file. Give this or `entries`. |
126
-
|`entries`| none | Pre-parsed entries, for sourcing terms from somewhere else. |
127
-
|`headingLevel`|`3`| Heading level that marks a term. |
128
-
|`frontmatterKey`|`'glossary'`| Frontmatter key for the opt-out. `false` disables it. |
129
-
130
-
The plugin itself emits plain `<abbr title>` tags and injects no CSS. This site adds a dotted underline in its theme so the terms are discoverable, and `enableGlossaryTooltips()` adds the popover and a pointer cursor.
The plugin itself emits plain `<abbr title>` tags and injects no CSS. This site adds a dotted underline in its theme so the terms are discoverable, and `enableGlossaryTooltips()` adds the popover and a help (question mark) cursor.
131
187
132
188
[Source and full README on GitHub](https://github.com/binarynoir/markdown-it-glossary)
This site does not collect any data about you. There are no accounts, no forms, no analytics, no advertising, no tracking and no cookies. See also the [Terms of Use](/terms) and the [Legal](/legal) page.
10
+
11
+
## What this site collects
12
+
13
+
Nothing. BinaryNoir does not gather, store, sell or share personal information or usage data about visitors, and the site does not load scripts, fonts, images or other content from third-party services.
14
+
15
+
## Cookies and local storage
16
+
17
+
The site sets no cookies. Your browser may keep one small setting on your own device: your light or dark theme choice, saved in the browser's local storage so the site looks the way you left it. It stays on your device, is never sent anywhere, and you can remove it any time by clearing this site's data in your browser.
18
+
19
+
## Search
20
+
21
+
Search runs entirely in your browser, against an index that is downloaded with the site. What you type is not sent to BinaryNoir or anyone else.
22
+
23
+
## Hosting
24
+
25
+
The site is hosted on GitHub Pages. As with any web host, GitHub may process technical information such as your IP address when your browser requests a page, under [GitHub's privacy statement](https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement). BinaryNoir adds no tracking of its own on top of that.
26
+
27
+
## Links to other sites
28
+
29
+
This site links to third-party sites and services, such as GitHub and npm. Those sites have their own privacy practices, which BinaryNoir does not control. Anything you post there, such as an issue or a pull request on a GitHub repository, is public and governed by their policies.
30
+
31
+
## Changes
32
+
33
+
This page may be updated from time to time. The date above shows the latest revision.
34
+
35
+
## Contact
36
+
37
+
Questions about privacy can be sent by opening an issue on the [site repository](https://github.com/binarynoir/binarynoir.github.io).
0 commit comments