Skip to content

feat: Add element content capture (Issue #159)#191

Merged
rdmueller merged 3 commits intodocToolchain:mainfrom
raifdmueller:feature/elements-content-159-clean
Jan 26, 2026
Merged

feat: Add element content capture (Issue #159)#191
rdmueller merged 3 commits intodocToolchain:mainfrom
raifdmueller:feature/elements-content-159-clean

Conversation

@raifdmueller
Copy link
Collaborator

Summary

Implements Issue #159: Add content capture to elements API/CLI.

Elements now capture their actual content (code, tables, lists, diagrams) and expose it via:

  • MCP tool: get_elements(include_content=True, content_limit=N)
  • CLI: dacli elements --include-content [--content-limit N]
  • API: ElementItem.attributes dict containing element-specific data

Changes

  • Parsers: Extended AsciiDoc and Markdown parsers to capture content for all element types
  • API: Added attributes field to ElementItem model (Issue elements command only returns metadata, not the actual content of elements #159)
  • CLI: Added --include-content and --content-limit N flags
  • MCP: Added include_content and content_limit parameters to get_elements tool
  • Tests: Added comprehensive test coverage (10 new tests)
  • Docs: Updated API and CLI specifications

Content Capture Strategy

  • Content stored in Element.attributes["content"] dict during parsing
  • Opt-in via --include-content flag (default: metadata only)
  • Optional truncation via --content-limit N
  • Element-specific attributes:
    • code: language, content
    • table: columns, rows, content (raw table text)
    • list: list_type, content (all items)
    • image: alt, src/target, title
    • diagram: format, name, content (diagram source)
    • admonition: admonition_type, content

Test Results

✅ All tests passing (471 total, including 10 new tests for Issue #159)
✅ Coverage: 90.5%
✅ All linting checks passed

This PR contains only the changes for Issue #159, with a clean linear history.

Fixes #159

🤖 Generated with Claude Code

raifdmueller and others added 3 commits January 26, 2026 18:03
Changes:
- Parser: Capture content for code, tables, lists, diagrams
- API: Add attributes field to ElementItem model
- CLI: Add --include-content and --content-limit flags
- MCP: Add include_content and content_limit parameters
- Tests: Add comprehensive content capture tests (471 passing)
- Docs: Update API and CLI specifications

Details:
- AsciiDoc parser captures content for all block elements
- Markdown parser captures content for code, tables, lists
- Content is opt-in via --include-content flag
- Content can be truncated with --content-limit N
- API always returns attributes when present
- CLI filters attributes based on flags

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove accidentally committed test artifacts.
- Fix line too long (E501)
- Fix unsorted imports (I001)
@rdmueller rdmueller merged commit e592fec into docToolchain:main Jan 26, 2026
7 of 8 checks passed
@raifdmueller raifdmueller deleted the feature/elements-content-159-clean branch January 26, 2026 18:51
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.

elements command only returns metadata, not the actual content of elements

2 participants