Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
liwuhou committed Dec 11, 2023
1 parent dd0d46a commit 193b07a
Show file tree
Hide file tree
Showing 15 changed files with 3,110 additions and 2,562 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ coverage
dist
.temp
.cache
cache

.DS_Store
.history
.vscode
.vscode
19 changes: 19 additions & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { defineConfig } from 'vitepress'
import { nav, sidebar } from '../config'
console.log('🤔 ~ file: config.ts:3 ~ nav:', nav)

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'Fuxk-leetcode',
description: '手撕 Leetcode 算法题',
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav,

sidebar,

socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' },
],
},
})
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# fuxk-leetcode

手撕 leetcode(小声)

run

```bash
yarn install
pnpm install

yarn dev
pnpm run dev
```
49 changes: 49 additions & 0 deletions api-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
outline: deep
---

# Runtime API Examples

This page demonstrates usage of some of the runtime APIs provided by VitePress.

The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:

```md
<script setup>
import { useData } from 'vitepress'

const { theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>
```

<script setup>
import { useData } from 'vitepress'

const { site, theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>

## More

Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
4 changes: 2 additions & 2 deletions config/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * as navbar from './navbar'
export * as sidebar from './sidebar'
export * from './nav'
export * from './sidebar'
4 changes: 2 additions & 2 deletions config/navbar/zh.ts → config/nav/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { NavbarConfig } from '@vuepress/theme-default'
import type { DefaultTheme } from 'vitepress'

export const zh: NavbarConfig = [
export const nav: DefaultTheme.NavItem[] = [
{
link: '/structure/stack.html',
text: '数据结构',
Expand Down
1 change: 0 additions & 1 deletion config/navbar/index.ts

This file was deleted.

19 changes: 18 additions & 1 deletion config/sidebar/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
export * from './zh'
import type { DefaultTheme } from 'vitepress'
import { getDocsFiles } from '../../utils'

export const sidebar: DefaultTheme.Sidebar = {
'/structure/': [
{
text: '数据结构',
collapsed: true,
items: getDocsFiles('structure'),
},
],
'/basic/': [
{
text: '算法题',
items: getDocsFiles('basic'),
},
],
}
33 changes: 0 additions & 33 deletions config/sidebar/zh.ts

This file was deleted.

27 changes: 27 additions & 0 deletions index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: 'Fuxk-leetcode'
text: '手撕 Leetcode 算法题'
# tagline: My great project tagline
image:
src: /resource/images/logo.png
alt: Fuxk-leetcode
actions:
- theme: brand
text: Markdown Examples
link: /markdown-examples
- theme: alt
text: API Examples
link: /api-examples

features:
- title: Feature A
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature B
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature C
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
---
85 changes: 85 additions & 0 deletions markdown-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Markdown Extension Examples

This page demonstrates some of the built-in markdown extensions provided by VitePress.

## Syntax Highlighting

VitePress provides Syntax Highlighting powered by [Shikiji](https://github.com/antfu/shikiji), with additional features like line-highlighting:

**Input**

````md
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
````

**Output**

```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```

## Custom Containers

**Input**

```md
::: info
This is an info box.
:::

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a dangerous warning.
:::

::: details
This is a details block.
:::
```

**Output**

::: info
This is an info box.
:::

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a dangerous warning.
:::

::: details
This is a details block.
:::

## More

Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
32 changes: 19 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
{
"name": "fuxk-leetcode",
"type": "module",
"version": "0.0.1",
"repository": "git@github.com:liwuhou/fuxk-leetcode.git",
"author": "阿五 <hugewilliam@foxmail.com>",
"license": "MIT",
"scripts": {
"preinstall": "npx pm-keeper pnpm",
"test": "jest ./code",
"dev": "vuepress dev docs --config vuepress.config.ts",
"build": "vuepress build docs --config vuepress.config.ts"
"start": "vuepress dev docs --config vuepress.config.ts",
"build": "vuepress build docs --config vuepress.config.ts",
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
},
"devDependencies": {
"@babel/core": "^7.16.12",
"@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7",
"@types/jest": "^27.4.0",
"@vuepress/bundler-vite": "^2.0.0-beta.35",
"babel-jest": "^27.4.6",
"jest": "^27.4.7",
"ts-node": "^10.4.0",
"typescript": "^4.5.5",
"vuepress": "^2.0.0-beta.35"
"@babel/core": "^7.23.5",
"@babel/preset-env": "^7.23.5",
"@babel/preset-typescript": "^7.23.3",
"@types/jest": "^27.5.2",
"@vuepress/bundler-vite": "2.0.0-rc.0",
"@vuepress/cli": "2.0.0-rc.0",
"babel-jest": "^27.5.1",
"jest": "^27.5.1",
"ts-node": "^10.9.2",
"typescript": "^4.9.5",
"vitepress": "1.0.0-rc.31",
"vuepress": "2.0.0-rc.0"
}
}
}
Loading

0 comments on commit 193b07a

Please sign in to comment.