Skip to content

Fix structured attributes in text and LaTeX publishers - #848

Open
kocaemre wants to merge 1 commit into
doorstop-dev:developfrom
kocaemre:fix-841-structured-publish-text-latex
Open

kocaemre wants to merge 1 commit into
doorstop-dev:developfrom
kocaemre:fix-841-structured-publish-text-latex

Conversation

@kocaemre

@kocaemre kocaemre commented Oct 3, 2026

Copy link
Copy Markdown

Summary

  • Handle structured attributes.publish mapping entries in text and LaTeX publishers instead of passing dicts to item.attribute().
  • Share simple publish-entry parsing/rendering in BasePublisher for non-HTML tabular output.
  • Add regression coverage for text and LaTeX output using the documented fields mapping syntax.

Why

Fixes #841.

Test plan

  • RED: uv run pytest doorstop/core/publishers/tests/test_publisher_text.py::TestModule::test_lines_text_item_with_structured_publish_attribute doorstop/core/publishers/tests/test_publisher_latex.py::TestPublisherModule::test_lines_latex_item_with_structured_publish_attribute -q failed before the fix with TypeError: cannot use 'dict' as a dict key.
  • GREEN: uv run pytest doorstop/core/publishers/tests/test_publisher_text.py::TestModule::test_lines_text_item_with_structured_publish_attribute doorstop/core/publishers/tests/test_publisher_latex.py::TestPublisherModule::test_lines_latex_item_with_structured_publish_attribute -q → 2 passed.
  • uv run pytest doorstop/core/publishers/tests/test_publisher_text.py doorstop/core/publishers/tests/test_publisher_latex.py -q → 32 passed.
  • uv run python -m py_compile doorstop/core/publishers/base.py doorstop/core/publishers/text.py doorstop/core/publishers/latex.py doorstop/core/publishers/tests/test_publisher_text.py doorstop/core/publishers/tests/test_publisher_latex.py
  • git diff --check

Notes

  • uv run pytest doorstop/core/publishers/tests -q was attempted: 128 passed, 1 existing HTML linkify assertion failed outside this change (test_lines_html_item_linkify, mock href escaping difference under this local Python 3.14 environment).
  • AI-assisted implementation; I reviewed the diff and ran the checks above.

Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
@kocaemre
kocaemre force-pushed the fix-841-structured-publish-text-latex branch from 0e9dfd4 to c30bb1a Compare October 3, 2026 21:05
@kocaemre

kocaemre commented Oct 3, 2026

Copy link
Copy Markdown
Author

Follow-up: fixed the Black formatting drift that made the CI make check jobs fail.

Verification after the formatting fix:

  • poetry run pytest doorstop/core/publishers/tests/test_publisher_text.py doorstop/core/publishers/tests/test_publisher_latex.py -q → 32 passed
  • make check → passed (isort, black, mypy, pylint, pydocstyle)
  • make test → 883 passed, 1 warning
  • git diff --check → passed

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.

Structured publish entries break plain text and LaTeX output

1 participant