This directory contains the source code for the documentation website of React Native ExecuTorch, built with Docusaurus.
- Node.js (v20+)
- Yarn
Navigate to the docs directory and install dependencies:
cd docs
yarn installStart the development server. Note: This command automatically generates the API reference from the TypeScript source before starting the site.
yarn startThe site will open at http://localhost:3000/react-native-executorch/.
To build the static files for production:
yarn buildThe output will be generated in the build/ directory.
Using SSH:
$ USE_SSH=true yarn deployNot using SSH:
$ GIT_USER=<Your GitHub username> yarn deployIf you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages branch.
We use docusaurus-plugin-typedoc to automatically generate documentation from the TypeScript source code.
-
Source: The plugin reads
../packages/react-native-executorch/src/index.ts. -
Generation: On
yarn startoryarn build, it generates Markdown files intodocs/06-api-reference. -
Sidebar Integration: Docusaurus strips the number prefix (
06-) from URLs but requires the folder name for configuration. We use a specific sidebar setup to ensure breadcrumbs work while keeping the UI clean.
The "API Reference" section is configured with specific settings to handle breadcrumbs correctly:
-
collapsed: true: Keeps the huge list of API files closed by default. -
linkproperty: Points toapi-reference/index. This ensures clicking the text "API Reference" redirects to the Overview page. -
itemsarray: We nest the autogenerated items inside. This is critical because it creates the parent-child relationship needed for breadcrumbs (e.g.,Home > API Reference > LLMType).
If you change the folder structure, ensure dirName matches the physical folder (06-api-reference), but id uses the Docusaurus ID (api-reference/index).
We use Docusaurus versioning to "freeze" documentation for older releases.
When you release a new npm version (e.g., 1.0.0), you must snapshot the documentation. Run this command from the docs/ folder:
yarn docs:version 1.0.0- It copies the current contents of
docs/(including the currently generated API reference) intoversioned_docs/version-1.0.0. - This ensures that if the TypeScript API changes in the future, the docs for v1.0.0 remain accurate to that version.
Edit files in docs/ as usual. These changes appear in the "Next" version of the site (the default view), reflecting the current main branch.
If you see build errors about duplicate IDs, it usually means an old generation artifact is conflicting with a new one. Run:
yarn clearThis deletes the .docusaurus cache and build folder.
TypeDoc runs strictly at startup. If you modify comments in the TypeScript package:
- Stop the server.
- Run
yarn startagain to regenerate the Markdown files.
showcase-sources.json records the devices, capture and editing details, fixture sources, and licenses for the task showcases. It is contributor metadata and is kept outside static/ so it is not published with the website.