Skip to content

Commit

Permalink
docs: setup twoslash
Browse files Browse the repository at this point in the history
  • Loading branch information
prazdevs committed Aug 29, 2024
1 parent 96c76a2 commit 7c70ad8
Show file tree
Hide file tree
Showing 16 changed files with 1,023 additions and 276 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
> You are currently viewing upcoming v4 of the package. If you are looking for v3, look into the [v3 branch](https://github.com/prazdevs/pinia-plugin-persistedstate/tree/v3).
<p align="center">
<img src="https://raw.githubusercontent.com/prazdevs/pinia-plugin-persistedstate/main/docs/public/logo.svg" style="width: 100px">
<img src="https://raw.githubusercontent.com/prazdevs/pinia-plugin-persistedstate/main/docs/public/logo-dark.svg" style="width: 100px">
</p>

<h1 align="center">
Expand All @@ -12,9 +12,9 @@
Configurable persistence and rehydration of Pinia stores.
</p>
<p align="center">
<a href="https://npmjs.com/package/pinia-plugin-persistedstate"><img src="https://img.shields.io/npm/v/pinia-plugin-persistedstate?style=flat-square&labelColor=352c34&color=fd5e87" alt="npm"></a>
<a href="https://bundlephobia.com/result?p=pinia-plugin-persistedstate"><img src="https://img.shields.io/bundlephobia/minzip/pinia-plugin-persistedstate?style=flat-square&labelColor=352c34&color=fd5e87" alt="minizipped size"></a>
<a href="https://github.com/prazdevs/pinia-plugin-persistedstate/blob/main/LICENSE"><img src="https://img.shields.io/github/license/prazdevs/pinia-plugin-persistedstate?style=flat-square&labelColor=352c34&color=fd5e87" alt="license"></a>
<a href="https://npmjs.com/package/pinia-plugin-persistedstate"><img src="https://img.shields.io/npm/v/pinia-plugin-persistedstate?style=flat-square&labelColor=313244&color=cba6f7" alt="npm"></a>
<a href="https://bundlephobia.com/result?p=pinia-plugin-persistedstate"><img src="https://img.shields.io/bundlephobia/minzip/pinia-plugin-persistedstate?style=flat-square&labelColor=313244&color=cba6f7" alt="minizipped size"></a>
<a href="https://github.com/prazdevs/pinia-plugin-persistedstate/blob/main/LICENSE"><img src="https://img.shields.io/github/license/prazdevs/pinia-plugin-persistedstate?style=flat-square&labelColor=313244&color=cba6f7" alt="license"></a>
</p>
<p align="center">
<a href="https://prazdevs.github.io/pinia-plugin-persistedstate"><b>Documentation</b></a>
Expand Down
73 changes: 0 additions & 73 deletions docs/.vitepress/config.ts

This file was deleted.

69 changes: 69 additions & 0 deletions docs/.vitepress/config/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress'
import { version } from '../../../package.json'

export const en: LocaleSpecificConfig<DefaultTheme.Config> = {
description: 'Configurable persistence of Pinia stores.',
themeConfig: {
editLink: {
text: 'Suggest changes to this page',
pattern: 'https://github.com/prazdevs/pinia-plugin-persistedstate/edit/main/docs/:path',
},
nav: [
{ text: 'Guide', link: '/guide' },
{
text: 'Frameworks',
items: [
{ text: 'Nuxt', link: '/frameworks/nuxt' },
{ text: 'Others', link: '/frameworks/others' },
],
},
{
text: `v${version}`,
items: [
{
items: [{
text: 'Release Notes',
link: 'https://github.com/prazdevs/pinia-plugin-persistedstate/releases',
}],
},
{
text: 'Versions',
items: [
{
text: `${version} (Current)`,
activeMatch: '/',
link: '#',
},
{
text: '3.2.2',
link: 'https://github.com/prazdevs/pinia-plugin-persistedstate/tree/v3',
},
{
text: '2.4.0',
link: 'https://github.com/prazdevs/pinia-plugin-persistedstate/tree/v2',
},
{
text: '1.6.3',
link: 'https://github.com/prazdevs/pinia-plugin-persistedstate/tree/v2',
},
],
},
],
},
],
sidebar: [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' },
],
},
],
footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2021-present Sacha Bouillez',
},

},
}
44 changes: 44 additions & 0 deletions docs/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { defineConfig } from 'vitepress'
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { en } from './en'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Pinia Plugin Persistedstate',
head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
lastUpdated: true,
markdown: {
codeTransformers: [
transformerTwoslash(),
],
theme: {
dark: 'catppuccin-mocha',
light: 'catppuccin-latte',
},
},
themeConfig: {
logo: {
light: '/logo-light.svg',
dark: '/logo-dark.svg',
},
search: {
provider: 'algolia',
options: {
appId: '90OL5Y5T3K',
apiKey: '20f9f00e8b98bae16d443559f1879aa9',
indexName: 'pinia-plugin-persistedstate',
},
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/prazdevs/pinia-plugin-persistedstate' },
],
externalLinkIcon: true,
},
locales: {
root: {
label: 'English',
lang: 'en',
...en,
},
},
})
6 changes: 4 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import TwoslashClient from '@shikijs/vitepress-twoslash/client'
import '@shikijs/vitepress-twoslash/style.css'
import './style.css'

export default {
Expand All @@ -11,7 +13,7 @@ export default {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
},
enhanceApp() {
// ...
enhanceApp({ app }) {
app.use(TwoslashClient)
},
} satisfies Theme
Loading

0 comments on commit 7c70ad8

Please sign in to comment.