forked from debruine/quarto-glossary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.qmd
103 lines (57 loc) · 3.39 KB
/
index.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
```
```
# Quarto-Popover-Glossary
This extension provides shortcodes for [popover-glossary](https://github.com/maouw/quarto-popover-glossary) in quarto. It uses the [Popper](https://popper.js.org) library to create popovers with glossary definitions.
[popover-glossary](https://github.com/maouw/quarto-popover-glossary) is based on [quarto-glossary](https://debruine.github.io/quarto-glossary) by [Lisa DeBruine](https://debruine.github.io/). Most code and documentation, including the majority of this web page, is from [quarto-glossary](https://debruine.github.io/quarto-glossary).
## Setup
### Installing
```sh
quarto install extension maouw/quarto-popover-glossary
```
This will install the extension under the `_extensions` subdirectory. If you're using version control, you will want to check in this directory.
### Glossary file
You can store definitions in a YAML file. Use markdown to create paragraphs, links, and lists. Make sure each new line in a definition is indented two spaces (sorry YAML is a bit picky, but it's the best human-editable solution).
``` yaml
SESOI: |
Smallest Effect Size of Interest: the smallest effect that is theoretically or practically meaningful
See [Equivalence Testing for Psychological Research](https://doi.org/10.1177/2515245918770963) for a tutorial on methods for choosing an SESOI.
p-value: |
The probability of the observed data, or more extreme data, if the null hypothesis is true. The lower the p-value, the higher the test statistic, and less likely it is to observe the data if the null hypothesis is true.
```
### Defaults
In the YAML header of your document, or the _quarto.yml file for your book or website, add the following defaults:
``` yaml
popover-glossary:
path: glossary.yml
```
Set path to the path to your glossary YAML file.
## Examples
The simplest use starts with the word `term` and then the term to be defined. Click on the underlined word to see a pop-up definition.
`{{{< term SESOI >}}}`
{{< term SESOI >}}
No need to change if you're just using different case:
`{{{< term sesoi >}}}`
{{< term sesoi >}}
Use quotes if your term is more than one word.
`{{{< term "effect size" >}}}`
{{< term "effect size" >}}
You can use Markdown or HTML in the definition, too:
`{{{< term html >}}}`
{{< term "html" >}}
If you want the link to display something different from the term, append a pipe (`|`) character and the display text.
`{{{< term "alpha|alpha criterion" >}}}`
The {{< term "alpha|alpha criterion" >}} is...
### Definitions
If you need to include a definition for a term that is not in the glossary file or is different from the one in the glossary file, you can set the `def` argument.
`{{{< term quarto def="An open-source scientific and technical publishing system" >}}}`
{{< term quarto def="An open-source scientific and technical publishing system" >}}
### Add to Definition List
If you don't want to add a glossary item to the definition list, set `add_to_deflist=false`.
`{{{< term SESOI add_to_deflist=true >}}}`
{{< term SESOI add_to_deflist=true >}}
`{{{< term R def="The best language" add_to_deflist=false >}}}`
{{< term R def="The best language" add_to_deflist=false >}}
### Definition List
If you set `deflist=true`, you will get a glossary [definition list](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl) with all the terms you've defined on this page.
`{{{< term deflist=true >}}}`
{{< term deflist=true >}}