Skip to content

Commit 59645cc

Browse files
setup docusaurus for documentation
1 parent ad7c3b4 commit 59645cc

26 files changed

+1215
-2
lines changed

.dockerignore

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

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
3+
node_modules
4+
5+
lib/core/metadata.js
6+
lib/core/MetadataBlog.js
7+
8+
website/translated_docs
9+
website/build/
10+
website/yarn.lock
11+
website/node_modules
12+
website/i18n/*

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM node:lts
2+
3+
WORKDIR /app/website
4+
5+
EXPOSE 3000 35729
6+
COPY ./docs /app/docs
7+
COPY ./website /app/website
8+
RUN yarn install
9+
10+
CMD ["yarn", "start"]

README.md

Lines changed: 198 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,198 @@
1-
# coding-standards-convention
2-
Commonly followed coding standards and convention at leapfrog
1+
This website was created with [Docusaurus](https://docusaurus.io/).
2+
3+
# What's In This Document
4+
5+
- [Get Started in 5 Minutes](#get-started-in-5-minutes)
6+
- [Directory Structure](#directory-structure)
7+
- [Editing Content](#editing-content)
8+
- [Adding Content](#adding-content)
9+
- [Full Documentation](#full-documentation)
10+
11+
# Get Started in 5 Minutes
12+
13+
1. Make sure all the dependencies for the website are installed:
14+
15+
```sh
16+
# Install dependencies
17+
$ yarn
18+
```
19+
20+
2. Run your dev server:
21+
22+
```sh
23+
# Start the site
24+
$ yarn start
25+
```
26+
27+
## Directory Structure
28+
29+
Your project file structure should look something like this
30+
31+
```
32+
my-docusaurus/
33+
docs/
34+
doc-1.md
35+
doc-2.md
36+
doc-3.md
37+
website/
38+
blog/
39+
2016-3-11-oldest-post.md
40+
2017-10-24-newest-post.md
41+
core/
42+
node_modules/
43+
pages/
44+
static/
45+
css/
46+
img/
47+
package.json
48+
sidebars.json
49+
siteConfig.js
50+
```
51+
52+
# Editing Content
53+
54+
## Editing an existing docs page
55+
56+
Edit docs by navigating to `docs/` and editing the corresponding document:
57+
58+
`docs/doc-to-be-edited.md`
59+
60+
```markdown
61+
---
62+
id: page-needs-edit
63+
title: This Doc Needs To Be Edited
64+
---
65+
66+
Edit me...
67+
```
68+
69+
For more information about docs, click [here](https://docusaurus.io/docs/en/navigation)
70+
71+
## Editing an existing blog post
72+
73+
Edit blog posts by navigating to `website/blog` and editing the corresponding post:
74+
75+
`website/blog/post-to-be-edited.md`
76+
77+
```markdown
78+
---
79+
id: post-needs-edit
80+
title: This Blog Post Needs To Be Edited
81+
---
82+
83+
Edit me...
84+
```
85+
86+
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
87+
88+
# Adding Content
89+
90+
## Adding a new docs page to an existing sidebar
91+
92+
1. Create the doc as a new markdown file in `/docs`, example `docs/newly-created-doc.md`:
93+
94+
```md
95+
---
96+
id: newly-created-doc
97+
title: This Doc Needs To Be Edited
98+
---
99+
100+
My new content here..
101+
```
102+
103+
1. Refer to that doc's ID in an existing sidebar in `website/sidebars.json`:
104+
105+
```javascript
106+
// Add newly-created-doc to the Getting Started category of docs
107+
{
108+
"docs": {
109+
"Getting Started": [
110+
"quick-start",
111+
"newly-created-doc" // new doc here
112+
],
113+
...
114+
},
115+
...
116+
}
117+
```
118+
119+
For more information about adding new docs, click [here](https://docusaurus.io/docs/en/navigation)
120+
121+
## Adding a new blog post
122+
123+
1. Make sure there is a header link to your blog in `website/siteConfig.js`:
124+
125+
`website/siteConfig.js`
126+
127+
```javascript
128+
headerLinks: [
129+
...
130+
{ blog: true, label: 'Blog' },
131+
...
132+
]
133+
```
134+
135+
2. Create the blog post with the format `YYYY-MM-DD-My-Blog-Post-Title.md` in `website/blog`:
136+
137+
`website/blog/2018-05-21-New-Blog-Post.md`
138+
139+
```markdown
140+
---
141+
author: Frank Li
142+
authorURL: https://twitter.com/foobarbaz
143+
authorFBID: 503283835
144+
title: New Blog Post
145+
---
146+
147+
Lorem Ipsum...
148+
```
149+
150+
For more information about blog posts, click [here](https://docusaurus.io/docs/en/adding-blog)
151+
152+
## Adding items to your site's top navigation bar
153+
154+
1. Add links to docs, custom pages or external links by editing the headerLinks field of `website/siteConfig.js`:
155+
156+
`website/siteConfig.js`
157+
158+
```javascript
159+
{
160+
headerLinks: [
161+
...
162+
/* you can add docs */
163+
{ doc: 'my-examples', label: 'Examples' },
164+
/* you can add custom pages */
165+
{ page: 'help', label: 'Help' },
166+
/* you can add external links */
167+
{ href: 'https://github.com/facebook/docusaurus', label: 'GitHub' },
168+
...
169+
],
170+
...
171+
}
172+
```
173+
174+
For more information about the navigation bar, click [here](https://docusaurus.io/docs/en/navigation)
175+
176+
## Adding custom pages
177+
178+
1. Docusaurus uses React components to build pages. The components are saved as .js files in `website/pages/en`:
179+
1. If you want your page to show up in your navigation header, you will need to update `website/siteConfig.js` to add to the `headerLinks` element:
180+
181+
`website/siteConfig.js`
182+
183+
```javascript
184+
{
185+
headerLinks: [
186+
...
187+
{ page: 'my-new-custom-page', label: 'My New Custom Page' },
188+
...
189+
],
190+
...
191+
}
192+
```
193+
194+
For more information about custom pages, click [here](https://docusaurus.io/docs/en/custom-pages).
195+
196+
# Full Documentation
197+
198+
Full documentation can be found on the [website](https://docusaurus.io/).

docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3"
2+
3+
services:
4+
docusaurus:
5+
build: .
6+
ports:
7+
- 3000:3000
8+
- 35729:35729
9+
volumes:
10+
- ./docs:/app/docs
11+
- ./website/blog:/app/website/blog
12+
- ./website/core:/app/website/core
13+
- ./website/i18n:/app/website/i18n
14+
- ./website/pages:/app/website/pages
15+
- ./website/static:/app/website/static
16+
- ./website/sidebars.json:/app/website/sidebars.json
17+
- ./website/siteConfig.js:/app/website/siteConfig.js
18+
working_dir: /app/website

docs/01-introduction.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
id: introduction
3+
title: Introduction
4+
---
5+
6+
Coding standards and conventions......

docs/02-1-files.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
id: files
3+
title: Files
4+
sidebar_label: Files
5+
---
6+
7+
## Contents...

docs/02-2-classes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
id: classes
3+
title: Classes
4+
sidebar_label: Classes
5+
---
6+
7+
8+
#### Contents...

docs/02-3-functions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
id: functions
3+
title: Function
4+
sidebar_label: Functions
5+
---
6+
7+
#### 1. Contents...

docs/02-4-variables.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
id: variables
3+
title: Variables
4+
sidebar_label: Variables
5+
---
6+
7+
#### 1. Contents...

0 commit comments

Comments
 (0)