Skip to content

PDFCLOUD-6578 Add Markdown inline output - #64

Draft
datalogics-tsmith wants to merge 3 commits into
pdfcloud-6577-expand-image-overlay-optionsfrom
pdfcloud-6578-add-markdown-inline-output
Draft

datalogics-tsmith wants to merge 3 commits into
pdfcloud-6577-expand-image-overlay-optionsfrom
pdfcloud-6578-add-markdown-inline-output

Conversation

@datalogics-tsmith

Copy link
Copy Markdown
Contributor

PDFCLOUD-6578

Why this change

The Markdown conversion service supports both inline JSON content and downloadable file output, but the Python client only exposed the file-oriented workflow. Users need a typed inline option for retrieval and indexing workflows without weakening the existing file response contract.

What changed (high level)

A separate convert_to_markdown_inline helper now exposes the inline workflow for synchronous and asynchronous clients. Shared payload fields live in a common base model, while narrow inline and file payload models keep each response shape statically clear. The existing convert_to_markdown helper remains the downloadable-file API.

The public inline response model requires the generated Markdown and input resource ID. Documentation and a standalone example demonstrate both workflows.

Behavior changes

Callers can now receive generated Markdown directly as ConvertToMarkdownResponse. Page selection, page-break comments, request customization, and timeout overrides work through both transports. Invalid MIME types, multiple resources, or incompatible output modes fail during local payload validation before a request is sent.

This change is additive and does not alter the existing file-output method signature or return type.

Validation

  • Focused Markdown unit suite: 19 passed
  • Full non-live suite: 3,577 passed and 10 skipped
  • Python 3.10 through 3.14 nox matrix: passed with 96% aggregate coverage
  • Client class-function coverage gate: 177 functions passed the 90% threshold
  • uv run pre-commit run --files ...
  • uv run basedpyright
  • uv run mkdocs build --strict
  • Live Markdown suite collection: 8 tests collected

The API-backed live suite and runnable example could not be executed locally because PDFREST_API_KEY was unavailable. The main-repository draft PR is expected to run those checks in CI.

Risks and follow-ups

This draft is stacked directly on #63 and must remain a draft until #63 and all preceding pull requests in the stack are merged. Once the stack lands, GitHub can retarget this pull request to main automatically or the base can be updated manually if needed.

The live suite asserts deterministic inline content, page-break comments, file output, and server-side rejection through both transports. No migration or breaking API change is required.

- Add separate synchronous and asynchronous helpers for inline Markdown.
- Split request validation by output mode and export the inline response.
- Preserve the existing downloadable file workflow and clarify its docs.

Assisted-by: Codex
- Assert inline payload serialization, request customization, and timeouts.
- Verify MIME and single-resource validation before transport execution.
- Add deterministic live inline output and server-side negative cases.

Assisted-by: Codex
- Add a standalone example for inline and downloadable Markdown results.
- List the workflow and distinguish the two public helpers in the API guide.

Assisted-by: Codex

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.

1 participant