Skip to content

feat: read docstrings from doc-gen4#776

Open
david-christiansen wants to merge 21 commits intomainfrom
docgen-dump-docstrings
Open

feat: read docstrings from doc-gen4#776
david-christiansen wants to merge 21 commits intomainfrom
docgen-dump-docstrings

Conversation

@david-christiansen
Copy link
Copy Markdown
Collaborator

@david-christiansen david-christiansen commented Mar 1, 2026

This PR adds the ability to read docstrings from doc-gen4's SQLite database instead of the environment.

This has the following benefits:

  • It is compatible with the module system, in which docstrings are only available in server oleans and cannot be read during batch compilation. Using modules can massively reduce incremental build times for complex documents.
  • The environment of a document contains both the library being documented and the documentation system itself. Code from Verso such as instances could leak into the documentation itself. Reading a database produced without Verso allows greater control.
  • The database allows efficient checks of cross-cutting information without importing large modules. It can discover things like all the instances in a library's transitive import chain.

I've verified that the reference manual builds against this branch with only trivial changes (four modified files, two of which are the Lakefile and Lake manifest). The internal Verso user manual now uses the module system, demonstrating that the approach actually works.

As part of making the Verso user's guide use the module system, most of Verso itself was also migrated to the module system.

This PR implements an alternative path to docstring rendering that
reads the necessary data from a doc-gen4 SQLite database, to work
around the fact that docstring info is no longer available in the
environment with the module system and to allow a global view of the
project for things like instance lists.
@david-christiansen david-christiansen changed the title Docgen dump docstrings feat: read docstrings from doc-gen4 Mar 29, 2026
@david-christiansen david-christiansen marked this pull request as ready for review March 29, 2026 18:28
@github-actions
Copy link
Copy Markdown
Contributor

Preview for this PR is ready! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant