|
| 1 | +# NeMo Automodel Fern Documentation |
| 2 | + |
| 3 | +This folder contains the Fern Docs configuration for NeMo Automodel. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +```bash |
| 8 | +npm install -g fern-api |
| 9 | +# Or: npx fern-api --version |
| 10 | +``` |
| 11 | + |
| 12 | +## Local Preview |
| 13 | + |
| 14 | +```bash |
| 15 | +cd fern/ |
| 16 | +fern docs dev |
| 17 | +# Or from project root: fern docs dev --project ./fern |
| 18 | +``` |
| 19 | + |
| 20 | +Docs available at `http://localhost:3000`. |
| 21 | + |
| 22 | +## Folder Structure |
| 23 | + |
| 24 | +``` |
| 25 | +fern/ |
| 26 | +├── docs.yml # Global config (title, colors, versions) |
| 27 | +├── fern.config.json # Fern CLI config |
| 28 | +├── versions/ |
| 29 | +│ └── v0.1.0.yml # Navigation for v0.1.0 |
| 30 | +├── v0.1.0/ |
| 31 | +│ └── pages/ # MDX content for v0.1.0 |
| 32 | +├── scripts/ # Migration and conversion scripts |
| 33 | +└── assets/ # Favicon, images |
| 34 | +``` |
| 35 | + |
| 36 | +## Migration Workflow |
| 37 | + |
| 38 | +To migrate or update docs from `docs/` to Fern: |
| 39 | + |
| 40 | +```bash |
| 41 | +# 1. Copy docs to fern (run from repo root) |
| 42 | +python3 fern/scripts/copy_docs_to_fern.py v0.1.0 |
| 43 | + |
| 44 | +# 2. Expand {include} directives (index) |
| 45 | +python3 fern/scripts/expand_includes.py fern/v0.1.0/pages |
| 46 | + |
| 47 | +# 3. Convert Automodel-specific syntax (if any) |
| 48 | +python3 fern/scripts/convert_automodel_specific.py fern/v0.1.0/pages |
| 49 | + |
| 50 | +# 4. Convert MyST to Fern MDX |
| 51 | +python3 fern/scripts/convert_myst_to_fern.py fern/v0.1.0/pages |
| 52 | + |
| 53 | +# 5. Add frontmatter |
| 54 | +python3 fern/scripts/add_frontmatter.py fern/v0.1.0/pages |
| 55 | + |
| 56 | +# 6. Update internal links |
| 57 | +python3 fern/scripts/update_links.py fern/v0.1.0/pages |
| 58 | + |
| 59 | +# 7. Remove duplicate H1s (when title matches frontmatter) |
| 60 | +python3 fern/scripts/remove_duplicate_h1.py fern/v0.1.0/pages |
| 61 | + |
| 62 | +# 8. Validate |
| 63 | +./fern/scripts/check_unconverted.sh fern/v0.1.0/pages |
| 64 | +``` |
| 65 | + |
| 66 | +## MDX Components |
| 67 | + |
| 68 | +```mdx |
| 69 | +<Note>Informational note</Note> |
| 70 | +<Tip>Helpful tip</Tip> |
| 71 | +<Warning>Warning message</Warning> |
| 72 | +<Info>Info callout</Info> |
| 73 | + |
| 74 | +<Cards> |
| 75 | + <Card title="Title" href="/path">Description</Card> |
| 76 | +</Cards> |
| 77 | + |
| 78 | +<Tabs> |
| 79 | + <Tab title="Python">```python\ncode\n```</Tab> |
| 80 | +</Tabs> |
| 81 | + |
| 82 | +<Accordion title="Details">Collapsible content</Accordion> |
| 83 | +``` |
| 84 | + |
| 85 | +## API Reference |
| 86 | + |
| 87 | +API docs are built by Sphinx (autodoc2) and hosted at docs.nvidia.com. The "API Reference" link in the navbar points to `https://docs.nvidia.com/nemo/automodel/latest/apidocs/`. |
| 88 | + |
| 89 | +## Deploying |
| 90 | + |
| 91 | +```bash |
| 92 | +fern generate --docs |
| 93 | +fern docs deploy |
| 94 | +``` |
| 95 | + |
| 96 | +## Useful Links |
| 97 | + |
| 98 | +- [Fern Docs](https://buildwithfern.com/learn/docs) |
| 99 | +- [MDX Components](https://buildwithfern.com/learn/docs/components) |
| 100 | +- [Versioning Guide](https://buildwithfern.com/learn/docs/configuration/versions) |
0 commit comments