Skip to content

Publish one relative image as a Doc Asset end-to-end #41

Description

@wschenk

Parent

#39

What to build

Extend doc publish so a Markdown file with a relative image reference uploads that file as a Doc Asset, rewrites the stored Living Doc Markdown to an absolute Unlisted URL under /d/{opaqueId}/{assetPath}, and leaves the View/Review surfaces able to load the image. Absolute http(s) image URLs stay unchanged. Duplicate relative refs to the same file upload once. Publisher-authenticated publish only (no Review Link upload).

Wire collector → uploader → rewriter → persist rewritten Markdown in an order that does not leave rewritten URLs pointing at missing Blob objects. CLI/API should return View and Review URLs as today. doc pull returns the rewritten Markdown.

Acceptance criteria

  • Publishing Markdown with ![…](./…) (and ../…) uploads the image and stores rewritten hosted URLs in currentMarkdown
  • The hosted image URL returns 200 on the View prefix after publish
  • Absolute http(s) image URLs are not rewritten
  • Duplicate relative refs to one file produce a single upload / single assetPath
  • Orchestration tests with fake Blob + in-memory store cover happy path; mid-flight upload failure does not succeed with dangling hosted URLs
  • Rewriter unit tests cover relative rewrite, absolute passthrough, and table-embedded image refs

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentReady for an implementation agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions