diff --git a/README.md b/README.md new file mode 100644 index 0000000..71a99a0 --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +# Slidev bibliography addons + +This addons provides a `Sources` and `Source` component to show sources. + +## Setup + +1. Create a `bibliography.json` file in the root of your slidev presentation with an empty object (`{}`). +2. Create a `setup/main.ts` file with the following contents: +```ts +import { defineAppSetup } from '@slidev/types' +import Bibliography from '../bibliography.json' + +export default defineAppSetup(({ app }) => { + app.provide('bibliography', Bibliography) +}) +``` + +## Usage + +In the `bibliography.json` file, add sources like this: + +``` +{ + "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." + } +} +``` + +Each source can have a url, a title or both. + +In your slides, reference a source like this: + +```md +* Something +``` + +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 `` component. +It will show all sources you've used in order of appearance. + +## License + +MIT diff --git a/components/Source.vue b/components/Source.vue new file mode 100644 index 0000000..2b13a29 --- /dev/null +++ b/components/Source.vue @@ -0,0 +1,37 @@ + + diff --git a/components/Sources.vue b/components/Sources.vue new file mode 100644 index 0000000..04fe8a3 --- /dev/null +++ b/components/Sources.vue @@ -0,0 +1,25 @@ + + \ No newline at end of file