forked from frappe/frappe-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
histoire.config.ts
82 lines (80 loc) · 1.93 KB
/
histoire.config.ts
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
77
78
79
80
81
82
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import resolveConfig from 'tailwindcss/resolveConfig'
import tailwindConfig from './tailwind.config.js'
const fullConfig = resolveConfig(tailwindConfig)
export default defineConfig({
setupFile: './histoire.setup.ts',
plugins: [HstVue()],
theme: {
title: 'Frappe UI',
defaultColorScheme: 'light',
hideColorSchemeSwitch: true,
favicon: 'frappe-ui-square.png',
logo: {
square: './frappe-ui-square.png',
light: './frappe-ui.png',
dark: './frappe-ui.png',
},
colors: {
gray: fullConfig.theme.colors.gray,
primary: fullConfig.theme.colors.gray,
},
},
tree: {
order(a, b) {
let maintainOrder = [
'Introduction',
'Getting Started',
'Resource',
'List Resource',
'Document Resource',
'Utilities',
'Directives',
]
let aIndex = maintainOrder.indexOf(a)
let bIndex = maintainOrder.indexOf(b)
if (aIndex > -1 && bIndex > -1) {
return aIndex - bIndex
} else if (aIndex > -1) {
return -1
} else if (bIndex > -1) {
return 1
} else {
return a.localeCompare(b)
}
},
groups: [
{
id: 'top',
title: '',
include: (file) => {
return (
file.path.includes('docs/') &&
!file.path.includes('docs/resources/') &&
!file.path.includes('docs/other/')
)
},
},
{
id: 'resources',
title: 'Data Fetching',
include: (file) => {
return file.path.includes('docs/resources/')
},
},
{
id: 'components',
title: 'Components',
include: (file) => {
return !file.path.includes('docs/')
},
},
{
id: 'other',
title: 'Other',
include: (file) => true,
},
],
},
})