Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8c4a35b

Browse files
authored
Merge pull request#334 from coderoad/docsaurus-2
Docusaurus 2
2 parents6f2fc2d +ca2d2bb commit8c4a35b

16 files changed

+10041
-3
lines changed

‎docs/.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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*

‎docs/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#Website
2+
3+
This website is built using[Docusaurus 2](https://v2.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 open 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.

‎docs/tutorials.mdrenamed to‎docs/docs/build-tutorial.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
#Tutorial Docs
1+
---
2+
id:build-tutorial
3+
title:Building a Tutorial
4+
sidebar_label:Building a Tutorial
5+
---
26

37
A tutorial is made up of two parts:
48

@@ -133,7 +137,7 @@ That said, anything can be tested. I’ll include some examples below of tests I
133137
#####Equality
134138

135139
Testing equality
136-
Eg.https://github.com/ShMcK/coderoad-tutorial-js-bug-hunter/commit/75b32ebee89853deb3b4dad6aa8654f89bc72cff
140+
Eg.<https://github.com/ShMcK/coderoad-tutorial-js-bug-hunter/commit/75b32ebee89853deb3b4dad6aa8654f89bc72cff>
137141

138142
#####Spy/Listener
139143

@@ -171,7 +175,7 @@ Eg. [setup: useText hook refactor · ShMcK/coderoad-tutorial-tweeter@71deafa ·
171175

172176
When editing markdown, simply edit the markdown and re-run the parser.
173177

174-
When editing code, you'll need to rebase. You can use VSCode as your default editor for Git:https://blog.soltysiak.it/en/2017/01/set-visual-studio-code-as-default-git-editor-and-diff-tool/.
178+
When editing code, you'll need to rebase. You can use VSCode as your default editor for Git:<https://blog.soltysiak.it/en/2017/01/set-visual-studio-code-as-default-git-editor-and-diff-tool/.>
175179

176180
Run rebase from a commit or just "root".
177181

‎docs/docs/overview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
id:overview
3+
title:Overview
4+
sidebar_label:Overview
5+
---
6+
7+
Overview

‎docs/docusaurus.config.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
module.exports={
2+
title:'CodeRoad',
3+
tagline:'A VSCode Extension for Interactive Coding Tutorials',
4+
url:'https://coderoad.github.io',
5+
baseUrl:'/',
6+
favicon:'img/favicon.ico',
7+
organizationName:'coderoad',
8+
projectName:'coderoad-vscode',
9+
themeConfig:{
10+
navbar:{
11+
title:'CodeRoad',
12+
logo:{
13+
alt:'My Site Logo',
14+
src:'img/logo.svg',
15+
},
16+
links:[
17+
{
18+
to:'docs/overview',
19+
activeBasePath:'docs',
20+
label:'Docs',
21+
position:'left',
22+
},
23+
{
24+
href:'https://github.com/coderoad/coderoad-vscode',
25+
label:'GitHub',
26+
position:'right',
27+
},
28+
],
29+
},
30+
footer:{
31+
style:'dark',
32+
links:[
33+
// {
34+
// title: 'Docs',
35+
// items: [
36+
// {
37+
// label: 'Style Guide',
38+
// to: 'docs/doc1',
39+
// },
40+
// {
41+
// label: 'Second Doc',
42+
// to: 'docs/doc2',
43+
// },
44+
// ],
45+
// },
46+
// {
47+
// title: 'Community',
48+
// items: [
49+
// {
50+
// label: 'Stack Overflow',
51+
// href: 'https://stackoverflow.com/questions/tagged/docusaurus',
52+
// },
53+
// {
54+
// label: 'Discord',
55+
// href: 'https://discordapp.com/invite/docusaurus',
56+
// },
57+
// {
58+
// label: 'Twitter',
59+
// href: 'https://twitter.com/docusaurus',
60+
// },
61+
// ],
62+
// },
63+
// {
64+
// title: 'More',
65+
// items: [
66+
// {
67+
// label: 'GitHub',
68+
// href: 'https://github.com/coderoad/coderoad-vscode',
69+
// },
70+
// ],
71+
// },
72+
],
73+
copyright:`Copyright ©${newDate().getFullYear()} CodeRoad. Built with Docusaurus.`,
74+
},
75+
},
76+
presets:[
77+
[
78+
'@docusaurus/preset-classic',
79+
{
80+
docs:{
81+
sidebarPath:require.resolve('./sidebars.js'),
82+
// Please change this to your repo.
83+
editUrl:'https://github.com/coderoad/coderoad-vscode/edit/master/docs/',
84+
},
85+
theme:{
86+
customCss:require.resolve('./src/css/custom.css'),
87+
},
88+
},
89+
],
90+
],
91+
}

‎docs/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name":"docs",
3+
"version":"0.0.0",
4+
"private":true,
5+
"scripts": {
6+
"start":"docusaurus start",
7+
"build":"docusaurus build",
8+
"swizzle":"docusaurus swizzle",
9+
"deploy":"docusaurus deploy"
10+
},
11+
"dependencies": {
12+
"@docusaurus/core":"^2.0.0-alpha.54",
13+
"@docusaurus/preset-classic":"^2.0.0-alpha.54",
14+
"classnames":"^2.2.6",
15+
"react":"^16.8.4",
16+
"react-dom":"^16.8.4"
17+
},
18+
"browserslist": {
19+
"production": [
20+
">0.2%",
21+
"not dead",
22+
"not op_mini all"
23+
],
24+
"development": [
25+
"last 1 chrome version",
26+
"last 1 firefox version",
27+
"last 1 safari version"
28+
]
29+
}
30+
}

‎docs/sidebars.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports={
2+
someSidebar:{
3+
Intro:['overview','build-tutorial'],
4+
// Features: ['mdx'],
5+
},
6+
}

‎docs/src/css/custom.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* stylelint-disable docusaurus/copyright-header */
2+
/**
3+
* Any CSS included here will be global. The classic template
4+
* bundles Infima by default. Infima is a CSS framework designed to
5+
* work well for content-centric websites.
6+
*/
7+
8+
/* You can override the default Infima variables here. */
9+
:root {
10+
--ifm-color-primary:#25c2a0;
11+
--ifm-color-primary-dark:rgb(33,175,144);
12+
--ifm-color-primary-darker:rgb(31,165,136);
13+
--ifm-color-primary-darkest:rgb(26,136,112);
14+
--ifm-color-primary-light:rgb(70,203,174);
15+
--ifm-color-primary-lighter:rgb(102,212,189);
16+
--ifm-color-primary-lightest:rgb(146,224,208);
17+
--ifm-code-font-size:95%;
18+
}
19+
20+
.docusaurus-highlight-code-line {
21+
background-color:rgb(72,77,91);
22+
display: block;
23+
margin:0calc(-1*var(--ifm-pre-padding));
24+
padding:0var(--ifm-pre-padding);
25+
}

‎docs/src/pages/index.js

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
importReactfrom'react'
2+
importclassnamesfrom'classnames'
3+
importLayoutfrom'@theme/Layout'
4+
importLinkfrom'@docusaurus/Link'
5+
importuseDocusaurusContextfrom'@docusaurus/useDocusaurusContext'
6+
importuseBaseUrlfrom'@docusaurus/useBaseUrl'
7+
importstylesfrom'./styles.module.css'
8+
9+
constfeatures=[
10+
{
11+
title:<>Your Editor</>,
12+
imageUrl:'img/undraw_docusaurus_mountain.svg',
13+
description:<>Playing tutorials in a real-world setting: within your coding editor.</>,
14+
},
15+
{
16+
title:<>Your Code</>,
17+
imageUrl:'img/undraw_docusaurus_tree.svg',
18+
description:<>You own your progress. Save with Git to build your timeline. Deploy to build your portfolio.</>,
19+
},
20+
{
21+
title:<>Open</>,
22+
imageUrl:'img/undraw_docusaurus_react.svg',
23+
description:<>CodeRoad is open-source. Build your own tutorials. Contribute to the tooling.</>,
24+
},
25+
]
26+
27+
functionFeature({ imageUrl, title, description}){
28+
constimgUrl=useBaseUrl(imageUrl)
29+
return(
30+
<divclassName={classnames('col col--4',styles.feature)}>
31+
{imgUrl&&(
32+
<divclassName="text--center">
33+
<imgclassName={styles.featureImage}src={imgUrl}alt={title}/>
34+
</div>
35+
)}
36+
<h3>{title}</h3>
37+
<p>{description}</p>
38+
</div>
39+
)
40+
}
41+
42+
functionHome(){
43+
constcontext=useDocusaurusContext()
44+
const{ siteConfig={}}=context
45+
return(
46+
<Layouttitle={`Hello from${siteConfig.title}`}description="Description will go into a meta tag in <head />">
47+
<headerclassName={classnames('hero hero--primary',styles.heroBanner)}>
48+
<divclassName="container">
49+
<h1className="hero__title">{siteConfig.title}</h1>
50+
<pclassName="hero__subtitle">{siteConfig.tagline}</p>
51+
<divclassName={styles.buttons}>
52+
<Link
53+
className={classnames('button button--outline button--secondary button--lg',styles.getStarted)}
54+
to={useBaseUrl('docs/overview')}
55+
>
56+
Get Started
57+
</Link>
58+
</div>
59+
</div>
60+
</header>
61+
<main>
62+
{features&&features.length&&(
63+
<sectionclassName={styles.features}>
64+
<divclassName="container">
65+
<divclassName="row">
66+
{features.map((props,idx)=>(
67+
<Featurekey={idx}{...props}/>
68+
))}
69+
</div>
70+
</div>
71+
</section>
72+
)}
73+
</main>
74+
</Layout>
75+
)
76+
}
77+
78+
exportdefaultHome

‎docs/src/pages/styles.module.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* stylelint-disable docusaurus/copyright-header */
2+
/**
3+
* CSS files with the .module.css suffix will be treated as CSS modules
4+
* and scoped locally.
5+
*/
6+
7+
.heroBanner {
8+
padding:4rem0;
9+
text-align: center;
10+
position: relative;
11+
overflow: hidden;
12+
}
13+
14+
@media screenand (max-width:966px) {
15+
.heroBanner {
16+
padding:2rem;
17+
}
18+
}
19+
20+
.buttons {
21+
display: flex;
22+
align-items: center;
23+
justify-content: center;
24+
}
25+
26+
.features {
27+
display: flex;
28+
align-items: center;
29+
padding:2rem0;
30+
width:100%;
31+
}
32+
33+
.featureImage {
34+
height:200px;
35+
width:200px;
36+
}

‎docs/static/img/favicon.ico

766 Bytes
Binary file not shown.

‎docs/static/img/logo.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp