Skip to content

Commit d24c127

Browse files
authored
Docs site poc (LAION-AI#346)
add docusaurus based docs site under /docs
1 parent 53a17cc commit d24c127

31 files changed

+8224
-51
lines changed

.devcontainer/post_create_command.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
# ensure pre-commit is installed
22
pre-commit install
3+
4+
# run yarn install in docs folder
5+
cd docs
6+
yarn install
7+
cd ..
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy docs to gitHub pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- docs-site-poc
8+
paths:
9+
- ".github/workflows/deploy-docs-site.yaml"
10+
- "docs/**"
11+
pull_request:
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-22.04
16+
permissions:
17+
contents: write
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
defaults:
21+
run:
22+
working-directory: docs
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: "16"
30+
31+
- name: Get yarn cache
32+
id: yarn-cache
33+
run: echo "YARN_CACHE_DIR=$(yarn cache dir)" >> "${GITHUB_OUTPUT}"
34+
35+
- name: Cache dependencies
36+
uses: actions/cache@v3
37+
with:
38+
path: ${{ steps.yarn-cache.outputs.YARN_CACHE_DIR }}
39+
key: ${{ runner.os }}-docs-${{ hashFiles('**/yarn.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-docs-
42+
43+
- run: yarn install --frozen-lockfile
44+
- run: yarn build
45+
46+
- name: Deploy
47+
uses: peaceiris/actions-gh-pages@v3
48+
if:
49+
${{ github.ref == 'refs/heads/main' || github.ref ==
50+
'refs/heads/docs-site-poc' }}
51+
with:
52+
github_token: ${{ secrets.GITHUB_TOKEN }}
53+
publish_dir: ./docs/build

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: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,58 @@
1-
# Documentation
1+
# Website
22

3-
This directory contains the documentation for the project and other related
4-
organization documents.
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern
4+
static website generator.
55

6-
## Contributing to this documentation
6+
### Contributing
77

8-
Please make a pull request to the `main` branch with your changes.
8+
#### Changes to existing docs
99

10-
Consider that this folder is used for documenting the various code sub-parts,
11-
the high-level ideas, the ML aspects, experiments, contributor guides, guides
12-
for data creation, and many more things. Please try to keep the documentation as
13-
concise as possible and keep an organized folder structure that makes sense for
14-
everyone.
10+
You can just make a PR on whatever .md file you would like to update.
11+
12+
#### Changes to docs structure
13+
14+
If you would like to add a new category:
15+
16+
1. Create a new folder under `/docs/docs/` for the category you want to add.
17+
1. Include any `.md` files you want to live under this new category.
18+
1. Update the order or hierarchy in `/docs/sidebars.js` as needed.
19+
20+
If you would like to add a new page into an existing category:
21+
22+
1. Create the `.md` file you want in the relevant folder within `/docs/docs/`.
23+
1. Update the hierarchy in `/docs/sidebars.js` as needed.
24+
25+
### Installation
26+
27+
From within the `/docs/` folder.
28+
29+
```
30+
$ yarn
31+
```
32+
33+
### Local Development
34+
35+
```
36+
$ yarn start
37+
```
38+
39+
This command starts a local development server and opens up a browser window.
40+
Most changes are reflected live without having to restart the server.
41+
42+
### Browser Development
43+
44+
If you would like to work on the docs from within your browser you can create a
45+
github codespace on your fork or branch. Then from within that codespace you can
46+
run below commands to launch the docs site on port 3000 within your codespace.
47+
48+
```bash
49+
50+
# cd to docs dir
51+
cd docs
52+
53+
# start dev server to work on your changes
54+
yarn start
55+
```
56+
57+
Once you port forward to port 3000 within your codespace you will be able to see
58+
all changes reflected as soon as you make them.

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+
};

docs/docs/data/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Data
2+
3+
Resources related to data.
File renamed without changes.

docs/datasets.md renamed to docs/docs/data/datasets.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# OpenAssistant Datasets
1+
# Datasets
22

33
The datasets for this project are currently hosted as loading scripts on the
44
[Open-Assistant organization](https://huggingface.co/OpenAssistant) the Hugging
@@ -98,7 +98,11 @@ You can make a new branch as such:
9898
git checkout -b <dataset_name>
9999
```
100100

101-
<p style="color:red"> <b> Please do not make changes on the master branch! </b></p>
101+
:::caution
102+
103+
Please do not make changes on the master branch!
104+
105+
:::
102106

103107
Always make sure you're on the right branch with the following command:
104108

@@ -214,7 +218,7 @@ all necessary TODOs. There are three key methods that are important:
214218
For the `_info_` function, you will need to define `features` for your
215219
`DatasetInfo` object. For each dataset config, choose the right schema from our
216220
list of examples. You can find the schemas in the
217-
[schemas directory](openassistant/utils/schemas/).
221+
[schemas directory](https://github.com/LAION-AI/Open-Assistant/tree/main/openassistant).
218222

219223
You will use this schema in the `_generate_examples` return value.
220224

@@ -228,7 +232,8 @@ TODO
228232
#### Running & debugging
229233

230234
You can run your data loader script during development by appending the
231-
following statement to your code ([templates/template.py](templates/template.py)
235+
following statement to your code
236+
([templates/template.py](https://github.com/LAION-AI/Open-Assistant/blob/main/openassistant/templates/template.py)
232237
already includes this):
233238

234239
```python
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)