Skip to content

Support media file assets - #70

Merged
svetlyak40wt merged 13 commits into
masterfrom
test/DOC-ASSET-INLINE-001
Sep 4, 2026
Merged

svetlyak40wt merged 13 commits into
masterfrom
test/DOC-ASSET-INLINE-001

Conversation

@svetlyak40wt

Copy link
Copy Markdown
Member

Implementation for issue #43

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-04T14:19:17.542679Z 8d93075 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d9307529c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread full/assets.lisp
Comment on lines +54 to +56
(let* ((source (pathname-designator-string source))
(target-filename (pathname-designator-string
(or target-filename source)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Derive a relative default target from absolute sources

When SOURCE is an absolute pathname—such as the common result of asdf:system-relative-pathname—and :target-filename is omitted, this assigns that absolute namestring as the target. validate-asset then rejects it unconditionally, despite the public API describing :target-filename as optional and promising a source-derived relative target. Derive the default with the existing relative-path logic or require an explicit target for sources that cannot be relativized.

AGENTS.md reference: AGENTS.md:L9-L11

Useful? React with 👍 / 👎.

Comment thread full/assets.lisp
Comment on lines +112 to +115
(maphash (lambda (name other-asset)
(when (and (not (eq name (asset-name asset)))
(string= (asset-target-filename other-asset)
(asset-target-filename asset)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Index target paths instead of scanning every declaration

For every asset occurrence, asset-to-local-image calls validate-asset, and this maphash scans the complete registry to detect a collision. A document with M asset references and N declarations therefore performs O(MN) validation, directly contradicting the committed [PERF] constraint that resolution must not scan the declaration set. Maintain a target-path index or validate collisions when registering declarations instead.

AGENTS.md reference: AGENTS.md:L9-L11

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this is a big issue right now.

Comment thread full/builder.lisp Outdated
Comment on lines +222 to +225
(40ants-doc-full/commondoc/xref::extract-symbols document)
document))
(document (40ants-doc-full/commondoc/xref:fill-locatives document))
(document (40ants-doc-full/assets::replace-assets document))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recognize assets when uppercase-code extraction is disabled

When the documented public setting *document-uppercase-is-code* is nil, the preceding branch leaves prose as text, so replace-assets receives no XREF nodes and every bare @NAME.PNG remains text. This makes DEFASSET unusable for configurations that disable implicit symbol formatting, although its contract says bare asset names become images; asset recognition needs to run independently of the generic uppercase-code pass.

AGENTS.md reference: AGENTS.md:L9-L11

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to support an explicit inclusion on the asset as a section like this:

 (defasset @demo.gif #"static/demo.gif")

 (defsection @example ()
     "Here is:"
     @demo.gif)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 9573eb9. When implicit uppercase-code formatting is disabled, the XREF pass now extracts only registered assets; a bare @NAME.PNG remains an image.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 9573eb9. A declared asset symbol can now be a direct DEFSECTION entry, e.g. @demo.gif after a prose entry.

@svetlyak40wt
svetlyak40wt merged commit 3ffa6a8 into master Sep 4, 2026
4 checks passed
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