Skip to content

Commit 60f6b1f

Browse files
committed
Add docs
1 parent 722d23a commit 60f6b1f

Some content is hidden

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

69 files changed

+1794
-1
lines changed

.github/workflows/deploy_docs.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
matrix:
14+
node-version: [19.x]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Use Node.js ${{ matrix.node-version }}
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ matrix.node-version }}
22+
- name: Install dependencies
23+
run: yarn install
24+
working-directory: ./docs
25+
- name: Build
26+
run: yarn build
27+
working-directory: ./docs
28+
- name: Deploy to GitHub Pages
29+
uses: JamesIves/github-pages-deploy-action@v4.5.0
30+
with:
31+
branch: gh-pages
32+
folder: ./docs/build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This project is loosely based on [Vulcan API](https://github.com/kapi2289/vulcan
1212

1313
## Docs
1414

15-
[Gitbook docs](https://capure.gitbook.io/vulcan-api-js/)
15+
You can find the docs [here](https://avorty.github.io/vulcan-api-js)
1616

1717
## License
1818

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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](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+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
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/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Contributing",
3+
"position": 5,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Some details on how to contribute to the project."
7+
}
8+
}

docs/docs/contributing/docs.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# Contributing to the docs
6+
7+
On every page you can find a link to the source file of the page. You can edit the file and create a pull request.
8+
9+
## Using markdown
10+
11+
If you don't know how to use markdown you can look [here](./markdown-features)
12+
13+
## Adding a new page
14+
15+
To add a new page you need to create a new markdown file in the `docs/docs` folder.
16+
17+
## Adding a new category
18+
If you want to create a new category you need to create a new folder in the `docs/docs` folder and create a new markdown file in it. Also you need to create a _category.json file in the category folder with the following content:
19+
20+
```json
21+
{
22+
"label": "New category",
23+
"position": 6,
24+
"link": {
25+
"type": "generated-index",
26+
"description": "Short description of the category."
27+
}
28+
}
29+
```

docs/docs/contributing/general.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# General information
6+
7+
Contributions are welcome! We are happy to accept contributions in the form of pull requests, issues, or just general feedback and discussion.
8+
9+
## Contributing to the documentation
10+
11+
See [Contributing to the documentation](./docs).
12+
13+
## Contributing to the SDK
14+
15+
See [Contributing to the SDK](./sdk).
16+
17+
If you have any questions feel free to contact us.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# Markdown Features
6+
7+
Out docs page uses **Docusaurus**. Docusaurus supports **[Markdown](https://daringfireball.net/projects/markdown/syntax)** and a few **additional features**.
8+
9+
## Using links
10+
11+
Regular Markdown links are supported, using url paths or relative file paths.
12+
13+
```md
14+
Returns a [Student](../models/student) object.
15+
```
16+
17+
Link to [Student](../models/student) model.
18+
19+
## Images
20+
21+
Regular Markdown images are supported.
22+
23+
You can use absolute paths to reference images in the static directory (`static/img/docusaurus.png`):
24+
25+
```md
26+
![Docusaurus logo](/img/docusaurus.png)
27+
```
28+
29+
![Docusaurus logo](/img/docusaurus.png)
30+
31+
You can reference images relative to the current file as well. This is particularly useful to colocate images close to the Markdown files using them:
32+
33+
```md
34+
![Docusaurus logo](./img/docusaurus.png)
35+
```
36+
37+
## Code Blocks
38+
39+
Markdown code blocks are supported with Syntax highlighting.
40+
41+
```jsx title="src/components/HelloDocusaurus.js"
42+
function HelloDocusaurus() {
43+
return (
44+
<h1>Hello, Docusaurus!</h1>
45+
)
46+
}
47+
```
48+
49+
```jsx title="src/components/HelloDocusaurus.js"
50+
function HelloDocusaurus() {
51+
return <h1>Hello, Docusaurus!</h1>;
52+
}
53+
```
54+
55+
## Admonitions
56+
57+
Docusaurus has a special syntax to create admonitions and callouts:
58+
59+
:::tip My tip
60+
61+
Use this awesome feature option
62+
63+
:::
64+
65+
:::danger Take care
66+
67+
This action is dangerous
68+
69+
:::
70+
71+
:::tip My tip
72+
73+
Use this awesome feature option
74+
75+
:::
76+
77+
:::danger Take care
78+
79+
This action is dangerous
80+
81+
:::
82+
83+
## MDX and React Components
84+
85+
[MDX](https://mdxjs.com/) can make your documentation more **interactive** and allows using any **React components inside Markdown**:
86+
87+
```jsx
88+
export const Highlight = ({children, color}) => (
89+
<span
90+
style={{
91+
backgroundColor: color,
92+
borderRadius: '20px',
93+
color: '#fff',
94+
padding: '10px',
95+
cursor: 'pointer',
96+
}}
97+
onClick={() => {
98+
alert(`You clicked the color ${color} with label ${children}`)
99+
}}>
100+
{children}
101+
</span>
102+
);
103+
104+
This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
105+
106+
This is <Highlight color="#1877F2">Facebook blue</Highlight> !
107+
```
108+
109+
export const Highlight = ({children, color}) => (
110+
<span
111+
style={{
112+
backgroundColor: color,
113+
borderRadius: '20px',
114+
color: '#fff',
115+
padding: '10px',
116+
cursor: 'pointer',
117+
}}
118+
onClick={() => {
119+
alert(`You clicked the color ${color} with label ${children}`);
120+
}}>
121+
{children}
122+
</span>
123+
);
124+
125+
This is <Highlight color="#25c2a0">Docusaurus green</Highlight> !
126+
127+
This is <Highlight color="#1877F2">Facebook blue</Highlight> !

docs/docs/contributing/sdk.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# Contributing to the SDK
6+
7+
You can look on the [list of issues](https://github.com/avorty/vulcan-api-js/issues) and pick one to work on. If you have an idea for a new feature, you can create an issue and discuss it with us.
8+
9+
## Running SDK in the development mode
10+
11+
We use yarn as a package manager.
12+
13+
1. First install the dependencies
14+
15+
```bash
16+
yarn install
17+
```
18+
19+
2. Then run the SDK in development mode
20+
21+
```bash
22+
yarn dev
23+
```

0 commit comments

Comments
 (0)