-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
446 additions
and
770 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { defineConfig, type DefaultTheme } from 'vitepress' | ||
|
||
const sidebar: DefaultTheme.Config['sidebar'] = { | ||
'/': [ | ||
{ | ||
text: 'Frontmatter', | ||
collapsible: true, | ||
items: [ | ||
{ | ||
text: 'Multiple Levels Outline', | ||
link: '/frontmatter/multiple-levels-outline' | ||
} | ||
] | ||
}, | ||
{ | ||
text: '& <Text Literals &> <code>code</code>', | ||
items: [ | ||
{ | ||
text: '& <Test Page &> <code>code</code>', | ||
link: '/text-literals/' | ||
} | ||
] | ||
}, | ||
{ | ||
text: 'Static Data', | ||
items: [ | ||
{ | ||
text: 'Test Page', | ||
link: '/static-data/data' | ||
} | ||
] | ||
}, | ||
{ | ||
text: 'Multi Sidebar Test', | ||
items: [ | ||
{ | ||
text: 'Test Page', | ||
link: '/multi-sidebar/' | ||
} | ||
] | ||
} | ||
], | ||
'/multi-sidebar/': [ | ||
{ | ||
text: 'Multi Sidebar', | ||
items: [ | ||
{ | ||
text: 'Test Page', | ||
link: '/multi-sidebar/' | ||
}, | ||
{ | ||
text: 'Back', | ||
link: '/' | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
||
export default defineConfig({ | ||
title: 'Example', | ||
description: 'An example app using VitePress.', | ||
themeConfig: { | ||
sidebar | ||
} | ||
}) |
3 changes: 1 addition & 2 deletions
3
...test__/__snapshots__/content.spec.ts.snap → ...ts__/e2e/__snapshots__/index.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
--- | ||
title: Multiple Levels Outline | ||
editLink: true | ||
outline: 'deep' | ||
--- | ||
|
||
# h1 - 1 | ||
|
||
Lorem ipsum | ||
|
||
## h2 - 1 | ||
|
||
Lorem ipsum | ||
|
||
### h3 - 1 | ||
|
||
Lorem ipsum | ||
|
||
#### h4 - 1 | ||
|
||
Lorem ipsum | ||
|
||
### h3 - 2 | ||
|
||
Lorem ipsum | ||
|
||
#### h4 - 2 | ||
|
||
Lorem ipsum | ||
|
||
## h2 - 2 | ||
|
||
Lorem ipsum | ||
|
||
### h3 - 3 | ||
|
||
Lorem ipsum | ||
|
||
#### h4 - 3 | ||
|
||
Lorem ipsum |
12 changes: 2 additions & 10 deletions
12
examples/configured/__test__/outline.spec.ts → ...ontmatter/multiple-levels-outline.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
17 changes: 7 additions & 10 deletions
17
examples/minimal/__test__/content.spec.ts → __tests__/e2e/index.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Multi Sidebar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
describe('test multi sidebar sort root', () => { | ||
beforeAll(async () => { | ||
await goto('/frontmatter/multiple-levels-outline') | ||
}) | ||
|
||
test('using / sidebar', async () => { | ||
const sidebarLocator = page.locator('.VPSidebarGroup .title-text') | ||
|
||
const sidebarContent = await sidebarLocator.allTextContents() | ||
expect(sidebarContent).toEqual([ | ||
'Frontmatter', | ||
'& <Text Literals &> code', | ||
'Static Data', | ||
'Multi Sidebar Test' | ||
]) | ||
}) | ||
}) | ||
|
||
describe('test multi sidebar sort order', () => { | ||
beforeAll(async () => { | ||
await goto('/multi-sidebar/') | ||
}) | ||
|
||
test('using /multi-sidebar/ sidebar', async () => { | ||
const sidebarLocator = page.locator('.VPSidebarGroup .title-text') | ||
|
||
const sidebarContent = await sidebarLocator.allTextContents() | ||
expect(sidebarContent).toEqual(['Multi Sidebar']) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{ | ||
"name": "vitepress-examples", | ||
"private": true, | ||
"devDependencies": { | ||
"vitepress": "workspace:*" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { type Page } from 'playwright-chromium' | ||
|
||
declare global { | ||
var page: Page | ||
var goto: (path: string) => Promise<void> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`static data file support in vite 3 > render correct content 1`] = ` | ||
[ | ||
"[ | ||
{ | ||
\\"foo\\": true | ||
}, | ||
{ | ||
\\"bar\\": true | ||
} | ||
]", | ||
] | ||
`; |
4 changes: 3 additions & 1 deletion
4
examples/configured/static-data/data.md → __tests__/e2e/static-data/data.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<script setup> | ||
# Static Data | ||
|
||
<script setup lang="ts"> | ||
import { data } from './static.data.js' | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
describe('static data file support in vite 3', () => { | ||
beforeAll(async () => { | ||
await goto('/static-data/data') | ||
}) | ||
|
||
test('render correct content', async () => { | ||
const pLocator = page.locator('.VPContent p') | ||
|
||
const pContents = await pLocator.allTextContents() | ||
expect(pContents).toMatchSnapshot() | ||
}) | ||
}) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Text Literals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from 'vitest/config' | ||
|
||
const timeout = 60_000 | ||
|
||
export default defineConfig({ | ||
test: { | ||
setupFiles: ['vitestSetup.ts'], | ||
globalSetup: ['__tests__/e2e/vitestGlobalSetup.ts'], | ||
testTimeout: timeout, | ||
hookTimeout: timeout, | ||
teardownTimeout: timeout, | ||
globals: true | ||
} | ||
}) |
Oops, something went wrong.