Library docs generator Beta
Library docs generator Beta
The library docs generator parses your Python or C++ library source code and generates MDX documentation pages for modules, classes, functions, methods, and parameters. Generated pages include cross-reference links and hierarchical navigation, and are integrated directly into your Fern Docs site.
Configuration
Define your libraries in docs.yml
Add a libraries entry to your docs.yml file. Each library needs an input source (the repo to parse), an output.path (where generated MDX files are written), and a lang (python or cpp).
You can define multiple libraries in the same file.
Generate the library docs
Run the CLI command to generate MDX files from your library source code:
The command clones the repository, parses the source code, and writes MDX files to the output directory.
If you have multiple libraries configured, fern docs md generate processes all libraries in parallel. Use --library plant-sdk to generate docs for a specific library only.
Multiple libraries example
You can define and reference multiple libraries in the same docs.yml:
Customize generated docs (optional)
You can reorganize the output directory to restructure the sidebar navigation. Move, rename, or nest files and subfolders, and Fern picks up the new layout on the next fern docs dev or publish.
For example, splitting ./static/plant-sdk-docs into getting-started/ and reference/ subfolders produces two sidebar sections:
You can also edit page content by modifying the MDX files directly — generated pages are standard MDX, so you can add prose, examples, callouts, or any component. Re-running fern docs md generate overwrites everything in output.path, so commit your customizations first, and keep hand-edited pages outside the output directory if you plan to regenerate.
Configuration reference
GitHub URL of the repository containing the library source code.
Path within the repository to the library source. Useful for monorepos.
Directory where the generated MDX files are written, relative to the fern/ directory.
The language of the library. Supported values: python, cpp.
Path to a custom Doxyfile. C++ only.