Skip to content

Commit 8fc918f

Browse files
committed
chore: separate UI docs from main docs
1 parent 6f82577 commit 8fc918f

File tree

5 files changed

+112
-60
lines changed

5 files changed

+112
-60
lines changed

.vitepress/config.mts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineConfig } from 'vitepress'
22
import apiSidebar from '../content/api/sidebar.json'
33
import mainSidebar from '../content/sidebar'
4+
import uiSidebar from '../content/ui/sidebar'
45
import nav from './nav'
56
import './theme/cliLanguage'
67

@@ -28,6 +29,7 @@ export default defineConfig({
2829
nav,
2930
sidebar: {
3031
'/api': apiSidebar,
32+
'/ui': uiSidebar,
3133
'/': mainSidebar,
3234
},
3335
},

.vitepress/nav.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,22 @@ export default [
1212
{
1313
text: 'Docs',
1414
link: '/',
15-
activeMatch: '^/(?!plugins|best-practices|api|dev-reference|tutorials)',
15+
activeMatch: '^/(?!plugins|best-practices|api|dev-reference|tutorials|ui)',
1616
icon: 'BookOpenIcon',
1717
},
18-
{
19-
text: 'Preview',
20-
link: 'https://preview.nativescript.org',
21-
icon: 'DevicePhoneMobileIcon',
22-
target: '_blank',
23-
},
18+
2419
{
2520
text: 'Tutorials',
2621
link: '/tutorials/',
2722
activeMatch: '^/tutorials',
2823
icon: 'AcademicCapIcon',
2924
},
25+
{
26+
text: 'Preview',
27+
link: 'https://preview.nativescript.org',
28+
icon: 'DevicePhoneMobileIcon',
29+
target: '_blank',
30+
},
3031
{
3132
text: 'Plugins',
3233
link: '/soon',
@@ -45,7 +46,13 @@ export default [
4546
icon: 'CpuChipIcon',
4647
},
4748
{
48-
text: 'API Reference',
49+
text: 'UI Components',
50+
link: '/ui/',
51+
activeMatch: '^/ui',
52+
icon: 'CubeTransparentIcon',
53+
},
54+
{
55+
text: 'API',
4956
link: '/api/',
5057
activeMatch: '^/api',
5158
icon: 'CodeBracketIcon',

content/sidebar.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -162,56 +162,4 @@ export default [
162162
},
163163
],
164164
},
165-
{
166-
text: 'UI / Layout Containers',
167-
items: [
168-
{ text: 'StackLayout', link: '/ui/stack-layout' },
169-
{ text: 'GridLayout', link: '/ui/grid-layout' },
170-
{ text: 'RootLayout', link: '/ui/root-layout' },
171-
{ text: 'FlexboxLayout', link: '/ui/flexbox-layout' },
172-
{ text: 'WrapLayout', link: '/ui/wrap-layout' },
173-
{ text: 'DockLayout', link: '/ui/dock-layout' },
174-
{ text: 'AbsoluteLayout', link: '/ui/absolute-layout' },
175-
],
176-
},
177-
{
178-
text: 'UI / Navigation Components',
179-
items: [
180-
// { text: 'Frame', link: '//#' },
181-
{ text: 'Page', link: '/ui/page' },
182-
{ text: 'ActionBar', link: '/ui/action-bar' },
183-
// { text: 'ActionItem', link: '//#' },
184-
// { text: 'NavigationButton', link: '//#' },
185-
// todo: move this elsewhere
186-
{
187-
text: 'Showing Modal',
188-
link: '/guide/ui/showing-modal',
189-
},
190-
],
191-
},
192-
{
193-
text: 'UI / Components',
194-
items: [
195-
{ text: 'ActivityIndicator', link: '/ui/activity-indicator' },
196-
{ text: 'Button', link: '/ui/button' },
197-
{ text: 'DatePicker', link: '/ui/datepicker' },
198-
{ text: 'HtmlView', link: '/ui/htmlview' },
199-
{ text: 'Image', link: '/ui/image' },
200-
{ text: 'Label', link: '/ui/label' },
201-
{ text: 'ListPicker', link: '/ui/listpicker' },
202-
{ text: 'ListView', link: '/ui/listview' },
203-
{ text: 'Placeholder', link: '/ui/placeholder' },
204-
{ text: 'Progress', link: '/ui/progress' },
205-
{ text: 'ScrollView', link: '/ui/scrollview' },
206-
{ text: 'SearchBar', link: '/ui/searchbar' },
207-
{ text: 'SegmentedBar', link: '/ui/segmentedbar' },
208-
{ text: 'Slider', link: '/ui/slider' },
209-
{ text: 'Switch', link: '/ui/switch' },
210-
{ text: 'TabView', link: '/ui/tabview' },
211-
{ text: 'TextField', link: '/ui/textfield' },
212-
{ text: 'TextView', link: '/ui/textview' },
213-
{ text: 'TimePicker', link: '/ui/timepicker' },
214-
{ text: 'WebView', link: '/ui/webview' },
215-
],
216-
},
217165
] as NSSidebarGroup[]

content/ui/index.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
title: UI Components
3+
contributors: false
4+
---
5+
6+
<script setup lang="ts">
7+
import uiSidebar from "./sidebar";
8+
function categoryId(category: any) {
9+
const url = new URL(category.link, 'https://example.com/')
10+
return url.hash.slice(1);
11+
}
12+
</script>
13+
14+
## Layout Containers {#layout-containers}
15+
16+
<ul>
17+
<li v-for="item in uiSidebar.find(i => i.text === 'Layout Containers').items">
18+
<a :href="item.link">{{ item.text }}</a>
19+
</li>
20+
</ul>
21+
22+
## Navigation Components {#navigation-components}
23+
24+
<ul>
25+
<li v-for="item in uiSidebar.find(i => i.text === 'Navigation Components').items">
26+
<a :href="item.link">{{ item.text }}</a>
27+
</li>
28+
</ul>
29+
30+
## Components {#components}
31+
32+
<ul>
33+
<li v-for="item in uiSidebar.find(i => i.text === 'Components').items">
34+
<a :href="item.link">{{ item.text }}</a>
35+
</li>
36+
</ul>

content/ui/sidebar.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import type { NSSidebarGroup } from '../../.vitepress/theme/vitepress-theme'
2+
3+
export default [
4+
{
5+
text: 'Layout Containers',
6+
link: '/ui/#layout-containers',
7+
items: [
8+
{ text: 'StackLayout', link: '/ui/stack-layout' },
9+
{ text: 'GridLayout', link: '/ui/grid-layout' },
10+
{ text: 'RootLayout', link: '/ui/root-layout' },
11+
{ text: 'FlexboxLayout', link: '/ui/flexbox-layout' },
12+
{ text: 'WrapLayout', link: '/ui/wrap-layout' },
13+
{ text: 'DockLayout', link: '/ui/dock-layout' },
14+
{ text: 'AbsoluteLayout', link: '/ui/absolute-layout' },
15+
],
16+
},
17+
{
18+
text: 'Navigation Components',
19+
link: '/ui/#navigation-containers',
20+
items: [
21+
// { text: 'Frame', link: '//#' },
22+
{ text: 'Page', link: '/ui/page' },
23+
{ text: 'ActionBar', link: '/ui/action-bar' },
24+
// { text: 'ActionItem', link: '//#' },
25+
// { text: 'NavigationButton', link: '//#' },
26+
// todo: move this elsewhere
27+
{
28+
text: 'Showing Modal',
29+
link: '/guide/ui/showing-modal',
30+
},
31+
],
32+
},
33+
{
34+
text: 'Components',
35+
link: '/ui/#components',
36+
items: [
37+
{ text: 'ActivityIndicator', link: '/ui/activity-indicator' },
38+
{ text: 'Button', link: '/ui/button' },
39+
{ text: 'DatePicker', link: '/ui/datepicker' },
40+
{ text: 'HtmlView', link: '/ui/htmlview' },
41+
{ text: 'Image', link: '/ui/image' },
42+
{ text: 'Label', link: '/ui/label' },
43+
{ text: 'ListPicker', link: '/ui/listpicker' },
44+
{ text: 'ListView', link: '/ui/listview' },
45+
{ text: 'Placeholder', link: '/ui/placeholder' },
46+
{ text: 'Progress', link: '/ui/progress' },
47+
{ text: 'ScrollView', link: '/ui/scrollview' },
48+
{ text: 'SearchBar', link: '/ui/searchbar' },
49+
{ text: 'SegmentedBar', link: '/ui/segmentedbar' },
50+
{ text: 'Slider', link: '/ui/slider' },
51+
{ text: 'Switch', link: '/ui/switch' },
52+
{ text: 'TabView', link: '/ui/tabview' },
53+
{ text: 'TextField', link: '/ui/textfield' },
54+
{ text: 'TextView', link: '/ui/textview' },
55+
{ text: 'TimePicker', link: '/ui/timepicker' },
56+
{ text: 'WebView', link: '/ui/webview' },
57+
],
58+
},
59+
] as NSSidebarGroup[]

0 commit comments

Comments
 (0)