-
Notifications
You must be signed in to change notification settings - Fork 251
[Docs] Convert Sphinx docs to Fern #2411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0940df6
[Docs] Convert Sphinx docs to Fern
msarahan 82d5527
Address Fern migration review comments
msarahan a0aab78
Address follow-up Fern review comments
msarahan 43b1b47
Sanitize generated C++ signatures
msarahan d1696b2
Preserve full Doxygen content in Fern API pages
msarahan 75f1eba
Defer Fern API reference generation
msarahan 8624ca7
Remove legacy API link placeholders
msarahan 5a7c39e
Generate API docs through Sphinx Markdown
msarahan 4a94502
Support repo-local docs environment
msarahan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains hidden or 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,105 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
| REPO_DIR=$(cd "${SCRIPT_DIR}/.." && pwd) | ||
| MODE="${1:-check}" | ||
|
|
||
| if [[ $# -gt 0 ]]; then | ||
| shift | ||
| fi | ||
|
|
||
| usage() { | ||
| cat <<'EOF' | ||
| Usage: fern/build_docs.sh [check|preview|publish|dev] [fern arguments...] | ||
|
|
||
| Modes: | ||
| check Validate Fern configuration, links, and Markdown syntax. | ||
| preview Build and publish a Fern preview deployment. | ||
| publish Build and publish the production Fern docs site. | ||
| dev Start Fern's local docs preview server. | ||
| EOF | ||
| } | ||
|
|
||
| require_node_18() { | ||
| if ! command -v node >/dev/null 2>&1; then | ||
| echo "Fern docs require Node.js 18 or newer, but node was not found on PATH." >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| local node_version | ||
| local node_major | ||
| node_version=$(node -p 'process.versions.node' 2>/dev/null || true) | ||
| node_major="${node_version%%.*}" | ||
|
|
||
| if [[ ! "${node_major}" =~ ^[0-9]+$ || "${node_major}" -lt 18 ]]; then | ||
| echo "Fern docs require Node.js 18 or newer, but found Node.js ${node_version:-unknown}." >&2 | ||
| exit 1 | ||
| fi | ||
| } | ||
|
|
||
| require_node_18 | ||
|
|
||
| if [[ -n "${FERN_CLI:-}" ]]; then | ||
| FERN_CMD=("${FERN_CLI}") | ||
| elif command -v fern >/dev/null 2>&1; then | ||
| FERN_CMD=("fern") | ||
| else | ||
| FERN_CMD=("npx" "--yes" "fern-api@5.30.4") | ||
| fi | ||
|
|
||
| run_fern() { | ||
| "${FERN_CMD[@]}" "$@" | ||
| } | ||
|
|
||
| generate_api_reference() { | ||
| pushd "${REPO_DIR}" >/dev/null | ||
| python3 fern/scripts/generate_api_reference.py | ||
| popd >/dev/null | ||
| } | ||
|
|
||
| run_checks() { | ||
| pushd "${REPO_DIR}" >/dev/null | ||
| run_fern check --warnings | ||
| run_fern docs md check | ||
| popd >/dev/null | ||
| } | ||
|
|
||
| case "${MODE}" in | ||
| check) | ||
| generate_api_reference | ||
| run_checks | ||
| ;; | ||
| preview) | ||
| generate_api_reference | ||
| run_checks | ||
| pushd "${REPO_DIR}" >/dev/null | ||
| run_fern generate --docs --preview "$@" | ||
| popd >/dev/null | ||
| ;; | ||
| publish) | ||
| generate_api_reference | ||
| run_checks | ||
| pushd "${REPO_DIR}" >/dev/null | ||
| run_fern generate --docs "$@" | ||
| popd >/dev/null | ||
| ;; | ||
| dev) | ||
| generate_api_reference | ||
| pushd "${REPO_DIR}" >/dev/null | ||
| run_fern docs dev "$@" | ||
| popd >/dev/null | ||
| ;; | ||
| -h|--help|help) | ||
| usage | ||
| ;; | ||
| *) | ||
| echo "Unknown mode: ${MODE}" >&2 | ||
| echo >&2 | ||
| usage >&2 | ||
| exit 2 | ||
| ;; | ||
| esac | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.