Chart.js/docs/.vuepress/config.js
Evert Timberg ed2b96eeaf
Switch docs to Vuepress to match other chart.js repositories (#8751)
* Initial work

* Update doc commands

* Updated sidebar config

* Move docs

* Update theme version and enable

* Convert to chart.js sample

* Update scripts to point to local build

* Chart.js from local build

* Simplify getting-started example

* Axis docs updated except for imported content

* Common ticks import works

* Chart type docs ported to editor plugin

* Last pages to use editor

* Fix small errors

* Frontmatter title to heading

* Remove duplicate example

* Update sidebar

* Add paths

* Remove paths

* Add getting-started back

* Update menus and add copyright to license section of the docs

* Add GA plugin

* Style sub-groups

* Remove unneeded license page since it is covered on the main page

* Remove docusaurus readme page

* Remove docusaurus files

* Fix issues in docs

* Build and deploy scripts for docs work

* Conditional base URL for nice local testing

* Use eslint-plugin-markdown

* Remove hard coded lines

* Remove mentions of docusaurus

Co-authored-by: Jukka Kurkela <jukka.kurkela@gmail.com>
2021-03-30 10:32:39 -04:00

164 lines
4.3 KiB
JavaScript

const path = require('path');
const docsVersion = "VERSION";
const base = process.env.NODE_ENV === "development" ? '' : `/docs/${docsVersion}/`;
module.exports = {
title: 'Chart.js',
description: 'Open source HTML5 Charts for your website',
theme: 'chartjs',
base,
dest: path.resolve(__dirname, '../../dist/docs'),
head: [
['link', {rel: 'icon', href: '/favicon.ico'}],
],
plugins: [
'tabs',
[
'@vuepress/google-analytics',
{
'ga': 'UA-28909194-3'
}
],
],
chainWebpack(config) {
config.merge({
resolve: {
alias: {
'chart.js': path.resolve(__dirname, '../../dist/chart.esm.js'),
}
}
})
},
markdown: {
extendMarkdown: md => {
md.use(require('markdown-it-include'), path.resolve(__dirname, '../'));
}
},
themeConfig: {
repo: 'chartjs/Chart.js',
logo: '/favicon.ico',
lastUpdated: 'Last Updated',
searchPlaceholder: 'Search...',
editLinks: false,
docsDir: 'docs',
chart: {
imports: [
['scripts/register.js'],
['scripts/utils.js', 'Utils'],
]
},
nav: [
{text: 'Home', link: '/'},
// TODO: Make local when samples moved to vuepress
{text: 'Samples', link: `https://www.chartjs.org/samples/${docsVersion}/`},
{
text: 'Ecosystem',
ariaLabel: 'Community Menu',
items: [
{ text: 'Awesome', link: 'https://github.com/chartjs/awesome' },
{ text: 'Slack', link: 'https://chartjs-slack.herokuapp.com/' },
{ text: 'Stack Overflow', link: 'https://stackoverflow.com/questions/tagged/chart.js' }
]
}
],
sidebar: {
'/': [
'',
{
title: 'Getting Started',
children: [
'getting-started/',
'getting-started/installation',
'getting-started/integration',
'getting-started/usage',
'getting-started/v3-migration'
]
},
{
title: 'General',
children: [
'general/data-structures',
'general/accessibility',
'general/options',
'general/colors',
'general/fonts',
'general/padding',
'general/performance'
]
},
{
title: 'Configuration',
children: [
'configuration/',
'configuration/responsive',
'configuration/device-pixel-ratio',
'configuration/locale',
'configuration/interactions',
'configuration/canvas-background',
'configuration/animations',
'configuration/layout',
'configuration/legend',
'configuration/title',
'configuration/tooltip',
'configuration/elements',
'configuration/decimation'
]
},
{
title: 'Chart Types',
children: [
'charts/line',
'charts/bar',
'charts/radar',
'charts/doughnut',
'charts/polar',
'charts/bubble',
'charts/scatter',
'charts/area',
'charts/mixed'
]
},
{
title: 'Axes',
children: [
'axes/',
{
title: 'Cartesian',
children: [
'axes/cartesian/',
'axes/cartesian/category',
'axes/cartesian/linear',
'axes/cartesian/logarithmic',
'axes/cartesian/time',
'axes/cartesian/timeseries'
],
},
{
title: 'Radial',
children: [
'axes/radial/linear'
],
},
'axes/labelling',
'axes/styling'
]
},
{
title: 'Developers',
children: [
'developers/',
'developers/api',
[`https://chartjs.org/docs/${docsVersion}/typedoc/`, 'TypeDoc'],
'developers/updates',
'developers/plugins',
'developers/charts',
'developers/axes',
'developers/contributing',
'developers/publishing'
]
},
],
}
}
};