Support sub-attribute selection for structured attributes in publish configuration - #830
Merged
jacebrowning merged 5 commits intoAug 26, 2026
Conversation
jacebrowning
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #829
Summary
The
publishlist in.doorstop.ymlpreviously only supported simple string attribute names. Publishing structured attributes (list of dicts) resulted in a raw Python object dump in the output table. This MR extends the publish configuration to allow selecting specific sub-attributes for rendering, including hyperlink support with combined labels.Changes
doorstop/core/publishers/markdown.py_parse_publish_entry()– parsespublishlist entries; backward compatible: string entries behave as before, dict entries use the attribute name directly as key with afieldsconfiguration_render_fields()– renders selected sub-attributes of structured attributes as Markdown links or plain text; supports single-field labels (url: section), combined multi-field labels (url: {label: [file, section], separator: ": "}), and plain text fields; multiple entries joined with<br>_lines_markdown():publishlist now supports both string and dict entries<br>instead of raw Python list dumpyield ""only emitted when table was actually printeddocs/reference/item.md<br>separator)doorstop/core/publishers/tests/helpers.pyYAML_STRUCTURED_ATTRIBUTES– document config with structuredspec-refs-frompublish entryYAML_COMBINED_LABEL_ATTRIBUTES– document config with combined label publish entryYAML_LIST_ATTRIBUTE– document config with plain list attributeYAML_INVALID_PUBLISH_ENTRY– document config withattr: ~for edge case testingdoorstop/core/publishers/tests/test_publisher_markdown.pyMarkdownPublisherTestParsePublishEntry– 5 unit tests for_parse_publish_entry()TestRenderFields– 14 unit tests for_render_fields(), including combined label and separator variantsTestPublishLinesCustomAttributesExtended– 8 integration tests covering all new code paths in_lines_markdown()New
.doorstop.ymlsyntaxBackward Compatibility
Fully backward compatible. All existing string entries in
publishbehave exactly as before.Testing
867 existing tests pass. 25 new tests added.