-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
123 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: Authoring | ||
description: How to write documentation | ||
nav: 1 | ||
--- | ||
|
||
In your `MDX` folder, create any `path/to/my-document.mdx`: | ||
|
||
```md | ||
--- | ||
title: My Document | ||
description: Lorem ipsum... | ||
nav: 0 | ||
image: dog.png | ||
--- | ||
|
||
MARKDOWN | ||
``` | ||
|
||
### Frontmatter | ||
|
||
Any key is optional. | ||
|
||
- `title`: if not provided, last part of the path is used: `my document` | ||
- `image`: | ||
- relative (to the md file) or absolute path, eg: `dog.png`, `./dog.png`, `../../dog.png`, `/dog.png` or `https://animals.com/dog.png` | ||
- will be used as metadata image if provided | ||
- `nav`: order in the navigation (on the same level) | ||
|
||
### MARKDOWN | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
title: Docker | ||
description: Docker image generator | ||
nav: 2 | ||
--- | ||
|
||
```sh | ||
$ docker build -t pmndrs-docs . | ||
``` | ||
|
||
```sh | ||
$ cd ~/code/pmndrs/react-three-fiber | ||
$ ( | ||
trap 'kill -9 0' SIGINT | ||
|
||
export _PORT=60141 | ||
|
||
export MDX=./docs | ||
export NEXT_PUBLIC_LIBNAME="React Three Fiber" | ||
export NEXT_PUBLIC_LIBNAME_SHORT="r3f" | ||
export BASE_PATH= | ||
export OUTPUT=export | ||
export HOME_REDIRECT=/getting-started/introduction | ||
export MDX_BASEURL=http://localhost:$_PORT | ||
export EDIT_BASEURL= | ||
export NEXT_PUBLIC_URL= | ||
export ICON=🇨🇭 | ||
export LOGO=/logo.png | ||
|
||
rm -rf "$MDX/out" | ||
|
||
docker run --rm --init -it \ | ||
-v "$MDX":/app/docs \ | ||
-e MDX \ | ||
-e NEXT_PUBLIC_LIBNAME \ | ||
-e BASE_PATH \ | ||
-e DIST_DIR="$MDX/out$BASE_PATH" \ | ||
-e OUTPUT \ | ||
-e HOME_REDIRECT \ | ||
-e MDX_BASEURL \ | ||
-e EDIT_BASEURL \ | ||
-e NEXT_PUBLIC_URL \ | ||
-e ICON \ | ||
-e LOGO \ | ||
pmndrs-docs npm run build | ||
|
||
kill $(lsof -ti:"$_PORT") | ||
npx serve $MDX -p $_PORT --no-port-switching --no-clipboard & | ||
npx -y serve "$MDX/out" & | ||
|
||
wait | ||
) | ||
``` | ||
|
||
Then go to: http://localhost:3000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: Reusable GitHub Actions workflow | ||
description: Call from your CI | ||
nav: 3 | ||
--- | ||
|
||
`pmndrs/docs` provides a [`build.yml`](.github/workflows/build.yml) reusable workflow, any project can use: | ||
|
||
```yml | ||
uses: pmndrs/docs/.github/workflows/build.yml@main | ||
with: | ||
mdx: './docs' | ||
libname: 'React Three Fiber' | ||
libname_short: 'r3f' | ||
home_redirect: '/getting-started/introduction' | ||
icon: '🇨🇭' | ||
logo: '/logo.png' | ||
``` | ||
See [`pmndrs/react-three-fiber/.github/workflows/docs.yml`](https://github.com/pmndrs/react-three-fiber/blob/master/.github/workflows/docs.yml) for an example implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters