Repository navigation
docs(fern): add local library autodocs without Fern auth - #2102
Conversation
Add a nemo-curator-local path-based library entry for Docker-based generation via --local, pin CI to the git-based nemo-curator library, and bump the Fern CLI pin to 5.50.4. Signed-off-by: Lawrence Lane <llane@nvidia.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Pin docs-generate-library to the git-based nemo-curator entry and add docs-generate-library-local for unauthenticated Docker-based generation. Signed-off-by: Lawrence Lane <llane@nvidia.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Greptile SummaryThis PR adds a local, no-auth path for generating the Python API reference using Docker (
Confidence Score: 5/5Safe to merge — all CI paths use the committed git-based library entry and are unaffected by the new local flow. The change is confined to documentation, a new developer-only shell script, and adding the --library nemo-curator flag to CI steps. The nemo-curator-local path entry is never committed to docs.yml, so fern generate --docs and fern docs dev in CI see no change. The shell script is well-guarded (set -euo pipefail, pre-flight grep checks, trap-based restore), and the Fern CLI version bump is straightforward. fern/scripts/generate-library-local.sh — the docs.yml.bak backup file is not gitignored, which could lead to accidental staging after an interrupted run. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Developer] -->|npm run generate:library:local| B[generate-library-local.sh]
B --> C{docs.yml has nemo-curator-local?}
C -->|Yes - abort| D[Exit: committed path entry breaks fern docs dev]
C -->|No| E[cp docs.yml docs.yml.bak / trap to restore on EXIT]
E --> F[awk injects nemo-curator-local path entry into docs.yml]
F --> G[npx fern-api@5.50.4 docs md generate --local --library nemo-curator-local]
G --> H[Docker pulls fernapi/fern-python-library-docs-parser]
H --> I[MDX written to product-docs/.../Full-Library-Reference]
I --> J[trap fires: mv docs.yml.bak docs.yml]
J --> K[docs.yml restored]
A2[CI: push tag / PR] -->|fern docs md generate --library nemo-curator| L[Fern cloud generation git-based, needs FERN_TOKEN]
L --> M[MDX written to product-docs/.../Full-Library-Reference]
M --> N[fern generate --docs publish / preview]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[Developer] -->|npm run generate:library:local| B[generate-library-local.sh]
B --> C{docs.yml has nemo-curator-local?}
C -->|Yes - abort| D[Exit: committed path entry breaks fern docs dev]
C -->|No| E[cp docs.yml docs.yml.bak / trap to restore on EXIT]
E --> F[awk injects nemo-curator-local path entry into docs.yml]
F --> G[npx fern-api@5.50.4 docs md generate --local --library nemo-curator-local]
G --> H[Docker pulls fernapi/fern-python-library-docs-parser]
H --> I[MDX written to product-docs/.../Full-Library-Reference]
I --> J[trap fires: mv docs.yml.bak docs.yml]
J --> K[docs.yml restored]
A2[CI: push tag / PR] -->|fern docs md generate --library nemo-curator| L[Fern cloud generation git-based, needs FERN_TOKEN]
L --> M[MDX written to product-docs/.../Full-Library-Reference]
M --> N[fern generate --docs publish / preview]
Reviews (3): Last reviewed commit: "docs(fern): inject local library entry a..." | Re-trigger Greptile |
| nemo-curator-local: | ||
| input: | ||
| path: ../nemo_curator | ||
| output: | ||
| path: ./product-docs/nemo-curator/Full-Library-Reference | ||
| lang: python |
There was a problem hiding this comment.
Shared output path produces silently smaller reference on local machines
Both nemo-curator and nemo-curator-local write to the same Full-Library-Reference/ directory. Running generate:library:local after generate:library overwrites the full 424-page set with the beta Docker-parsed subset. A developer iterating locally may not notice the missing pages until they compare output sizes. The docs call this out, but a runtime guard — even just an echo warning — in the Makefile/npm script that the local flow produces fewer pages and overwrites any previous full generation would prevent confusion.
…mmitting it
A committed path-input library entry breaks 'fern docs dev' and
'fern generate --docs': the docs config parser rejects any
'input.path' library ("'path' input which is not yet supported.
Please use 'git' input.") and renders a blank page. Meanwhile
'fern docs md generate --local' only accepts path inputs, so the
entry can't live in docs.yml at all.
Move the nemo-curator-local entry out of docs.yml and into
scripts/generate-library-local.sh, which injects it temporarily,
runs the local generation, and restores docs.yml on exit. The npm
script and Makefile target now call the script; CI flows are
unchanged.
Verified in the fern-api/fern source and npm bundles that the parser
throw exists in 5.50.4 (our pin) and 5.65.5 (latest), and that
'fern check' does not catch it — only 'docs dev'/builds fail.
Signed-off-by: Lawrence Lane <llane@nvidia.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Pushed 9e68e26: the committed Since |
|
/ok to test 9e68e26 |
…#2102) * docs(fern): add local library autodocs generation without Fern auth Add a nemo-curator-local path-based library entry for Docker-based generation via --local, pin CI to the git-based nemo-curator library, and bump the Fern CLI pin to 5.50.4. Signed-off-by: Lawrence Lane <llane@nvidia.com> Co-authored-by: Cursor <cursoragent@cursor.com> * docs(fern): align Makefile library generate targets with dual config Pin docs-generate-library to the git-based nemo-curator entry and add docs-generate-library-local for unauthenticated Docker-based generation. Signed-off-by: Lawrence Lane <llane@nvidia.com> Co-authored-by: Cursor <cursoragent@cursor.com> * docs(fern): inject local library entry at generate time instead of committing it A committed path-input library entry breaks 'fern docs dev' and 'fern generate --docs': the docs config parser rejects any 'input.path' library ("'path' input which is not yet supported. Please use 'git' input.") and renders a blank page. Meanwhile 'fern docs md generate --local' only accepts path inputs, so the entry can't live in docs.yml at all. Move the nemo-curator-local entry out of docs.yml and into scripts/generate-library-local.sh, which injects it temporarily, runs the local generation, and restores docs.yml on exit. The npm script and Makefile target now call the script; CI flows are unchanged. Verified in the fern-api/fern source and npm bundles that the parser throw exists in 5.50.4 (our pin) and 5.65.5 (latest), and that 'fern check' does not catch it — only 'docs dev'/builds fail. Signed-off-by: Lawrence Lane <llane@nvidia.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Signed-off-by: Lawrence Lane <llane@nvidia.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Description
Adds a no-auth local flow for generating the Python API reference.
npm run generate:library:local(ormake docs-generate-library-local) runsfern/scripts/generate-library-local.sh, which temporarily injects a path-basednemo-curator-locallibrary entry intodocs.yml, runs Fern'sdocs md generate --local(Docker, no Fern login), and restoresdocs.ymlon exit.The entry is injected rather than committed because the Fern CLI has two conflicting rules (verified in
fern-api/fernsource, present in 5.50.4 and latest 5.65.5):fern docs md generate --localrequires apathinput (git inputs are remote-only and need auth), butfern docs dev/fern generate --docsreject any docs.yml containing apathinput library ("'path' input which is not yet supported. Please use 'git' input.") and render a blank page.fern checkdoes not catch this.CI and publish/preview workflows are pinned to
--library nemo-curatorso the git-based remote generation path is unchanged. Also bumps the Fern CLI pin to 5.50.4 and documents both flows infern/README.md,fern/AUTODOCS_GUIDE.md, and the docs agent skill.Usage
Checklist
Made with Cursor