-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
539 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<script setup lang="ts"> | ||
import { defineProps } from 'vue' | ||
defineProps<{ type: 'node' | 'client' }>() | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Use Addon | ||
|
||
Addons are sets of additional components, layouts, styles, configuration...etc. that you can use in your presentation. | ||
|
||
They are quite similar to [themes](/themes/use), but in general: | ||
|
||
* they don't affect the global styles of your slides | ||
* you can use multiple addons in one presentation | ||
|
||
To use addons, you have to install them manually via: | ||
|
||
```bash | ||
$ npm install [slidev-addon-package1] [slidev-addon-package2] | ||
``` | ||
|
||
And then declare the addons either in your frontmatter: | ||
|
||
```yaml | ||
--- | ||
addons: | ||
- slidev-addon-package1 | ||
- slidev-addon-package2 | ||
--- | ||
``` | ||
|
||
Or in your `package.json` file: | ||
|
||
```json | ||
// package.json | ||
{ | ||
"slidev": { | ||
"addons": [ | ||
"slidev-addon-package1", | ||
"slidev-addon-package2", | ||
] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Write an Addon | ||
|
||
> Available since v0.32.1 | ||
## Capability | ||
|
||
An addon can contribute to the following points: | ||
|
||
- Global styles (use with caution has it is more the role of [themes](/themes/use)) | ||
- Provide custom layouts or override the existing one | ||
- Provide custom components or override the existing one | ||
- Extend Windi CSS configurations | ||
- Configure tools like Monaco and Prism | ||
|
||
## Conventions | ||
|
||
Addons are published to npm registry, and they should follow the conventions below: | ||
|
||
- Package name should start with `slidev-addon-`, for example: `slidev-addon-awesome` | ||
- Add `slidev-addon` and `slidev` in the `keywords` field of your `package.json` | ||
|
||
## Setup | ||
|
||
### Initialization | ||
|
||
To create your addon, start by creating a directory with create a `package.json` file (you can use `npm init`). | ||
|
||
Then, install slidev dependencies: | ||
|
||
```bash | ||
$ npm install -D @slidev/cli | ||
``` | ||
|
||
### Testing | ||
|
||
To set up the testing playground for your addon, you can create an `example.md` file with some content. | ||
|
||
And optionally, you can also add some scripts to your `packages.json` | ||
|
||
```json | ||
// package.json | ||
{ | ||
"scripts": { | ||
"dev": "slidev example.md", | ||
"build": "slidev build example.md", | ||
"export": "slidev export example.md", | ||
"screenshot": "slidev export example.md --format png" | ||
} | ||
} | ||
``` | ||
|
||
To publish your addon, simply run `npm publish` and you are good to go. There is no build process required (which means you can directly publish `.vue` and `.ts` files, Slidev is smart enough to understand them). | ||
|
||
Addon contribution points follow the same conventions as local customization, please refer to [the docs for the naming conventions](/custom/). | ||
|
||
## Addon metadata | ||
|
||
### Slidev Version | ||
|
||
If the addon is relying on a specific feature of Slidev that are newly introduced, you can set the minimal Slidev version required to have your addon working properly: | ||
|
||
```json | ||
// package.json | ||
{ | ||
"engines": { | ||
"slidev": ">=0.32.1" | ||
} | ||
} | ||
``` | ||
|
||
If users are using older versions of Slidev, an error will be thrown. |
Oops, something went wrong.