Skip to content

Split export state into a read-only merged exported and a host-owned meta_exported switch - #5

Merged
jph00 merged 1 commit into
mainfrom
pr/split-export-state-into-a-read-only-merged
Jul 27, 2026
Merged

Split export state into a read-only merged exported and a host-owned meta_exported switch#5
jph00 merged 1 commit into
mainfrom
pr/split-export-state-into-a-read-only-merged

Conversation

@jph00

@jph00 jph00 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Message.exported is now read-only: True when an nbdev export directive is present in either the content comments or the meta nbdev dict, merged with comments winning, matching nbdev's own rule. The new read-write Message.meta_exported covers only the meta entry: assigning True writes meta['nbdev']['export']='true', assigning False removes the entry, and content is never touched.

The two sources have different owners - a #| line is text the user edits directly, the meta entry is the host's switch - so the old setter's silent migration (hoisting a content directive into meta on assignment) is gone along with the ambiguity it papered over.

Breaking: assigning Message.exported now raises. Hosts that toggled export state through it should assign meta_exported instead; code that only read exported is unchanged.

@jph00 jph00 added the enhancement New feature or request label Jul 27, 2026
@jph00
jph00 merged commit bcad47a into main Jul 27, 2026
1 check failed
@jph00
jph00 deleted the pr/split-export-state-into-a-read-only-merged branch July 27, 2026 12:19
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.

1 participant