Skip to content

Commit f7d502c

Browse files
committed
refactor: vuepress to vitepress
1 parent 4aa6d11 commit f7d502c

File tree

12 files changed

+1239
-929
lines changed

12 files changed

+1239
-929
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ build/
1414
# generated typedocs
1515
docs/api
1616

17+
docs/.vitepress/dist
18+
docs/.vitepress/cache
19+
1720
# Development
1821
.DS_Store
1922
.env.local

docs/.vitepress/config.mjs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import { defineConfig } from 'vitepress'
2+
const docsVersion = "VERSION";
3+
const base = process.env.NODE_ENV === "development" ? '/chartjs-plugin-zoom/master/' : `/chartjs-plugin-zoom/${docsVersion}/`;
4+
5+
// https://vitepress.dev/reference/site-config
6+
export default defineConfig({
7+
title: "chartjs-plugin-zoom",
8+
description: "A zoom and pan plugin for Chart.js >= 3.0.0",
9+
head: [
10+
['link', { rel: 'icon', href: '/favicon.ico' }],
11+
],
12+
base,
13+
outDir: '../../dist/docs',
14+
themeConfig: {
15+
// https://vitepress.dev/reference/default-theme-config
16+
logo: '/hero.svg',
17+
footer: {
18+
message: 'Released under the MIT License',
19+
copyright: 'Copyright © 2016-2024 chartjs-plugin-zoom contributors',
20+
},
21+
nav: [
22+
{
23+
text: docsVersion,
24+
items: [
25+
{ text: 'Development (master)', link: '/chartjs-plugin-zoom/master/' },
26+
{ text: '2.x.x', link: '/chartjs-plugin-zoom/2.0.1/' },
27+
{ text: '1.x.x', link: '/chartjs-plugin-zoom/1.3.0/' },
28+
],
29+
},
30+
{ text: 'Home', link: '/' },
31+
{ text: 'Guide', link: '/guide/integration' },
32+
{ text: 'Reference', link: '/api/README' },
33+
{ text: 'Samples', link: `/samples/` },
34+
{
35+
text: 'Ecosystem',
36+
ariaLabel: 'Community Menu',
37+
items: [
38+
{ text: 'Awesome', link: 'https://github.com/chartjs/awesome' },
39+
]
40+
},
41+
{ text: 'GitHub', link: 'https://github.com/chartjs/chartjs-plugin-zoom' },
42+
],
43+
44+
sidebar: [
45+
{
46+
text: 'Guide',
47+
collapsed: false,
48+
link: '/guide/integration',
49+
items: [
50+
{ text: 'Integration', link: '/guide/integration' },
51+
{ text: 'Usage', link: '/guide/usage' },
52+
{ text: 'Options', link: '/guide/options' },
53+
{ text: 'Animations', link: '/guide/animations' },
54+
{ text: 'Developers', link: '/guide/developers' },
55+
],
56+
},
57+
{
58+
text: 'Samples',
59+
collapsed: false,
60+
link: '/samples/basic',
61+
items: [
62+
{ text: 'Basic', link: '/samples/basic' },
63+
{
64+
text: 'Wheel Zoom',
65+
collapsed: true,
66+
items: [
67+
{ text: 'Category Scale', link: '/samples/wheel/category' },
68+
{ text: 'Logarithmic Scale', link: '/samples/wheel/log' },
69+
{ text: 'Time Scale', link: '/samples/wheel/time' },
70+
{ text: 'Over Scale Mode', link: '/samples/wheel/over-scale-mode' },
71+
{ text: 'Click to Zoom', link: '/samples/wheel/click-zoom' },
72+
],
73+
},
74+
{
75+
text: 'Drag to Zoom',
76+
collapsed: true,
77+
items: [
78+
{ text: 'Category Scale', link: '/samples/drag/category' },
79+
{ text: 'Linear Scale', link: '/samples/drag/linear' },
80+
{ text: 'Logarithmic Scale', link: '/samples/drag/log' },
81+
{ text: 'Time Scale', link: '/samples/drag/time' },
82+
{ text: 'Timeseries Scale', link: '/samples/drag/timeseries' },
83+
],
84+
},
85+
{ text: 'API', link: '/samples/api' },
86+
{ text: 'Fetch Data', link: '/samples/fetch-data' },
87+
{ text: 'Pan Region', link: '/samples/pan-region' },
88+
]
89+
},
90+
{
91+
text: 'API Reference',
92+
link: '/api/README',
93+
}
94+
],
95+
96+
socialLinks: [
97+
{ icon: 'github', link: 'https://github.com/chartjs/chartjs-plugin-zoom' },
98+
]
99+
}
100+
})

docs/.vuepress/config.js

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,4 @@
1-
const path = require('path');
2-
const docsVersion = "VERSION";
3-
const base = process.env.NODE_ENV === "development" ? '/chartjs-plugin-zoom/master/' : `/chartjs-plugin-zoom/${docsVersion}/`;
41

5-
module.exports = {
6-
title: 'chartjs-plugin-zoom',
7-
description: 'A zoom and pan plugin for Chart.js >= 3.0.0',
8-
theme: 'chartjs',
9-
base,
10-
dest: path.resolve(__dirname, '../../dist/docs'),
11-
head: [
12-
['link', {rel: 'icon', href: '/favicon.ico'}],
13-
],
14-
plugins: [
15-
['flexsearch'],
16-
['redirect', {
17-
redirectors: [
18-
// Default sample page when accessing /samples.
19-
{base: '/samples', alternative: ['basic']},
20-
],
21-
}],
22-
[
23-
'vuepress-plugin-typedoc',
24-
{
25-
entryPoints: ['../../types/index.d.ts'],
26-
hideInPageTOC: true,
27-
tsconfig: 'tsconfig.json',
28-
sidebar: {
29-
fullNames: true,
30-
parentCategory: 'API',
31-
},
32-
},
33-
],
34-
['@simonbrunel/vuepress-plugin-versions', {
35-
filters: {
36-
suffix: (tag) => tag ? ` (${tag})` : '',
37-
title: (v, vars) => window.location.href.includes('master') ? 'Development (master)' : v + (vars.tag ? ` (${tag})` : ''),
38-
},
39-
menu: {
40-
text: '{{version|title}}',
41-
items: [
42-
{
43-
text: 'Documentation',
44-
items: [
45-
{
46-
text: 'Development (master)',
47-
link: '/chartjs-plugin-zoom/master/',
48-
target: '_self',
49-
},
50-
{
51-
type: 'versions',
52-
text: '{{version}}{{tag|suffix}}',
53-
link: '/chartjs-plugin-zoom/{{version}}/',
54-
exclude: /^[0]\.[0-4]\./,
55-
group: 'minor',
56-
target: '_self',
57-
}
58-
]
59-
},
60-
{
61-
text: 'Release notes (5 latest)',
62-
items: [
63-
{
64-
type: 'versions',
65-
limit: 5,
66-
target: '_blank',
67-
group: 'patch',
68-
link: 'https://github.com/chartjs/chartjs-plugin-zoom/releases/tag/v{{version}}'
69-
}
70-
]
71-
}
72-
]
73-
},
74-
}],
75-
],
762
chainWebpack: (config) => {
773
config.module
784
.rule('chart.js')
@@ -93,12 +19,6 @@ module.exports = {
9319
});
9420
},
9521
themeConfig: {
96-
repo: 'chartjs/chartjs-plugin-zoom',
97-
logo: '/favicon.ico',
98-
lastUpdated: 'Last Updated',
99-
searchPlaceholder: 'Search...',
100-
editLinks: false,
101-
docsDir: 'docs',
10222
chart: {
10323
imports: [
10424
['scripts/register.js'],

docs/guide/index.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/index.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1-
---
2-
home: true
3-
heroImage: /hero.svg
4-
actionText: Get Started →
5-
actionLink: /guide/
6-
footer: MIT Licensed | Copyright © 2016-2021 chartjs-plugin-zoom contributors
7-
---
1+
![logo](/hero.svg)
2+
3+
# chartjs-plugin-zoom
4+
5+
A zoom and pan plugin for Chart.js >= 3.0.0
6+
7+
Panning can be done via the mouse or with a finger.
8+
Zooming is done via the mouse wheel or via a pinch gesture. [Hammer.js](https://hammerjs.github.io/) is used for gesture recognition.
9+
10+
## Installation
11+
12+
```bash
13+
> npm install chartjs-plugin-zoom
14+
```
15+
16+
:::tip
17+
18+
**Important Note:** For Chart.js 2.6.0 to 2.9.x support, use [version 0.7.7 of this plugin](https://github.com/chartjs/chartjs-plugin-zoom/releases/tag/v0.7.7).
19+
Documentation for v0.7.7 can be found on [GitHub](https://github.com/chartjs/chartjs-plugin-zoom/blob/v0.7.7/README.md).
20+
21+
:::
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)