You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
attributes.defaults.doc (publish metadata) is copied into every new item: intended? #866
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. Is this intended?
The new item contains the document metadata as an item attribute:
doc:
major: '3'minor: Btitle: My Specowner: me
Expected
Only owner: me. The doc: block configures the published document, not its items.
Why it matters
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.
It happens in this repository too: items created in reqs/ get a doc: attribute.
Question
Is this intended? Reusing attributes.defaults for document metadata looks like a side effect: as far as I can tell, doc was added to defaults for the LaTeX publisher around #628. defaults is documented as "values copied into new items".
If it is not intended, I have a fix ready and can open a PR:
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.
Tests, docs (docs/reference/document.md) and the repo's own reqs/*.doorstop.yml updated.
If you'd prefer a different location (e.g. a top-level doc: section), or would rather just exclude doc from the defaults applied by doorstop add, I'm happy to adapt.
Activity