Skip to content

Commit

Permalink
Add documentation (#2)
Browse files Browse the repository at this point in the history
* Add documentation

* Enable TypeDoc
  • Loading branch information
QubitPi authored Dec 15, 2023
1 parent b1feb4f commit 1394e50
Show file tree
Hide file tree
Showing 31 changed files with 13,210 additions and 31 deletions.
62 changes: 31 additions & 31 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,37 +79,37 @@ jobs:
spec-relative-path: ${{ matrix.test_spec }}
# - run: npm exec -- argos upload --token ${{ secrets.ARGOS_TOKEN }} cypress/screenshots

# documentation-ci-cd:
# name: Test and Deploy Documentation to GitHub Pages
# needs: e2e-tests
# runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: docs
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-node@v3
# with:
# node-version: ${{ env.NODE_VERSION }}
# - name: Install nexusgraph dependencies so that TypeDoc process source files properly
# run: cd ../ && yarn install
# env:
# YARN_ENABLE_IMMUTABLE_INSTALLS: false
# - name: Install doc dependencies
# run: yarn install
# env:
# YARN_ENABLE_IMMUTABLE_INSTALLS: false
# - name: Build documentation
# run: yarn build
# - name: Deploy to GitHub Pages
# if: github.ref == 'refs/heads/master'
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./docs/build
# enable_jekyll: false
# user_name: ${{ env.USER }}
# user_email: ${{ env.EMAIL }}
documentation-ci-cd:
name: Test and Deploy Documentation to GitHub Pages
needs: e2e-tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install nexusgraph dependencies so that TypeDoc process source files properly
run: cd ../ && yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Install doc dependencies
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Build documentation
run: yarn build
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
enable_jekyll: false
user_name: ${{ env.USER }}
user_email: ${{ env.EMAIL }}

# lighthouse:
# if: github.ref != 'refs/heads/master'
Expand Down
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
42 changes: 42 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ract-template Documentation
---------------------------

This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.

### Installation

```bash
yarn
```

### Local Development

```bash
yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without
having to restart the server.

### Build

```bash
yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting
service.

### Troubleshooting

#### Docusaurus Blogs Relative Linking is Treated False-Negative by CI Markdown Link check

[CI check for Markdown link](../.github/workflows/ci-cd.yml) (`markdown-link-check`) is turned on and it's not smart
enough to detect relative linking by Docusaurus. The workaround is to disable the link check at the relevant line. For
example:

```markdown
<!-- markdown-link-check-disable -->
known. Additionally, this process makes it easy to implement a [blue-green deployment](continuous-delivery) or
<!-- markdown-link-check-enable -->
```
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
Loading

0 comments on commit 1394e50

Please sign in to comment.