Poimandres Full documentation content. @pmndrs/docs storybook storybook playwright A static MDX documentation generator, with a GitHub [reusable workflow](./github-actions.mdx). It is primarily used for some `pmndrs/*` projects, but will work for anyone. ![Gutenberg lithography](gutenberg.jpg) [Those projects](https://github.com/search?q=%22uses%3A+pmndrs%2Fdocs%2F.github%2Fworkflows%2Fbuild.yml%22+language%3AYAML&type=code&l=YAML) are known to be using this generator. ## INSTALL Pre-requisites: - Install [nvm](https://github.com/nvm-sh/nvm), then: ```sh $ nvm install $ nvm use $ node -v # make sure your version satisfies package.json#engines.node ``` nb: if you want this node version to be your default nvm's one: `nvm alias default node` ```sh $ git clone https://github.com/pmndrs/docs.git $ cd docs $ pnpm install ``` ## Configuration > [!IMPORTANT] > > Default value is always: `""` (think *empty*). | var | description | example | | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | | `MDX`\* | Path to `*.mdx` folder
NB: can be relative or absolute | `docs` or `~/code/myproject/documentation` | | `NEXT_PUBLIC_LIBNAME`\* | Library name | `React Three Fiber` | | `NEXT_PUBLIC_LIBNAME_SHORT` | Library short name | `r3f` | | `BASE_PATH` | Base path for the final URL | `/react-three-fiber` | | `DIST_DIR` | Path to the output folder ([within project](https://nextjs.org/docs/app/api-reference/next-config-js/distDir#:~:text=should%20not%20leave%20your%20project%20directory)) | `out` or `docs/out/react-three-fiber` | | `OUTPUT` | Set to `export` for static output | `export` | | `HOME_REDIRECT` | Where the home should redirect | `/getting-started/introduction` | | `MDX_BASEURL` | Base URL for inlining relative images | `http://localhost:60141`or `https://github.com/pmndrs/react-three-fiber/raw/master/docs` | | `SOURCECODE_BASEURL` | Base URL for `sourcecode:` code path | `https://github.com/pmndrs/react-three-fiber/tree/main` | | `EDIT_BASEURL` | Base URL for displaying "Edit this page" URLs | `https://github.com/pmndrs/react-three-fiber/edit/master/docs` | | `NEXT_PUBLIC_URL` | Final URL of the published website | `https://pmndrs.github.io/react-three-fiber` | | `ICON` | Emoji or image to use as (fav)icon (path local to `MDX`) | `๐Ÿ‡จ๐Ÿ‡ญ` or `/icon.png` or `/favicon.ico` | | `LOGO` | Logo src/path (either FQURL or local to `MDX` path) | `/logo.png` or `https://worldvectorlogo.com/r3f.png` | | `GITHUB` | Github URL (its star count shows next to the header link) | `https://github.com/pmndrs/react-three-fiber` | | `DISCORD` | Discord URL | `https://discord.com/channels/740090768164651008/740093168770613279` | | `THEME_PRIMARY` | Primary accent color | `#323e48` | | `THEME_SCHEME` | Theme scheme | `content` or `expressive` or `fidelity` or `monochrome` or `neutral` or `tonalSpot` or `vibrant` | | `THEME_CONTRAST` | Theme contrast -- value between -1 and 1 | `0` or `-1` or `1` or `-.6` | | `THEME_NOTE` | "note" color | `#1f6feb` | | `THEME_TIP` | "tip" color | `#238636` | | `THEME_IMPORTANT` | "important" color | `#8957e5` | | `THEME_WARNING` | "warning" color | `#d29922` | | `THEME_CAUTION` | "caution" color | `#da3633` | | `THEME_STORYBOOK` | "storybook" color | `#ff4785` | | `THEME_NPM` | "npm" color | `#cb3837` | | `THEME_CHROMATIC` | "chromatic" color | `#fc521f` | | `CONTRIBUTORS_PAT` | GitHub token for contributors API and the header star count (see: https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28#list-repository-collaborators) | `ghp_1234567890` | | `LIB_VERSION` | Version label in the sidebar footer (default: `git describe --tags`) | `v1.2.3` | | `TAG_MATCH` | Tags the version label is read from (`git describe --match`) | `v*.*.*` | | `VERSION_URL_TEMPLATE` | URL of a branch deployment; enables the [version switcher](#version-switcher) | `https://mylib-git-{branch:vercel}-myteam.vercel.app` | | `VERSION_PRODUCTION_BRANCH` | Production branch (default: `main`) | `master` | | `VERSION_PRODUCTION_URL` | Production branch URL (default: `NEXT_PUBLIC_URL`) | `https://docs.pmnd.rs` | | `VERSION_BRANCHES` | Regex of the branches the switcher offers | `^(main\|next\|v\d+)$` | | `VERSION_BRANCHES_LIST` | Branches the switcher offers, instead of the remote's | `main,next,v9` | \* Required
`MDX_BASEURL` Given a `advanced/introduction.mdx` file in the `MDX` folder: ```md ![](dog.png) ``` becomes (for a `MDX_BASEURL=http://localhost:60141` value): ```md ![](http://localhost:60141/advanced/dog.png) ``` `http://localhost:60141` being the `MDX` folder served. > [!TIP] > When deployed on GitHub Pages, `MDX_BASEURL` will typically value something like `https://github.com/pmndrs/uikit/raw/main/docs`, thanks to [`build.yml`](.github/workflows/build.yml) rule.
`THEME_*` We implement [m3 design system](https://m3.material.io/styles/color/system/overview), using [material-theme-builder](https://github.com/abernier/material-theme-builder).