Home | Docs Hub | Back to Maintainers
This guide explains how to generate the WSS documentation hub while keeping code in external repositories.
The docs project lives under apiDocs/ and uses
apiDocs/repos.manifest.json to map each linked repo to a
documentation tool:
kind: csharp -> DocFX metadata/API sectionkind: python -> Sphinx HTML hosted by DocFXjq (required by apiDocs/build-docs.sh on
Bash).Rmd guidesRscript (required to regenerate standalone
.Rmd guides such as this page and the hardware guide)rmarkdown::render() when
regenerating standalone .Rmd guides)rmarkdown, knitrsphinx-build) for Python API
reposIf DocFX isn’t installed, the build script will remind you to run
docfx metadataanddocfx buildonce you add it to PATH.
Use the setup that matches your machine before running the build scripts.
docfx is on your
PATH.jq if you plan to run the Bash build.Typical commands:
dotnet tool install -g docfx
winget install RProject.R
winget install --id JohnMacFarlane.Pandoc -e
python -m pip install -U pip
python -m pip install sphinx
docfx is on your
PATH.jq if you plan to run the Bash build.Typical commands:
brew install --cask dotnet-sdk
brew install --cask r
brew install pandoc
brew install jq
dotnet tool install -g docfx
python3 -m pip install -U pip
python3 -m pip install sphinx
Rscript -e "install.packages(c('rmarkdown', 'knitr'), repos='https://cloud.r-project.org')"
If docfx is not found after installing it as a .NET
global tool, add ~/.dotnet/tools to your shell
PATH.
docfx is on your
PATH.jq.pip.Typical commands:
sudo apt install -y r-base
sudo apt install -y pandoc
sudo apt install -y jq
dotnet tool install -g docfx
python3 -m pip install -U pip
python3 -m pip install sphinx
Rscript -e "install.packages(c('rmarkdown', 'knitr'), repos='https://cloud.r-project.org')"
Install the .NET SDK with your distribution’s package manager or Microsoft’s installer for your distro before running the commands above.
If docfx is not found after installing it as a .NET
global tool, add ~/.dotnet/tools to your shell
PATH.
If rmarkdown::render() reports that Pandoc is missing,
install pandoc and retry the docs build.
If R package installation fails because the system library is not writable, install to a user library instead:
mkdir -p "$HOME/R/x86_64-pc-linux-gnu-library/4.3"
Rscript -e ".libPaths('$HOME/R/x86_64-pc-linux-gnu-library/4.3'); install.packages(c('rmarkdown', 'knitr'), repos='https://cloud.r-project.org')"
Edit apiDocs/repos.manifest.json and add one entry per
linked repo.
This repo’s default manifest is written to use environment variables
for the linked repo roots (for example:
"root": "${WSS_CORE_REPO_ROOT}"). The build scripts expand
${VARNAME} tokens at runtime.
Quick start:
If you only want the main/core docs, add the main-only flag:
./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json --main./apiDocs/build-docs.ps1 -ManifestPath ./apiDocs/repos.manifest.json -MainWhen --main or -Main is set, the build only
includes the core manifest entry. In the default manifest,
that core entry points at the root
WSS_Core_Interface.sln, so main/core docs include the
shared core plus any transport projects linked into that solution.
Without that flag, the scripts build all enabled repositories.
If you want to skip Python docs, add the skip-Python flag:
./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json --skip-python./apiDocs/build-docs.ps1 -ManifestPath ./apiDocs/repos.manifest.json -SkipPythonWhen --skip-python or -SkipPython is set,
the scripts skip Sphinx builds for kind: python manifest
entries while still building the DocFX hub and any enabled C# API
sections.
Python integration docs for the library are not currently supported
in this local build workflow. For now, use --skip-python in
Bash or -SkipPython in PowerShell.
If you want to skip standalone RMarkdown rerendering, add the skip-RMD flag:
./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json --skip-rmd./apiDocs/build-docs.ps1 -ManifestPath ./apiDocs/repos.manifest.json -SkipRmdWhen --skip-rmd or -SkipRmd is set, the
scripts skip regenerating the standalone .Rmd-based HTML
guides while still building the DocFX hub and any enabled API
sections.
Set these to your local checkouts:
WSS_CORE_REPO_ROOT (C# core solution):
/path/to/WSSCoreInterfaceWSS_CSHARP_REPO_ROOT (C# integration):
/path/to/HFI_WSS_Csharp_ImplementationWSS_UNITY_REPO_ROOT (Unity repo / Unity project root):
/path/to/Project using HFI_WSS_Unity_InterfaceWSS_UNITY_INTEGRATION_SRC (Unity integration submodule
root inside the Unity project)
$WSS_UNITY_REPO_ROOT/Assets/SubModules/WSSInterfacingModuleWSS_PYTHON_REPO_ROOT (Python integration)
docs/ folder (with docs/conf.py)./path/to/WSS_Python_Wrapper/WSS_Py_WrapperExamples:
export WSS_CORE_REPO_ROOT="/path/to/WSSCoreInterface"
export WSS_CSHARP_REPO_ROOT="/path/to/HFI_WSS_Csharp_Implementation"
export WSS_UNITY_REPO_ROOT="/path/to/SimpleStimulationConsole"
export WSS_UNITY_INTEGRATION_SRC="$WSS_UNITY_REPO_ROOT/Assets/SubModules/WSSInterfacingModule"
export WSS_PYTHON_REPO_ROOT="/path/to/WSS_Python_Wrapper/WSS_Py_Wrapper"
$env:WSS_CORE_REPO_ROOT = 'C:\\path\\to\\WSSCoreInterface'
$env:WSS_CSHARP_REPO_ROOT = 'C:\\path\\to\\HFI_WSS_Csharp_Implementation'
$env:WSS_UNITY_REPO_ROOT = 'C:\\path\\to\\SimpleStimulationConsole'
$env:WSS_UNITY_INTEGRATION_SRC = "$env:WSS_UNITY_REPO_ROOT\\Assets\\SubModules\\WSSInterfacingModule"
$env:WSS_PYTHON_REPO_ROOT = 'C:\\path\\to\\WSS_Python_Wrapper\\WSS_Py_Wrapper'
For C# repos provide: - root: repo root path -
csproj: path to a C# project file relative to
root - or solution: path to a C# solution file
relative to root - docfxDest: unique output
section (example: api/core)
Use solution when one repository should publish all
projects that belong to a shared root solution. This is the preferred
setup for the WSS core repo so new transport projects are picked up
automatically.
Optional (C#): entryUid
The hub auto-generates apiDocs/index.md links for each
enabled C# repo. If you set entryUid, the index link will
use xref:<entryUid> (a stable link to a
namespace/type) instead of linking to a generated TOC file.
How to pick entryUid:
apiDocs/api/<docfxDest>/toc.yml.Example:
apiDocs/api/csharp/toc.yml starts with
- uid: HFI.Wss, set entryUid to
HFI.Wss.For Python repos provide: - root: repo root path -
sphinxSource: source docs folder (usually
docs) - publishDir: destination under this
docs repo (example: external/python-tools)
Selecting the correct Python root +
sphinxSource
root must be the Python project root that contains the
Sphinx docs/ folder.sphinxSource should point to the directory that
contains conf.py (usually docs).Example (WSS_Python_Wrapper):
root:
/home/lemf/Documents/GitHub/WSS_Python_Wrapper/WSS_Py_WrappersphinxSource: docs (because
docs/conf.py exists under that root)Build with manifest:
./apiDocs/build-docs.ps1 -ManifestPath ./apiDocs/repos.manifest.json
Build only the main/core docs:
./apiDocs/build-docs.ps1 -ManifestPath ./apiDocs/repos.manifest.json -Main
Serve locally after build:
./apiDocs/build-docs.ps1 -ManifestPath ./apiDocs/repos.manifest.json -Serve
After the command starts the local server, look for the
localhost URL printed by DocFX in the terminal (for
example, http://localhost:8080) and open it in your
browser.
Execution policy
If scripts are blocked:
powershell -NoProfile -ExecutionPolicy Bypass -File ".\\apiDocs\\build-docs.ps1" -ManifestPath ".\\apiDocs\\repos.manifest.json"
Build with manifest:
./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json
Build only the main/core docs:
./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json --main
Build the docs hub without Python and without rerendering standalone RMarkdown docs:
./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json --skip-python --skip-rmd
Serve locally after build:
./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json --serve
After the command starts the local server, look for the
localhost URL printed by DocFX in the terminal (for
example, http://localhost:8080) and open it in your
browser.
Permission denied
If ./apiDocs/build-docs.sh returns
Permission denied:
chmod +x ./apiDocs/build-docs.sh
./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json
If execute permission cannot be changed (for example, restricted mount/ACL), run through Bash directly:
bash ./apiDocs/build-docs.sh --manifest ./apiDocs/repos.manifest.json
apiDocs/repos.manifest.json--main / -Main is set, keeps only the
core entry and skips all optional external
integrations--skip-rmd / -SkipRmd is used:
hardwareDocs/wsshardware.rmdhowtoCompileAPIDocs/BuildSoftwareDocs.RmdsimpleSerialPortDocs/SimpleSerial.RmdwssCommandsDocs/wsscommands.RmdapiDocs/external/<repo-id>apiDocs/docfx.generated.json) with one metadata section
per C# repoapiDocs/index.md and
apiDocs/toc.yml so all sections are accessible from the
main pagedocfx metadata then docfx buildIf you add another standalone .Rmd guide that should be
regenerated as part of the docs build:
rmd_docs array in
apiDocs/build-docs.sh.$rmdDocs array in
apiDocs/build-docs.ps1.myDocs/MyGuide.Rmd)..html output is regenerated.If a Unity repository contains a UI/app .csproj but the
integration code you want to document is a submodule folder (not a
standalone project), use the provided shim project:
apiDocs/shims/UnitySubmodule/UnitySubmodule.Docs.csprojAdd a C# repo entry pointing to the shim and pass the integration folder via MSBuild properties:
{
"id": "unity-integration",
"title": "API: Unity Integration (C#)",
"kind": "csharp",
"enabled": true,
"root": "${WSS_UNITY_REPO_ROOT}",
"csprojBase": "hub",
"csproj": "apiDocs/shims/UnitySubmodule/UnitySubmodule.Docs.csproj",
"docfxDest": "api/unity",
"msbuildProperties": {
"DocsSourceRoot": "${WSS_UNITY_INTEGRATION_SRC}",
"DefineConstants": "UNITY_2021_3_OR_NEWER;UNITY_EDITOR"
}
}
Where:
WSS_UNITY_REPO_ROOT points at the Unity app repo.WSS_UNITY_INTEGRATION_SRC points at the submodule
folder you want documented.
apiDocs/ (for
example: apiDocs/index.html)apiDocs/index.html in a browser (or use
-Serve in PowerShell)Install DocFX and ensure docfx is on PATH, then
run:
cd \"A:\\Documents\\GIT Projects\\WSS-documentation\\apiDocs\"
docfx metadata && docfx buildroot in repos.manifest.json
exists.csproj is correct relative to
root.sphinxSource exists and Sphinx is
installed.python -m pip install -e '.[docs]' or install
docs/requirements.txt).conf.py modifies sys.path, confirm it
points at the correct src/ directory.apiDocs/ — DocFX project (docfx.json, templates,
tools)apiDocs/build-docs.ps1 — PowerShell build script
(Windows)apiDocs/build-docs.sh — Bash build script
(macOS/Linux/Git Bash)apiDocs/ (HTML files plus
api/, conceptual/, styles/)Navigation: