Skip to content

Commit 738e454

Browse files
committed
refactor: vuepress to vitepress
1 parent cf08c6a commit 738e454

File tree

12 files changed

+1221
-885
lines changed

12 files changed

+1221
-885
lines changed

.gitignore

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

18+
docs/.vitepress/dist
19+
docs/.vitepress/cache
20+
1821
# Development
1922
.DS_Store
2023
.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.ts

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,4 @@
1-
import * as path from 'path';
2-
import { DefaultThemeConfig, defineConfig, PluginTuple } from 'vuepress/config';
31

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