slidev-addon-bibliography/README.md

66 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2022-12-02 16:22:19 +00:00
# Slidev bibliography addons
This addons provides a `Sources` and `Source` component to show sources.
## Setup
2022-12-02 16:28:38 +00:00
1. Install the addon with your favorite package manager
2022-12-08 11:34:15 +00:00
2. Install `pinia` as a dependency with your favorite package manager
3. Add it in your frontmatter:
2022-12-02 16:28:38 +00:00
```
addons:
- slidev-addon-bibliography
```
3. Create a `bibliography.json` file in the root of your slidev presentation with an empty object (`{}`).
4. Create a `setup/main.ts` file with the following contents:
2022-12-02 16:22:19 +00:00
```ts
import { defineAppSetup } from '@slidev/types'
import Bibliography from '../bibliography.json'
2022-12-08 11:34:15 +00:00
import { createPinia } from 'pinia'
const pinia = createPinia()
2022-12-02 16:22:19 +00:00
export default defineAppSetup(({ app }) => {
2022-12-08 11:34:15 +00:00
app.use(pinia)
2022-12-02 16:22:19 +00:00
app.provide('bibliography', Bibliography)
})
```
## Usage
In the `bibliography.json` file, add sources like this:
2022-12-02 16:31:08 +00:00
```json
2022-12-02 16:22:19 +00:00
{
"ot": {
"url": "https://en.wikipedia.org/wiki/Operational_transformation"
},
"crdtPaper": {
"title": "Nuno Preguiça: Conflict-free Replicated Data Types: An Overview. arXiv:1806.10254, June 2018."
}
}
```
2023-11-14 15:46:50 +00:00
Each source can have the following attributes:
* `title` (mandatory)
* `url`
* `author`
* `accessed` (the date you've accessed the source)
* `date` (the date the source was published)
2022-12-02 16:22:19 +00:00
In your slides, reference a source like this:
```md
* Something <Source item="ot"/>
```
It will then show up in the slide with a reference like `[0]`.
On the slide where you want to include all used sources, simply add the `<Sources/>` component.
It will show all sources you've used in order of appearance.
## License
MIT