Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit e5b09dd

Browse files
committed
docs: migrate and normalize docs
1 parent 7c37bfe commit e5b09dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4118
-13
lines changed

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"allowBranch": "master",
88
"conventionalCommits": true,
99
"exact": true,
10-
"ignoreChanges": ["**/*.md"],
10+
"ignoreChanges": ["**/*.md", "packages/docs/*"],
1111
"message": "build: publish"
1212
}
1313
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
],
66
"scripts": {
77
"build": "yarn workspaces run build",
8+
"build:docs": "yarn workspace docs build",
9+
"dev": "yarn workspace docs dev",
810
"lint": "yarn workspaces run lint",
911
"release": "yarn lerna publish"
1012
},

packages/docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.temp/
2+
dist/

packages/docs/package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "docs",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"build": "vuepress build src --dest dist",
7+
"dev": "vuepress dev src --temp .temp",
8+
"lint": "eslint --ext .js,.vue src/.vuepress",
9+
"serve": "vuepress serve src --dest dist"
10+
},
11+
"eslintConfig": {
12+
"extends": "vuepress",
13+
"root": true
14+
},
15+
"dependencies": {
16+
"@vuepress/plugin-back-to-top": "^1.0.0",
17+
"@vuepress/plugin-medium-zoom": "^1.0.0",
18+
"vuepress": "^1.1.0",
19+
"vuepress-plugin-clean-urls": "^1.0.3",
20+
"vuepress-plugin-container": "^2.0.0",
21+
"vuepress-plugin-copyright": "^1.0.2",
22+
"vuepress-plugin-git-log": "^1.0.0",
23+
"vuepress-plugin-mathjax": "^1.2.8",
24+
"vuepress-plugin-redirect": "^1.1.0",
25+
"vuepress-plugin-serve": "^1.0.1",
26+
"vuepress-plugin-smooth-scroll": "^0.0.4"
27+
}
28+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<template>
2+
<a
3+
class="github-link"
4+
rel="noopener noreferrer"
5+
target="_blank"
6+
:title="repo"
7+
:href="`https://github.com/${repo}`"
8+
>
9+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28">
10+
<path
11+
d="M14 0C6.27 0 0 6.43 0 14.36c0 6.34 4.01 11.72 9.57 13.62.7.13.96-.31.96-.69 0-.34-.01-1.24-.02-2.44-3.89.87-4.72-1.92-4.72-1.92-.64-1.66-1.55-2.1-1.55-2.1-1.27-.89.1-.87.1-.87 1.4.1 2.14 1.48 2.14 1.48 1.25 2.19 3.28 1.56 4.07 1.19.13-.93.49-1.56.89-1.92-3.11-.36-6.38-1.59-6.38-7.09 0-1.57.55-2.85 1.44-3.85-.14-.36-.62-1.82.14-3.8 0 0 1.18-.39 3.85 1.47a12.8 12.8 0 0 1 3.5-.48c1.19.01 2.39.16 3.5.48 2.67-1.86 3.85-1.47 3.85-1.47.76 1.98.28 3.44.14 3.8.9 1 1.44 2.28 1.44 3.85 0 5.51-3.27 6.73-6.39 7.08.5.44.95 1.32.95 2.66 0 1.92-.02 3.47-.02 3.94 0 .38.25.83.96.69C23.99 26.07 28 20.7 28 14.36 28 6.43 21.73 0 14 0z"
12+
fill-rule="evenodd"
13+
clip-rule="evenodd"
14+
/>
15+
</svg>
16+
</a>
17+
</template>
18+
19+
<script>
20+
export default {
21+
name: 'GitHubLink',
22+
23+
props: {
24+
repo: {
25+
type: String,
26+
required: true,
27+
},
28+
},
29+
}
30+
</script>
31+
32+
<style lang="stylus">
33+
34+
.github-link
35+
width 1em
36+
height 1em
37+
text-decoration none
38+
display inline-block
39+
vertical-align -.1em
40+
margin-left 0.6rem
41+
42+
path
43+
fill #666
44+
transition 0.3s ease
45+
&:hover
46+
path
47+
fill #888
48+
</style>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<template>
2+
<a
3+
:href="`https://www.npmjs.com/package/${pkg}`"
4+
:title="pkg"
5+
target="_blank"
6+
rel="noopener noreferrer"
7+
>
8+
<img
9+
class="no-medium-zoom"
10+
:src="`https://img.shields.io/npm/v/${pkg}.svg?style=flat-square`"
11+
alt="npm"
12+
/>
13+
</a>
14+
</template>
15+
16+
<script>
17+
export default {
18+
name: 'NpmLink',
19+
20+
props: {
21+
pkg: {
22+
type: String,
23+
required: true,
24+
},
25+
},
26+
}
27+
</script>

packages/docs/src/.vuepress/config.js

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
const ecosystem = require('./ecosystem')
2+
3+
module.exports = context => ({
4+
head: [
5+
['link', { rel: 'icon', href: '/logo/600x600.png' }],
6+
['meta', { name: 'theme-color', content: '#3eaf7c' }],
7+
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
8+
[
9+
'meta',
10+
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black' },
11+
],
12+
['meta', { name: 'msapplication-TileColor', content: '#000000' }],
13+
],
14+
15+
plugins: [
16+
[
17+
'@vuepress/medium-zoom',
18+
{
19+
selector: '.content img:not(.no-medium-zoom)',
20+
},
21+
],
22+
['@vuepress/back-to-top'],
23+
[
24+
'clean-urls',
25+
{
26+
normalSuffix: '/',
27+
},
28+
],
29+
[
30+
'container',
31+
{
32+
type: 'right',
33+
defaultTitle: '',
34+
},
35+
],
36+
[
37+
'container',
38+
{
39+
type: 'theorem',
40+
before: info => `<div class="theorem"><p class="title">${info}</p>`,
41+
after: '</div>',
42+
},
43+
],
44+
[
45+
'copyright',
46+
{
47+
disabled: true,
48+
authorName: {
49+
'zh-CN': ' VuePress Community ',
50+
'en-US': 'VuePress Community',
51+
},
52+
},
53+
],
54+
['git-log'],
55+
[
56+
'mathjax',
57+
{
58+
macros: {
59+
'\\Z': '\\mathbb{Z}',
60+
},
61+
},
62+
],
63+
['serve'],
64+
[
65+
'redirect',
66+
{
67+
locales: true,
68+
},
69+
],
70+
['smooth-scroll'],
71+
],
72+
73+
locales: {
74+
'/en/': {
75+
lang: 'en-US',
76+
title: 'VuePress Community',
77+
description: 'Community supported ecosystem for VuePress',
78+
},
79+
'/zh/': {
80+
lang: 'zh-CN',
81+
title: 'VuePress 社区',
82+
description: '社区维护的 VuePress 生态系统',
83+
},
84+
},
85+
86+
themeConfig: {
87+
repo: 'vuepress/vuepress-contrib',
88+
editLinks: true,
89+
docsDir: 'packages/docs/src',
90+
locales: {
91+
'/en/': {
92+
label: 'English',
93+
selectText: 'Languages',
94+
editLinkText: 'Edit this page on GitHub',
95+
lastUpdated: 'Last Updated',
96+
},
97+
'/zh/': {
98+
label: '简体中文',
99+
selectText: '选择语言',
100+
editLinkText: '在 GitHub 上编辑此页',
101+
lastUpdated: '上次更新',
102+
},
103+
},
104+
sidebar: {
105+
'/en/': getSidebar('Plugins', 'Themes', 'Tools'),
106+
'/zh/': getSidebar('插件', '主题', '工具'),
107+
},
108+
},
109+
110+
evergreen: () => !context.isProd,
111+
})
112+
113+
const getSidebar = (plugins, themes, tools) => [
114+
{
115+
title: plugins,
116+
collapsable: true,
117+
children: ecosystem.plugins.map(name => `plugins/${name}`),
118+
},
119+
{
120+
title: tools,
121+
collapsable: true,
122+
children: ecosystem.tools.map(name => `tools/${name}`),
123+
},
124+
]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const ecosystem = {
2+
plugins: [
3+
'container',
4+
'copyright',
5+
'clean-urls',
6+
'dehydrate',
7+
'git-log',
8+
'mathjax',
9+
'medium-zoom',
10+
'migrate',
11+
'named-chunks',
12+
'nprogress',
13+
'redirect',
14+
'serve',
15+
'smooth-scroll',
16+
'zooming',
17+
],
18+
themes: [],
19+
tools: ['mergeable'],
20+
}
21+
22+
module.exports = ecosystem
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// index.styl
2+
.theorem
3+
margin 1rem 0
4+
padding .1rem 1.5rem
5+
border-radius 0.4rem
6+
background-color #f0f4f8
7+
.title
8+
font-weight bold
9+
10+
.custom-block
11+
&.right
12+
color transparentify($textColor, 0.4)
13+
font-size 0.9rem
14+
text-align right
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.content
2+
th
3+
text-align center !important
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@require './container'
2+
@require './content'
3+
@require './mathjax'
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
$bdColor = #D6DBDF
2+
3+
.math-block
4+
font-family inherit
5+
padding .1rem 1.5rem
6+
margin 1rem 0
7+
border-left .5rem solid $bdColor
8+
border-radius 0 !important
9+
background-color rgba(102, 128, 153, .05) !important
10+
color $textColor
11+
12+
pre.math-block
13+
white-space pre-wrap
14+
15+
mjx-container[display=true]
16+
&::-webkit-scrollbar
17+
width 1rem
18+
height 0.4rem
19+
20+
&::-webkit-scrollbar-track
21+
background-color: transparent
22+
-webkit-box-shadow: transparent
23+
border-radius: 0.4rem
24+
25+
&::-webkit-scrollbar-thumb
26+
background-color: lighten($bdColor, 20%)
27+
border-radius: 0.4rem
28+
29+
&:hover
30+
&::-webkit-scrollbar-track
31+
background-color: mix($bdColor, transparent, 40%)
32+
-webkit-box-shadow: inset 0 0 0.2rem mix($bdColor, transparent, 80%)
33+
34+
&::-webkit-scrollbar-thumb
35+
background-color: darken($bdColor, 10%)

packages/docs/src/en/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
sidebar: false
3+
---
4+
5+
# VuePress Community
6+
7+
Community supported ecosystem for VuePress.
8+
9+
## Plugins
10+
11+
| Name | Version | Description |
12+
| :-----------------------------------------: | :--------------------------------------------: | :-------------------------------------------------------- |
13+
| [clean-urls](./plugins/clean-urls.md) | <NpmLink pkg="vuepress-plugin-clean-urls"/> | :droplet: Use clean urls in VuePress |
14+
| [container](./plugins/container.md) | <NpmLink pkg="vuepress-plugin-container"/> | :package: Use markdown containers in VuePress |
15+
| [copyright](./plugins/copyright.md) | <NpmLink pkg="vuepress-plugin-copyright"/> | :clipboard: Handle copy behaviors in VuePress |
16+
| [dehydrate](./plugins/dehydrate.md) | <NpmLink pkg="vuepress-plugin-dehydrate"/> | :fire: Dehydrate HTML files in VuePress |
17+
| [git-log](./plugins/git-log.md) | <NpmLink pkg="vuepress-plugin-git-log"/> | :floppy_disk: Integrate git logs into VuePress |
18+
| [mathjax](./plugins/mathjax.md) | <NpmLink pkg="vuepress-plugin-mathjax"/> | :page_with_curl: Use TeX syntax in VuePress |
19+
| [medium-zoom](./plugins/medium-zoom.md) | <NpmLink pkg="vuepress-plugin-medium-zoom"/> | :mag: Make images zoomable in VuePress (with medium-zoom) |
20+
| [migrate](./plugins/migrate.md) | <NpmLink pkg="vuepress-plugin-migrate"/> | :paw_prints: Migrate another website to VuePress |
21+
| [named-chunks](./plugins/named-chunks.md) | <NpmLink pkg="vuepress-plugin-named-chunks"/> | :name_badge: Generate named chunks in VuePress |
22+
| [nprogress](./plugins/nprogress.md) | <NpmLink pkg="vuepress-plugin-nprogress"/> | :running: Show progress bar in VuePress |
23+
| [redirect](./plugins/redirect.md) | <NpmLink pkg="vuepress-plugin-redirect"/> | :traffic_light: Handle redirections in VuePress |
24+
| [serve](./plugins/serve.md) | <NpmLink pkg="vuepress-plugin-serve"/> | :key: Serve generated files in VuePress |
25+
| [smooth-scroll](./plugins/smooth-scroll.md) | <NpmLink pkg="vuepress-plugin-smooth-scroll"/> | :roller_coaster: Make scrolling smooth in VuePress |
26+
| [zooming](./plugins/zooming.md) | <NpmLink pkg="vuepress-plugin-zooming"/> | :mag: Make images zoomable in VuePress (with zooming) |
27+
28+
## Tools
29+
30+
| Name | Version | Description |
31+
| :----------------------------------------: | :---------------------------------: | :---------------------------------------------------------------- |
32+
| [vuepress-mergeable](./tools/mergeable.md) | <NpmLink pkg="vuepress-mergeable"/> | :crystal_ball: Customize how a VuePress plugin merges its options |

0 commit comments

Comments
 (0)