You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.
ox-html checks if a link is the only content for a paragraph, and if so checks if the link's file extension matches in a customizable list, to determine whether or not to emit an <img> tag into the exported HTML. If the paragraph has a #+CAPTION keyword it will use the caption value as well. ox-slimhtml should be able to emit images as well, although with simpler HTML than ox-html emits. There is also support for #+ATTR_HTML to explicitly set attributes on the <img> tag.
As an example, org-mode versus ox-html output, as well as what ox-slimhtml currently emits:
#+CAPTION: This is the image caption.
#+ATTR_HTML: :width 300
[[http://example.com/picture.png]]
ox-html:
<figureid="orgfffffff"><imgsrc="http://example.com/picture.png" alt="picture.png" width="300"><figcaption><spanclass="figure-number">Figure 1: </span>This is the image caption.</figcaption></figure>
ox-slimhtml:
<p><em>//example.com/picture.png</em></p>
Since <img> is an inline tag, despite being only supported as block-level content by Org, we should probably wrap the emitted image tag within a block such as a <div> or <p> tag, even if we don't support captions.
I've been hand-modifying ox-slimhtml's output so that the example above would become like this:
<p><imgsrc="https://example.com/picture.png" alt="This is the image caption."/><br/>
<em>This is the image caption</em></p>
Open questions:
Support captions or not?
Support custom tag attributes or not?
Use org-html-inline-image-rules or hard-coded extension list? (By default, the rules only match for file, http, https schemes for GIF, JPEG, PNG, and SVG files.)
What should the alt attribute be set to? (ox-html defaults to the base filename unless explicitly overridden by #+ATTR_HTML)
The text was updated successfully, but these errors were encountered:
Looks like ox-html does processing both in its paragraph emitter and its link emitter to handle images. Captions and the wrapping block tag for an image come out of the paragraph transcoder (org-html--wrap-image via org-html-paragraph), while the <img> tag itself comes out of the link transcoder (org-html--format-image by way of org-html-link).
A simple export that ignores captions could probably be handled strictly via the link transcoder. Anyone who needs captions could use a derived exporter with a custom paragraph transcoder.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Spinning this out to its own issue from #7.
ox-html checks if a link is the only content for a paragraph, and if so checks if the link's file extension matches in a customizable list, to determine whether or not to emit an
<img>
tag into the exported HTML. If the paragraph has a#+CAPTION
keyword it will use the caption value as well. ox-slimhtml should be able to emit images as well, although with simpler HTML than ox-html emits. There is also support for#+ATTR_HTML
to explicitly set attributes on the<img>
tag.As an example, org-mode versus ox-html output, as well as what ox-slimhtml currently emits:
ox-html:
ox-slimhtml:
Since
<img>
is an inline tag, despite being only supported as block-level content by Org, we should probably wrap the emitted image tag within a block such as a<div>
or<p>
tag, even if we don't support captions.I've been hand-modifying ox-slimhtml's output so that the example above would become like this:
Open questions:
org-html-inline-image-rules
or hard-coded extension list? (By default, the rules only match for file, http, https schemes for GIF, JPEG, PNG, and SVG files.)alt
attribute be set to? (ox-html defaults to the base filename unless explicitly overridden by#+ATTR_HTML
)The text was updated successfully, but these errors were encountered: