1
+ import { tr } from '../../i18n' ;
2
+
3
+ export function sidebarGuide ( locale :string ) {
4
+ const t = ( key :string ) => {
5
+ return tr ( locale , `sidebar.guide.${ key } ` ) ;
6
+ }
7
+ return [
8
+ {
9
+ text : t ( 'guide' ) ,
10
+ collapsed : false ,
11
+ items : [
12
+ { text : t ( 'introduction' ) , link : 'introduction' } ,
13
+ { text : t ( 'gettingStarted' ) , link : 'getting-started' } ,
14
+ { text : t ( 'styles' ) , link : 'styles' } ,
15
+ ]
16
+ } ,
17
+ // {
18
+ // text: t('utilities'),
19
+ // collapsed: true,
20
+ // items: [
21
+ // { text: 'Emoji', link: 'util/emoji' },
22
+ // { text: t('icon'), link: 'util/icon' },
23
+ // ]
24
+ // },
25
+ ]
26
+ }
27
+ export function sidebarApi ( locale :string ) {
28
+ const t = ( key :string ) => {
29
+ return tr ( locale , `sidebar.api.${ key } ` ) ;
30
+ }
31
+ const vueComponent = ( path :string ) => {
32
+ return `component/vue/${ path } ` ;
33
+ }
34
+ const reactComponent = ( path :string ) => {
35
+ return `component/react/${ path } ` ;
36
+ }
37
+ const extension = ( path :string ) => {
38
+ return `extension/${ path } ` ;
39
+ }
40
+ return [
41
+ {
42
+ text : t ( 'components' ) ,
43
+ collapsed : false ,
44
+ items : [
45
+ { text : t ( 'overview' ) , link : 'component/overview' } ,
46
+ {
47
+ text : 'Vue' ,
48
+ collapsed : false ,
49
+ items : [
50
+ { text : 'YiiEditor' , link : vueComponent ( 'yii-editor' ) } ,
51
+ {
52
+ text : 'Common' ,
53
+ collapsed : false ,
54
+ items : [
55
+ { text : 'Doc TOC' , link : vueComponent ( 'common/doc-toc' ) } ,
56
+ ]
57
+ } ,
58
+ {
59
+ text : 'Menus' ,
60
+ collapsed : false ,
61
+ items : [
62
+ { text : 'OMainMenu' , link : vueComponent ( 'menus/main-menu' ) } ,
63
+ ]
64
+ } ,
65
+ {
66
+ text : 'UI' ,
67
+ collapsed : true ,
68
+ items : [
69
+ { text : 'OIcon' , link : vueComponent ( 'ui/icon' ) } ,
70
+ ]
71
+ } ,
72
+ ]
73
+ } ,
74
+ {
75
+ text : 'React' ,
76
+ collapsed : false ,
77
+ items : [
78
+ { text : 'YiiEditor' , link : reactComponent ( 'yii-editor' ) } ,
79
+ ]
80
+ } ,
81
+ ]
82
+ } ,
83
+ {
84
+ text : t ( 'extensions' ) ,
85
+ collapsed : false ,
86
+ items : [
87
+ { text : t ( 'overview' ) , link : extension ( 'overview' ) } ,
88
+ { text : 'Callout' , link : extension ( 'callout' ) } ,
89
+ { text : 'Char Command' , link : extension ( 'char-command' ) } ,
90
+ { text : 'Code Block' , link : extension ( 'code-block' ) } ,
91
+ { text : 'Color Highlighter' , link : extension ( 'color-highlighter' ) } ,
92
+ { text : 'Image' , link : extension ( 'image' ) } ,
93
+ { text : 'Placeholder' , link : extension ( 'placeholder' ) } ,
94
+ { text : 'Table' , link : extension ( 'table' ) } ,
95
+ { text : 'Trailing Node' , link : extension ( 'trailing-node' ) } ,
96
+ { text : 'Unique ID' , link : extension ( 'unique-id' ) } ,
97
+ { text : 'Video' , link : extension ( 'video' ) } ,
98
+ ]
99
+ } ,
100
+ ]
101
+ }
0 commit comments