Skip to content

add exec_all option to run all cells during docs rendering - #1665

Merged
jph00 merged 1 commit into
mainfrom
exec-doc
Nov 5, 2026
Merged

jph00 merged 1 commit into
mainfrom
exec-doc

Conversation

@jackhogan

Copy link
Copy Markdown
Contributor

explanations/docs.ipynb already says that exec_all: true in a notebook's frontmatter makes nbdev execute all cells when rendering docs, but nothing currently reads the flag. exec_show_docs runs only exports, imports, show_doc calls and cells marked #| exec_doc, and skips a notebook with no exports or show_doc calls altogether.

After this change, with exec_all set (either in frontmatter or under [tool.nbdev]), exec_show_docs runs every code cell that nbdev-test would run: eval: false, the notebook's eval default, tst_flags and the skip-execution tag are honoured, and skip_showdoc still wins. Execution happens before rm_export and hide_, so cells run with their full source.

Will be useful for a project that strips or clears outputs before committing (#1664) but still wants those outputs in the rendered docs.

@jackhogan jackhogan self-assigned this Nov 5, 2026
@jackhogan jackhogan added the enhancement New feature or request label Nov 5, 2026
@jackhogan
jackhogan requested a review from jph00 November 5, 2026 16:17
@jph00

jph00 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Great! :)

@jph00
jph00 merged commit f7fa129 into main Nov 5, 2026
16 checks passed
@jph00
jph00 deleted the exec-doc branch November 5, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants