-
Notifications
You must be signed in to change notification settings - Fork 1
/
styleguide.config.js
76 lines (69 loc) · 1.94 KB
/
styleguide.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const path = require('path')
module.exports = {
// set your styleguidist configuration here
title: 'Vue Mapbox',
assetsDir: path.join(__dirname, 'public'),
components: 'src/components/**/*.vue',
require: [path.join(__dirname, 'styleguide.global.js')],
skipComponentsWithoutExample: false,
pagePerSection: true,
// usageMode: 'expand',
updateDocs (docs) {
// console.log(docs)
// if (docs.doclets.version) {
// const versionFilePath = path.resolve(
// path.dirname(file),
// docs.doclets.version
// )
// const version = require(versionFilePath).version
// docs.doclets.version = version
// docs.tags.version[0].description = version
// }
return docs
},
getExampleFilename (componentPath) {
const name = path.basename(componentPath, '.vue')
const pathFinal = path.join(__dirname, 'docs', name + '.md')
console.log(pathFinal)
return pathFinal
// const dir = path.dirname(componentPath)
// return componentPath.replace(/\.jsx?$/, '.examples.md')
},
getComponentPathLine (componentPath) {
const name = path.basename(componentPath, '.vue')
const dir = path.dirname(componentPath)
return `import ${name} from '${dir}';`
},
// exampleMode: 'expand',
// defaultExample: true,
sections: [
{
name: 'Introduction',
content: 'docs/introduction.md',
sectionDepth: 1
},
{
name: 'Base Components',
sectionDepth: 1,
components: [
'src/components/VueMapbox.vue',
'src/components/VmMarker.vue',
'src/components/VmPopup.vue',
'src/components/VmSource.vue',
'src/components/VmImage.vue',
'src/components/VmLayer.vue'
]
},
{
name: 'Custom Markers',
sectionDepth: 1,
components:[
'src/components/Markers/VmMarkerDonut.vue'
]
},
]
// webpackConfig: {
// // custom config goes here
// },
// exampleMode: 'section'
}