Skip to content

Doc defaults leak - #879

Open
simonwalbrun-lab wants to merge 3 commits into
doorstop-dev:developfrom
simonwalbrun-lab:doc_defaults_leak
Open

simonwalbrun-lab wants to merge 3 commits into
doorstop-dev:developfrom
simonwalbrun-lab:doc_defaults_leak

Conversation

@simonwalbrun-lab

Copy link
Copy Markdown
Contributor

closes #866

Summary
The document metadata used for publishing (name, title, ref, by, major/minor revision, copyright) is configured under attributes: defaults: doc: in .doorstop.yml. doorstop add applies everything under attributes.defaults to the new item, so every new item also gets a copy of the document's doc: block

-->
The document revision (major/minor) is copied into each item at creation time. When the revision is bumped later, older items keep the old value, so items end up with stale, inconsistent revision data.

I moved the doc block one level up.

  • New key attributes: doc: (next to defaults, publish, reviewed), read by get_document_attributes() for LaTeX, HTML and Markdown.
  • Backward compatible: an existing attributes: defaults: doc: keeps working. It is moved out of the item defaults on load (so it no longer leaks) and logs a deprecation warning.

This branch has not been deployed

No deployments
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.

attributes.defaults.doc (publish metadata) is copied into every new item: intended?

1 participant