create-docusaurus 0.0.1 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -5
- package/bin/index.js +56 -1
- package/lib/.tsbuildinfo +1 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +235 -0
- package/package.json +19 -3
- package/src/index.ts +289 -0
- package/templates/README.md +8 -0
- package/templates/classic/docusaurus.config.js +118 -0
- package/templates/classic/package.json +40 -0
- package/templates/classic/src/components/HomepageFeatures.js +64 -0
- package/templates/classic/src/components/HomepageFeatures.module.css +11 -0
- package/templates/classic/src/css/custom.css +28 -0
- package/templates/classic/src/pages/index.js +40 -0
- package/templates/classic/src/pages/index.module.css +23 -0
- package/templates/classic-typescript/package.json +46 -0
- package/templates/classic-typescript/src/components/HomepageFeatures.tsx +76 -0
- package/templates/classic-typescript/src/pages/index.tsx +40 -0
- package/templates/classic-typescript/tsconfig.json +7 -0
- package/templates/facebook/.eslintrc.js +60 -0
- package/templates/facebook/.prettierignore +3 -0
- package/templates/facebook/.prettierrc +9 -0
- package/templates/facebook/.stylelintrc.js +13 -0
- package/templates/facebook/README.md +41 -0
- package/templates/facebook/babel.config.js +12 -0
- package/templates/facebook/docusaurus.config.js +152 -0
- package/templates/facebook/gitignore +23 -0
- package/templates/facebook/package.json +56 -0
- package/templates/facebook/sidebars.js +35 -0
- package/templates/facebook/src/css/custom.css +33 -0
- package/templates/facebook/src/pages/index.js +111 -0
- package/templates/facebook/src/pages/styles.module.css +44 -0
- package/templates/facebook/static/img/oss_logo.png +0 -0
- package/templates/shared/README.md +33 -0
- package/templates/shared/babel.config.js +3 -0
- package/templates/shared/blog/2019-05-28-first-blog-post.md +12 -0
- package/templates/shared/blog/2019-05-29-long-blog-post.md +44 -0
- package/templates/shared/blog/2021-08-01-mdx-blog-post.mdx +20 -0
- package/templates/shared/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
- package/templates/shared/blog/2021-08-26-welcome/index.md +25 -0
- package/templates/shared/blog/authors.yml +17 -0
- package/templates/shared/docs/intro.md +35 -0
- package/templates/shared/docs/tutorial-basics/_category_.json +4 -0
- package/templates/shared/docs/tutorial-basics/congratulations.md +21 -0
- package/templates/shared/docs/tutorial-basics/create-a-blog-post.md +34 -0
- package/templates/shared/docs/tutorial-basics/create-a-document.md +55 -0
- package/templates/shared/docs/tutorial-basics/create-a-page.md +43 -0
- package/templates/shared/docs/tutorial-basics/deploy-your-site.md +31 -0
- package/templates/shared/docs/tutorial-basics/markdown-features.mdx +144 -0
- package/templates/shared/docs/tutorial-extras/_category_.json +4 -0
- package/templates/shared/docs/tutorial-extras/manage-docs-versions.md +55 -0
- package/templates/shared/docs/tutorial-extras/translate-your-site.md +88 -0
- package/templates/shared/gitignore +20 -0
- package/templates/shared/sidebars.js +26 -0
- package/templates/shared/src/pages/markdown-page.md +7 -0
- package/templates/shared/static/.nojekyll +0 -0
- package/templates/shared/static/img/docusaurus.png +0 -0
- package/templates/shared/static/img/favicon.ico +0 -0
- package/templates/shared/static/img/logo.svg +1 -0
- package/templates/shared/static/img/tutorial/docsVersionDropdown.png +0 -0
- package/templates/shared/static/img/tutorial/localeDropdown.png +0 -0
- package/templates/shared/static/img/undraw_docusaurus_mountain.svg +170 -0
- package/templates/shared/static/img/undraw_docusaurus_react.svg +169 -0
- package/templates/shared/static/img/undraw_docusaurus_tree.svg +1 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
import styles from './HomepageFeatures.module.css';
|
|
10
|
+
|
|
11
|
+
type FeatureItem = {
|
|
12
|
+
title: string;
|
|
13
|
+
image: string;
|
|
14
|
+
description: JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const FeatureList: FeatureItem[] = [
|
|
18
|
+
{
|
|
19
|
+
title: 'Easy to Use',
|
|
20
|
+
image: '/img/undraw_docusaurus_mountain.svg',
|
|
21
|
+
description: (
|
|
22
|
+
<>
|
|
23
|
+
Docusaurus was designed from the ground up to be easily installed and
|
|
24
|
+
used to get your website up and running quickly.
|
|
25
|
+
</>
|
|
26
|
+
),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
title: 'Focus on What Matters',
|
|
30
|
+
image: '/img/undraw_docusaurus_tree.svg',
|
|
31
|
+
description: (
|
|
32
|
+
<>
|
|
33
|
+
Docusaurus lets you focus on your docs, and we'll do the chores. Go
|
|
34
|
+
ahead and move your docs into the <code>docs</code> directory.
|
|
35
|
+
</>
|
|
36
|
+
),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: 'Powered by React',
|
|
40
|
+
image: '/img/undraw_docusaurus_react.svg',
|
|
41
|
+
description: (
|
|
42
|
+
<>
|
|
43
|
+
Extend or customize your website layout by reusing React. Docusaurus can
|
|
44
|
+
be extended while reusing the same header and footer.
|
|
45
|
+
</>
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
function Feature({title, image, description}: FeatureItem) {
|
|
51
|
+
return (
|
|
52
|
+
<div className={clsx('col col--4')}>
|
|
53
|
+
<div className="text--center">
|
|
54
|
+
<img className={styles.featureSvg} alt={title} src={image} />
|
|
55
|
+
</div>
|
|
56
|
+
<div className="text--center padding-horiz--md">
|
|
57
|
+
<h3>{title}</h3>
|
|
58
|
+
<p>{description}</p>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default function HomepageFeatures(): JSX.Element {
|
|
65
|
+
return (
|
|
66
|
+
<section className={styles.features}>
|
|
67
|
+
<div className="container">
|
|
68
|
+
<div className="row">
|
|
69
|
+
{FeatureList.map((props, idx) => (
|
|
70
|
+
<Feature key={idx} {...props} />
|
|
71
|
+
))}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</section>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import Layout from '@theme/Layout';
|
|
4
|
+
import Link from '@docusaurus/Link';
|
|
5
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
6
|
+
import styles from './index.module.css';
|
|
7
|
+
import HomepageFeatures from '../components/HomepageFeatures';
|
|
8
|
+
|
|
9
|
+
function HomepageHeader() {
|
|
10
|
+
const {siteConfig} = useDocusaurusContext();
|
|
11
|
+
return (
|
|
12
|
+
<header className={clsx('hero hero--primary', styles.heroBanner)}>
|
|
13
|
+
<div className="container">
|
|
14
|
+
<h1 className="hero__title">{siteConfig.title}</h1>
|
|
15
|
+
<p className="hero__subtitle">{siteConfig.tagline}</p>
|
|
16
|
+
<div className={styles.buttons}>
|
|
17
|
+
<Link
|
|
18
|
+
className="button button--secondary button--lg"
|
|
19
|
+
to="/docs/intro">
|
|
20
|
+
Docusaurus Tutorial - 5min ⏱️
|
|
21
|
+
</Link>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</header>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function Home(): JSX.Element {
|
|
29
|
+
const {siteConfig} = useDocusaurusContext();
|
|
30
|
+
return (
|
|
31
|
+
<Layout
|
|
32
|
+
title={`Hello from ${siteConfig.title}`}
|
|
33
|
+
description="Description will go into a meta tag in <head />">
|
|
34
|
+
<HomepageHeader />
|
|
35
|
+
<main>
|
|
36
|
+
<HomepageFeatures />
|
|
37
|
+
</main>
|
|
38
|
+
</Layout>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const OFF = 0;
|
|
11
|
+
const WARNING = 1;
|
|
12
|
+
const ERROR = 2;
|
|
13
|
+
|
|
14
|
+
module.exports = {
|
|
15
|
+
root: true,
|
|
16
|
+
env: {
|
|
17
|
+
browser: true,
|
|
18
|
+
commonjs: true,
|
|
19
|
+
jest: true,
|
|
20
|
+
node: true,
|
|
21
|
+
},
|
|
22
|
+
parser: '@babel/eslint-parser',
|
|
23
|
+
parserOptions: {
|
|
24
|
+
allowImportExportEverywhere: true,
|
|
25
|
+
},
|
|
26
|
+
extends: ['airbnb', 'prettier', 'prettier/react'],
|
|
27
|
+
plugins: ['react-hooks', 'header'],
|
|
28
|
+
rules: {
|
|
29
|
+
// Ignore certain webpack alias because it can't be resolved
|
|
30
|
+
'import/no-unresolved': [
|
|
31
|
+
ERROR,
|
|
32
|
+
{ignore: ['^@theme', '^@docusaurus', '^@generated']},
|
|
33
|
+
],
|
|
34
|
+
'import/extensions': OFF,
|
|
35
|
+
'header/header': [
|
|
36
|
+
ERROR,
|
|
37
|
+
'block',
|
|
38
|
+
|
|
39
|
+
[
|
|
40
|
+
'*',
|
|
41
|
+
' * Copyright (c) Facebook, Inc. and its affiliates.',
|
|
42
|
+
' *',
|
|
43
|
+
' * This source code is licensed under the MIT license found in the',
|
|
44
|
+
' * LICENSE file in the root directory of this source tree.',
|
|
45
|
+
' *',
|
|
46
|
+
// Unfortunately eslint-plugin-header doesn't support optional lines.
|
|
47
|
+
// If you want to enforce your website JS files to have @flow or @format,
|
|
48
|
+
// modify these lines accordingly.
|
|
49
|
+
{
|
|
50
|
+
pattern: '.* @format',
|
|
51
|
+
},
|
|
52
|
+
' ',
|
|
53
|
+
],
|
|
54
|
+
],
|
|
55
|
+
'react/jsx-closing-bracket-location': OFF, // Conflicts with Prettier.
|
|
56
|
+
'react/jsx-filename-extension': OFF,
|
|
57
|
+
'react-hooks/rules-of-hooks': ERROR,
|
|
58
|
+
'react/prop-types': OFF, // PropTypes aren't used much these days.
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
plugins: ['stylelint-copyright'],
|
|
10
|
+
rules: {
|
|
11
|
+
'docusaurus/copyright-header': true,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Website
|
|
2
|
+
|
|
3
|
+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
|
|
4
|
+
|
|
5
|
+
### Installation
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
$ yarn
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Local Development
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
$ yarn start
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
|
18
|
+
|
|
19
|
+
### Build
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
$ yarn build
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
|
26
|
+
|
|
27
|
+
### Deployment
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
|
34
|
+
|
|
35
|
+
### Continuous Integration
|
|
36
|
+
|
|
37
|
+
Some common defaults for linting/formatting have been set for you. If you integrate your project with an open source Continuous Integration system (e.g. Travis CI, CircleCI), you may check for issues using the following command.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
$ yarn ci
|
|
41
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
module.exports = {
|
|
11
|
+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
|
|
12
|
+
};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
// @ts-check
|
|
10
|
+
// Note: type annotations allow type checking and IDEs autocompletion
|
|
11
|
+
|
|
12
|
+
/** @type {import('@docusaurus/types').Config} */
|
|
13
|
+
const config = {
|
|
14
|
+
title: 'My Site',
|
|
15
|
+
tagline: 'The tagline of my site',
|
|
16
|
+
url: 'https://your-docusaurus-test-site.com',
|
|
17
|
+
baseUrl: '/',
|
|
18
|
+
onBrokenLinks: 'throw',
|
|
19
|
+
onBrokenMarkdownLinks: 'warn',
|
|
20
|
+
favicon: 'img/favicon.ico',
|
|
21
|
+
organizationName: 'facebook', // Usually your GitHub org/user name.
|
|
22
|
+
projectName: 'docusaurus', // Usually your repo name.
|
|
23
|
+
|
|
24
|
+
presets: [
|
|
25
|
+
[
|
|
26
|
+
'@docusaurus/preset-classic',
|
|
27
|
+
/** @type {import('@docusaurus/preset-classic').Options} */
|
|
28
|
+
({
|
|
29
|
+
docs: {
|
|
30
|
+
sidebarPath: require.resolve('./sidebars.js'),
|
|
31
|
+
// Please change this to your repo.
|
|
32
|
+
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
|
33
|
+
},
|
|
34
|
+
blog: {
|
|
35
|
+
showReadingTime: true,
|
|
36
|
+
// Please change this to your repo.
|
|
37
|
+
editUrl:
|
|
38
|
+
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
|
|
39
|
+
},
|
|
40
|
+
theme: {
|
|
41
|
+
customCss: require.resolve('./src/css/custom.css'),
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
45
|
+
],
|
|
46
|
+
|
|
47
|
+
themeConfig:
|
|
48
|
+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
|
|
49
|
+
({
|
|
50
|
+
navbar: {
|
|
51
|
+
title: 'My Facebook Project',
|
|
52
|
+
logo: {
|
|
53
|
+
alt: 'My Facebook Project Logo',
|
|
54
|
+
src: 'img/logo.svg',
|
|
55
|
+
},
|
|
56
|
+
items: [
|
|
57
|
+
{
|
|
58
|
+
type: 'doc',
|
|
59
|
+
docId: 'intro',
|
|
60
|
+
position: 'left',
|
|
61
|
+
label: 'Tutorial',
|
|
62
|
+
},
|
|
63
|
+
{to: 'blog', label: 'Blog', position: 'left'},
|
|
64
|
+
// Please keep GitHub link to the right for consistency.
|
|
65
|
+
{
|
|
66
|
+
href: 'https://github.com/facebook/docusaurus',
|
|
67
|
+
label: 'GitHub',
|
|
68
|
+
position: 'right',
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
footer: {
|
|
73
|
+
style: 'dark',
|
|
74
|
+
links: [
|
|
75
|
+
{
|
|
76
|
+
title: 'Learn',
|
|
77
|
+
items: [
|
|
78
|
+
{
|
|
79
|
+
label: 'Style Guide',
|
|
80
|
+
to: 'docs/',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'Second Doc',
|
|
84
|
+
to: 'docs/doc2',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
title: 'Community',
|
|
90
|
+
items: [
|
|
91
|
+
{
|
|
92
|
+
label: 'Stack Overflow',
|
|
93
|
+
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
label: 'Twitter',
|
|
97
|
+
href: 'https://twitter.com/docusaurus',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: 'Discord',
|
|
101
|
+
href: 'https://discordapp.com/invite/docusaurus',
|
|
102
|
+
},
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
title: 'More',
|
|
107
|
+
items: [
|
|
108
|
+
{
|
|
109
|
+
label: 'Blog',
|
|
110
|
+
to: 'blog',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: 'GitHub',
|
|
114
|
+
href: 'https://github.com/facebook/docusaurus',
|
|
115
|
+
},
|
|
116
|
+
],
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: 'Legal',
|
|
120
|
+
// Please do not remove the privacy and terms, it's a legal requirement.
|
|
121
|
+
items: [
|
|
122
|
+
{
|
|
123
|
+
label: 'Privacy',
|
|
124
|
+
href: 'https://opensource.facebook.com/legal/privacy/',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: 'Terms',
|
|
128
|
+
href: 'https://opensource.facebook.com/legal/terms/',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: 'Data Policy',
|
|
132
|
+
href: 'https://opensource.facebook.com/legal/data-policy/',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: 'Cookie Policy',
|
|
136
|
+
href: 'https://opensource.facebook.com/legal/cookie-policy/',
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
logo: {
|
|
142
|
+
alt: 'Facebook Open Source Logo',
|
|
143
|
+
src: 'img/oss_logo.png',
|
|
144
|
+
href: 'https://opensource.facebook.com',
|
|
145
|
+
},
|
|
146
|
+
// Please do not remove the credits, help to publicize Docusaurus :)
|
|
147
|
+
copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc. Built with Docusaurus.`,
|
|
148
|
+
},
|
|
149
|
+
}),
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
module.exports = config;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
/node_modules
|
|
3
|
+
|
|
4
|
+
# Production
|
|
5
|
+
/build
|
|
6
|
+
|
|
7
|
+
# Generated files
|
|
8
|
+
.docusaurus
|
|
9
|
+
.cache-loader
|
|
10
|
+
|
|
11
|
+
# Misc
|
|
12
|
+
.DS_Store
|
|
13
|
+
.env.local
|
|
14
|
+
.env.development.local
|
|
15
|
+
.env.test.local
|
|
16
|
+
.env.production.local
|
|
17
|
+
|
|
18
|
+
npm-debug.log*
|
|
19
|
+
yarn-debug.log*
|
|
20
|
+
yarn-error.log*
|
|
21
|
+
|
|
22
|
+
# ESLint
|
|
23
|
+
.eslintcache
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docusaurus-2-facebook-template",
|
|
3
|
+
"version": "2.0.0-beta.6",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"docusaurus": "docusaurus",
|
|
7
|
+
"start": "docusaurus start",
|
|
8
|
+
"build": "docusaurus build",
|
|
9
|
+
"swizzle": "docusaurus swizzle",
|
|
10
|
+
"deploy": "docusaurus deploy",
|
|
11
|
+
"clear": "docusaurus clear",
|
|
12
|
+
"serve": "docusaurus serve",
|
|
13
|
+
"write-translations": "docusaurus write-translations",
|
|
14
|
+
"write-heading-ids": "docusaurus write-heading-ids",
|
|
15
|
+
"ci": "yarn lint && yarn prettier:diff",
|
|
16
|
+
"lint": "eslint --cache \"**/*.js\" && stylelint \"**/*.css\"",
|
|
17
|
+
"prettier": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx,md,mdx}\"",
|
|
18
|
+
"prettier:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,md,mdx}\""
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@docusaurus/core": "2.0.0-beta.6",
|
|
22
|
+
"@docusaurus/preset-classic": "2.0.0-beta.6",
|
|
23
|
+
"@mdx-js/react": "^1.6.21",
|
|
24
|
+
"@svgr/webpack": "^5.5.0",
|
|
25
|
+
"clsx": "^1.1.1",
|
|
26
|
+
"file-loader": "^6.2.0",
|
|
27
|
+
"react": "^17.0.1",
|
|
28
|
+
"react-dom": "^17.0.1",
|
|
29
|
+
"url-loader": "^4.1.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@babel/eslint-parser": "^7.15.7",
|
|
33
|
+
"eslint": "^7.20.0",
|
|
34
|
+
"eslint-config-airbnb": "^18.2.1",
|
|
35
|
+
"eslint-config-prettier": "^6.15.0",
|
|
36
|
+
"eslint-plugin-header": "^3.0.0",
|
|
37
|
+
"eslint-plugin-import": "^2.22.1",
|
|
38
|
+
"eslint-plugin-jsx-a11y": "^6.4.1",
|
|
39
|
+
"eslint-plugin-react": "^7.21.5",
|
|
40
|
+
"eslint-plugin-react-hooks": "^4.2.0",
|
|
41
|
+
"prettier": "^2.2.1",
|
|
42
|
+
"stylelint": "^13.2.1"
|
|
43
|
+
},
|
|
44
|
+
"browserslist": {
|
|
45
|
+
"production": [
|
|
46
|
+
">0.5%",
|
|
47
|
+
"not dead",
|
|
48
|
+
"not op_mini all"
|
|
49
|
+
],
|
|
50
|
+
"development": [
|
|
51
|
+
"last 1 chrome version",
|
|
52
|
+
"last 1 firefox version",
|
|
53
|
+
"last 1 safari version"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Creating a sidebar enables you to:
|
|
12
|
+
- create an ordered group of docs
|
|
13
|
+
- render a sidebar for each doc of that group
|
|
14
|
+
- provide next/previous navigation
|
|
15
|
+
|
|
16
|
+
The sidebars can be generated from the filesystem, or explicitly defined here.
|
|
17
|
+
|
|
18
|
+
Create as many sidebars as you want.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
module.exports = {
|
|
22
|
+
// By default, Docusaurus generates a sidebar from the docs folder structure
|
|
23
|
+
tutorialSidebar: [{type: 'autogenerated', dirName: '.'}],
|
|
24
|
+
|
|
25
|
+
// But you can create a sidebar manually
|
|
26
|
+
/*
|
|
27
|
+
tutorialSidebar: [
|
|
28
|
+
{
|
|
29
|
+
type: 'category',
|
|
30
|
+
label: 'Tutorial',
|
|
31
|
+
items: ['hello'],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
*/
|
|
35
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Any CSS included here will be global. The classic template
|
|
12
|
+
* bundles Infima by default. Infima is a CSS framework designed to
|
|
13
|
+
* work well for content-centric websites.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/* You can override the default Infima variables here. */
|
|
17
|
+
:root {
|
|
18
|
+
--ifm-color-primary: #25c2a0;
|
|
19
|
+
--ifm-color-primary-dark: rgb(33, 175, 144);
|
|
20
|
+
--ifm-color-primary-darker: rgb(31, 165, 136);
|
|
21
|
+
--ifm-color-primary-darkest: rgb(26, 136, 112);
|
|
22
|
+
--ifm-color-primary-light: rgb(70, 203, 174);
|
|
23
|
+
--ifm-color-primary-lighter: rgb(102, 212, 189);
|
|
24
|
+
--ifm-color-primary-lightest: rgb(146, 224, 208);
|
|
25
|
+
--ifm-code-font-size: 95%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.docusaurus-highlight-code-line {
|
|
29
|
+
background-color: rgb(72, 77, 91);
|
|
30
|
+
display: block;
|
|
31
|
+
margin: 0 calc(-1 * var(--ifm-pre-padding));
|
|
32
|
+
padding: 0 var(--ifm-pre-padding);
|
|
33
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import clsx from 'clsx';
|
|
12
|
+
import Layout from '@theme/Layout';
|
|
13
|
+
import Link from '@docusaurus/Link';
|
|
14
|
+
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|
15
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
16
|
+
import styles from './styles.module.css';
|
|
17
|
+
|
|
18
|
+
const features = [
|
|
19
|
+
{
|
|
20
|
+
title: 'Easy to Use',
|
|
21
|
+
imageUrl: 'img/undraw_docusaurus_mountain.svg',
|
|
22
|
+
description: (
|
|
23
|
+
<>
|
|
24
|
+
Docusaurus was designed from the ground up to be easily installed and
|
|
25
|
+
used to get your website up and running quickly.
|
|
26
|
+
</>
|
|
27
|
+
),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: 'Focus on What Matters',
|
|
31
|
+
imageUrl: 'img/undraw_docusaurus_tree.svg',
|
|
32
|
+
description: (
|
|
33
|
+
<>
|
|
34
|
+
Docusaurus lets you focus on your docs, and we'll do the chores. Go
|
|
35
|
+
ahead and move your docs into the <code>docs</code> directory.
|
|
36
|
+
</>
|
|
37
|
+
),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
title: 'Powered by React',
|
|
41
|
+
imageUrl: 'img/undraw_docusaurus_react.svg',
|
|
42
|
+
description: (
|
|
43
|
+
<>
|
|
44
|
+
Extend or customize your website layout by reusing React. Docusaurus can
|
|
45
|
+
be extended while reusing the same header and footer.
|
|
46
|
+
</>
|
|
47
|
+
),
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
function Feature({imageUrl, title, description}) {
|
|
52
|
+
const imgUrl = useBaseUrl(imageUrl);
|
|
53
|
+
return (
|
|
54
|
+
<div className={clsx('col col--4', styles.feature)}>
|
|
55
|
+
{imgUrl && (
|
|
56
|
+
<div className="text--center">
|
|
57
|
+
<img className={styles.featureImage} src={imgUrl} alt={title} />
|
|
58
|
+
</div>
|
|
59
|
+
)}
|
|
60
|
+
<h3>{title}</h3>
|
|
61
|
+
<p>{description}</p>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default function Home() {
|
|
67
|
+
const context = useDocusaurusContext();
|
|
68
|
+
const {siteConfig = {}} = context;
|
|
69
|
+
return (
|
|
70
|
+
<Layout
|
|
71
|
+
title={`Hello from ${siteConfig.title}`}
|
|
72
|
+
description="Description will go into a meta tag in <head />"
|
|
73
|
+
>
|
|
74
|
+
<header className={clsx('hero hero--primary', styles.heroBanner)}>
|
|
75
|
+
<div className="container">
|
|
76
|
+
<h1 className="hero__title">{siteConfig.title}</h1>
|
|
77
|
+
<p className="hero__subtitle">{siteConfig.tagline}</p>
|
|
78
|
+
<div className={styles.buttons}>
|
|
79
|
+
<Link
|
|
80
|
+
className={clsx(
|
|
81
|
+
'button button--outline button--secondary button--lg',
|
|
82
|
+
styles.getStarted,
|
|
83
|
+
)}
|
|
84
|
+
to={useBaseUrl('docs/')}
|
|
85
|
+
>
|
|
86
|
+
Get Started
|
|
87
|
+
</Link>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</header>
|
|
91
|
+
<main>
|
|
92
|
+
{features && features.length > 0 && (
|
|
93
|
+
<section className={styles.features}>
|
|
94
|
+
<div className="container">
|
|
95
|
+
<div className="row">
|
|
96
|
+
{features.map(({title, imageUrl, description}) => (
|
|
97
|
+
<Feature
|
|
98
|
+
key={title}
|
|
99
|
+
title={title}
|
|
100
|
+
imageUrl={imageUrl}
|
|
101
|
+
description={description}
|
|
102
|
+
/>
|
|
103
|
+
))}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</section>
|
|
107
|
+
)}
|
|
108
|
+
</main>
|
|
109
|
+
</Layout>
|
|
110
|
+
);
|
|
111
|
+
}
|