Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Show # IMAGE: tags as images in the preview pane - #566

Open
NGdev2 wants to merge 1 commit into
inkle:masterfrom
NGdev2:preview-image-tags
Open

NGdev2 wants to merge 1 commit into
inkle:masterfrom
NGdev2:preview-image-tags

Conversation

@NGdev2

@NGdev2 NGdev2 commented Dec 3, 2026

Copy link
Copy Markdown

Closes #119.

The web export already turns # IMAGE: src into an <img>, but the preview pane only shows the tag as text, so writers can't see their images while writing. This makes the preview handle the same tag:

  • # IMAGE: file.png (case-insensitive, same PROPERTY: value parsing as the web template) shows the image below the tag line. The tag text itself is unchanged and still respects "Hide tags".
  • Relative paths resolve against the main ink file's folder, mirroring how the web export resolves them against index.html. Absolute paths and http(s)/file/data URLs are used as-is. In an unsaved project, relative images are skipped.
  • If the image file can't be found, nothing extra is added: the tag gets an "Image not found" tooltip.
  • Images are capped to the pane width / 60vh, and the preview re-scrolls once an image has loaded.

No new dependencies; the web export template is unchanged.

Tested on Linux: same-folder, subfolder and absolute paths, missing file, oversized image, choices, rewind / restart, dark theme, Hide tags, unsaved project.

Screenshots:

Image tag on the first line of a story:

Inky preview showing the image for an # image: tag

Image reached after a few choices:

Inky preview showing an image after several choices

The web export already renders "# IMAGE: path" tags, but the preview
pane only showed them as text. The preview now displays the image
below the tag line, using the same tag syntax.

Relative paths are resolved against the main ink file's folder.
Absolute paths and http(s)/file/data URLs are used as-is. If the
file can't be found, no image is shown and the tag gets an
"Image not found" tooltip.
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.

feature request: simple #image render / custom additional parsers

1 participant