create-docusaurus 0.0.2 → 0.0.3
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 +12 -4
- package/bin/index.js +2 -2
- package/package.json +2 -1
- package/templates/README.md +1 -1
- package/templates/facebook/src/pages/index.js +4 -2
- package/templates/shared/docs/intro.md +1 -1
- package/templates/bootstrap/docusaurus.config.js +0 -93
- package/templates/bootstrap/package.json +0 -39
- package/templates/bootstrap/src/pages/index.js +0 -87
- package/templates/bootstrap/src/pages/styles.module.css +0 -49
package/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `create-docusaurus`
|
|
2
2
|
|
|
3
|
-
Create Docusaurus apps easily
|
|
3
|
+
Create Docusaurus apps easily with simplified commands:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm init docusaurus
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn create docusaurus
|
|
11
|
+
```
|
|
4
12
|
|
|
5
13
|
## Usage
|
|
6
14
|
|
|
@@ -13,7 +21,7 @@ For Docusaurus maintainers, templates can be tested with:
|
|
|
13
21
|
```bash
|
|
14
22
|
cd `git rev-parse --show-toplevel` # Back to repo root
|
|
15
23
|
rm -rf test-website
|
|
16
|
-
yarn docusaurus
|
|
24
|
+
yarn create-docusaurus test-website classic
|
|
17
25
|
cd test-website
|
|
18
26
|
yarn start
|
|
19
27
|
```
|
|
@@ -25,7 +33,7 @@ Use the following to test the templates against local packages:
|
|
|
25
33
|
```bash
|
|
26
34
|
cd `git rev-parse --show-toplevel` # Back to repo root
|
|
27
35
|
rm -rf test-website-in-workspace
|
|
28
|
-
yarn docusaurus
|
|
36
|
+
yarn create-docusaurus test-website-in-workspace classic
|
|
29
37
|
cd test-website-in-workspace
|
|
30
38
|
yarn start
|
|
31
39
|
```
|
package/bin/index.js
CHANGED
|
@@ -36,7 +36,7 @@ program
|
|
|
36
36
|
.usage('<command> [options]');
|
|
37
37
|
|
|
38
38
|
program
|
|
39
|
-
.command('[siteName] [template] [rootDir]')
|
|
39
|
+
.command('init [siteName] [template] [rootDir]', {isDefault: true})
|
|
40
40
|
.option('--use-npm')
|
|
41
41
|
.option('--skip-install')
|
|
42
42
|
.option('--typescript')
|
|
@@ -59,6 +59,6 @@ program.arguments('<command>').action((cmd) => {
|
|
|
59
59
|
|
|
60
60
|
program.parse(process.argv);
|
|
61
61
|
|
|
62
|
-
if (!process.argv.slice(
|
|
62
|
+
if (!process.argv.slice(1).length) {
|
|
63
63
|
program.outputHelp();
|
|
64
64
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-docusaurus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Create Docusaurus apps easily.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"url": "https://github.com/facebook/docusaurus/issues"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
|
+
"create-docusaurus": "create-docusaurus",
|
|
14
15
|
"build": "tsc",
|
|
15
16
|
"watch": "tsc --watch"
|
|
16
17
|
},
|
package/templates/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Templates
|
|
2
2
|
|
|
3
|
-
Official templates provided by Docusaurus. They are designed to be selected when using the `
|
|
3
|
+
Official templates provided by Docusaurus. They are designed to be selected when using the `npm init docusaurus` CLI command.
|
|
4
4
|
|
|
5
5
|
## Guide to Test Templates for Developer
|
|
6
6
|
|
|
@@ -69,7 +69,8 @@ export default function Home() {
|
|
|
69
69
|
return (
|
|
70
70
|
<Layout
|
|
71
71
|
title={`Hello from ${siteConfig.title}`}
|
|
72
|
-
description="Description will go into a meta tag in <head />"
|
|
72
|
+
description="Description will go into a meta tag in <head />"
|
|
73
|
+
>
|
|
73
74
|
<header className={clsx('hero hero--primary', styles.heroBanner)}>
|
|
74
75
|
<div className="container">
|
|
75
76
|
<h1 className="hero__title">{siteConfig.title}</h1>
|
|
@@ -80,7 +81,8 @@ export default function Home() {
|
|
|
80
81
|
'button button--outline button--secondary button--lg',
|
|
81
82
|
styles.getStarted,
|
|
82
83
|
)}
|
|
83
|
-
to={useBaseUrl('docs/')}
|
|
84
|
+
to={useBaseUrl('docs/')}
|
|
85
|
+
>
|
|
84
86
|
Get Started
|
|
85
87
|
</Link>
|
|
86
88
|
</div>
|
|
@@ -17,7 +17,7 @@ Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new
|
|
|
17
17
|
Generate a new Docusaurus site using the **classic template**:
|
|
18
18
|
|
|
19
19
|
```shell
|
|
20
|
-
|
|
20
|
+
npm init docusaurus@latest my-website classic
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Start your site
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
// Note: type annotations allow type checking and IDEs autocompletion
|
|
3
|
-
|
|
4
|
-
/** @type {import('@docusaurus/types').Config} */
|
|
5
|
-
const config = {
|
|
6
|
-
title: 'My Site',
|
|
7
|
-
tagline: 'The tagline of my site',
|
|
8
|
-
url: 'https://your-docusaurus-test-site.com',
|
|
9
|
-
baseUrl: '/',
|
|
10
|
-
onBrokenLinks: 'throw',
|
|
11
|
-
onBrokenMarkdownLinks: 'warn',
|
|
12
|
-
favicon: 'img/favicon.ico',
|
|
13
|
-
organizationName: 'facebook', // Usually your GitHub org/user name.
|
|
14
|
-
projectName: 'docusaurus', // Usually your repo name.
|
|
15
|
-
themeConfig: {
|
|
16
|
-
navbar: {
|
|
17
|
-
title: 'My Site',
|
|
18
|
-
logo: {
|
|
19
|
-
alt: 'My Site Logo',
|
|
20
|
-
src: 'img/logo.svg',
|
|
21
|
-
},
|
|
22
|
-
items: [
|
|
23
|
-
{
|
|
24
|
-
to: 'docs/intro',
|
|
25
|
-
activeBasePath: 'docs',
|
|
26
|
-
label: 'Docs',
|
|
27
|
-
position: 'left',
|
|
28
|
-
},
|
|
29
|
-
{to: 'blog', label: 'Blog', position: 'left'},
|
|
30
|
-
{
|
|
31
|
-
href: 'https://github.com/facebook/docusaurus',
|
|
32
|
-
label: 'GitHub',
|
|
33
|
-
position: 'right',
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
},
|
|
37
|
-
footer: {
|
|
38
|
-
style: 'dark',
|
|
39
|
-
links: [
|
|
40
|
-
{
|
|
41
|
-
title: 'Community',
|
|
42
|
-
items: [
|
|
43
|
-
{
|
|
44
|
-
label: 'Stack Overflow',
|
|
45
|
-
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: 'Discord',
|
|
49
|
-
href: 'https://discordapp.com/invite/docusaurus',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: 'Twitter',
|
|
53
|
-
href: 'https://twitter.com/docusaurus',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
title: 'More',
|
|
59
|
-
items: [
|
|
60
|
-
{
|
|
61
|
-
label: 'Blog',
|
|
62
|
-
to: 'blog/',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
label: 'GitHub',
|
|
66
|
-
href: 'https://github.com/facebook/docusaurus',
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
presets: [
|
|
75
|
-
[
|
|
76
|
-
'@docusaurus/preset-bootstrap',
|
|
77
|
-
{
|
|
78
|
-
docs: {
|
|
79
|
-
sidebarPath: require.resolve('./sidebars.js'),
|
|
80
|
-
editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
|
|
81
|
-
},
|
|
82
|
-
blog: {
|
|
83
|
-
showReadingTime: true,
|
|
84
|
-
// Please change this to your repo.
|
|
85
|
-
editUrl:
|
|
86
|
-
'https://github.com/facebook/docusaurus/edit/main/website/blog/',
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
],
|
|
90
|
-
],
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
module.exports = config;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "docusaurus-2-bootstrap-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
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"@docusaurus/core": "2.0.0-beta.6",
|
|
18
|
-
"@docusaurus/preset-bootstrap": "2.0.0-beta.6",
|
|
19
|
-
"@mdx-js/react": "^1.6.21",
|
|
20
|
-
"@svgr/webpack": "^5.5.0",
|
|
21
|
-
"clsx": "^1.1.1",
|
|
22
|
-
"file-loader": "^6.2.0",
|
|
23
|
-
"react": "^17.0.1",
|
|
24
|
-
"react-dom": "^17.0.1",
|
|
25
|
-
"url-loader": "^4.1.1"
|
|
26
|
-
},
|
|
27
|
-
"browserslist": {
|
|
28
|
-
"production": [
|
|
29
|
-
">0.2%",
|
|
30
|
-
"not dead",
|
|
31
|
-
"not op_mini all"
|
|
32
|
-
],
|
|
33
|
-
"development": [
|
|
34
|
-
"last 1 chrome version",
|
|
35
|
-
"last 1 firefox version",
|
|
36
|
-
"last 1 safari version"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
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 useBaseUrl from '@docusaurus/useBaseUrl';
|
|
7
|
-
import styles from './styles.module.css';
|
|
8
|
-
|
|
9
|
-
const features = [
|
|
10
|
-
{
|
|
11
|
-
title: 'Easy to Use',
|
|
12
|
-
imageUrl: 'img/undraw_docusaurus_mountain.svg',
|
|
13
|
-
description: (
|
|
14
|
-
<>
|
|
15
|
-
Docusaurus was designed from the ground up to be easily installed and
|
|
16
|
-
used to get your website up and running quickly.
|
|
17
|
-
</>
|
|
18
|
-
),
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
title: 'Focus on What Matters',
|
|
22
|
-
imageUrl: 'img/undraw_docusaurus_tree.svg',
|
|
23
|
-
description: (
|
|
24
|
-
<>
|
|
25
|
-
Docusaurus lets you focus on your docs, and we'll do the chores. Go
|
|
26
|
-
ahead and move your docs into the <code>docs</code> directory.
|
|
27
|
-
</>
|
|
28
|
-
),
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
title: 'Powered by React',
|
|
32
|
-
imageUrl: 'img/undraw_docusaurus_react.svg',
|
|
33
|
-
description: (
|
|
34
|
-
<>
|
|
35
|
-
Extend or customize your website layout by reusing React. Docusaurus can
|
|
36
|
-
be extended while reusing the same header and footer.
|
|
37
|
-
</>
|
|
38
|
-
),
|
|
39
|
-
},
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
function Feature({imageUrl, title, description}) {
|
|
43
|
-
const imgUrl = useBaseUrl(imageUrl);
|
|
44
|
-
return (
|
|
45
|
-
<div className={clsx('col col--4', styles.feature)}>
|
|
46
|
-
{imgUrl && (
|
|
47
|
-
<div className="text--center">
|
|
48
|
-
<img className={styles.featureImage} src={imgUrl} alt={title} />
|
|
49
|
-
</div>
|
|
50
|
-
)}
|
|
51
|
-
<h3>{title}</h3>
|
|
52
|
-
<p>{description}</p>
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default function Home() {
|
|
58
|
-
const context = useDocusaurusContext();
|
|
59
|
-
const {siteConfig = {}} = context;
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<Layout
|
|
63
|
-
title={`Hello from ${siteConfig.title}`}
|
|
64
|
-
description="Description will go into a meta tag in <head />">
|
|
65
|
-
<div className={styles.hero}>
|
|
66
|
-
<header>
|
|
67
|
-
<h1>{siteConfig.title}</h1>
|
|
68
|
-
<p>{siteConfig.tagline}</p>
|
|
69
|
-
<div className={styles.buttons}>
|
|
70
|
-
<Link to={useBaseUrl('docs/')}>Get Started</Link>
|
|
71
|
-
</div>
|
|
72
|
-
</header>
|
|
73
|
-
<main>
|
|
74
|
-
{features && features.length > 0 && (
|
|
75
|
-
<section className={styles.section}>
|
|
76
|
-
<div className={styles.features}>
|
|
77
|
-
{features.map((props, idx) => (
|
|
78
|
-
<Feature key={idx} {...props} />
|
|
79
|
-
))}
|
|
80
|
-
</div>
|
|
81
|
-
</section>
|
|
82
|
-
)}
|
|
83
|
-
</main>
|
|
84
|
-
</div>
|
|
85
|
-
</Layout>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/* stylelint-disable docusaurus/copyright-header */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* CSS files with the .module.css suffix will be treated as CSS modules
|
|
5
|
-
* and scoped locally.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
.heroBanner {
|
|
9
|
-
padding: 4rem 0;
|
|
10
|
-
text-align: center;
|
|
11
|
-
position: relative;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@media screen and (max-width: 966px) {
|
|
16
|
-
.heroBanner {
|
|
17
|
-
padding: 2rem;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.buttons {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.hero {
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
width: 100%;
|
|
31
|
-
align-items: center;
|
|
32
|
-
place-content: center;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.section {
|
|
36
|
-
margin: 10rem;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.features {
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
padding: 2rem 0;
|
|
43
|
-
width: 100%;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.featureImage {
|
|
47
|
-
height: 200px;
|
|
48
|
-
width: 200px;
|
|
49
|
-
}
|