Mailing List Archive

1 2  View All
Re: Pre-RFC: images in Pod [ In reply to ]
On Thu, 9 Jun 2022 23:24:53 +0100
Neil Bowers <neilb@neilb.org> wrote:

> Revisiting this after something of a gap ? here?s the basic case:
>
> P<There can be only one|https://highlander.org/macleod.png>
>
> Q1: how should this be rendered if an image can?t be displayed? Someone commented that styling should be left to formatters, but I think podspec should propose a standard rendering as text.

IMO it should be up to the renderer to decide. HTML, GUI and pure-text
renders have completely different constraints.

> Q2: should we support non http URLs? For example a CPAN dist might want to bundle images for the doc (and have them turn up on MetaCPAN), and the Perl distribution might want to include images for diagrams: P<illustration of method resolution|images/mro.png>. That?s like to get hairy, so one option is to say that v1 just supports http URLs and worry about relative paths if there?s a call for it.

The original proposal also includes base64 data URLs.

As for bundling image files with the distribution, I think that just
storing them in the same place as .pm/.pod files is the only reasonable
way. It's simpler than sharedir and it will work for both installed and
non-installed modules. Some CPAN modules are already doing that for
storing all kinds of static data, not necessarily just images. For
example, Mojolicious has a "resources" directory:

https://metacpan.org/release/SRI/Mojolicious-9.26/source/lib/Mojolicious/resources

> Seems sensible to allow optional dimensions with an additional parameter:
>
> P<There can be only one|https://highlander.org/macleod.png|640x480>
>
> Q3: I often just put just a width on images, so it should probably allow that. I.e. P<alt text|https://foo.com/bar.png|320>. Should any other format of dimensions be supported?

I think that's reasonable.
Re: Pre-RFC: images in Pod [ In reply to ]
Presumably SVG would be an acceptable image type, yes? That would nicely
cover the use-case of diagrams, like in perlreftut, or state and flow
diagrams, as I mentioned awhile back[1], letting them be rendered as
vector (and perhaps created with pikchr, Inkscape, et al).

\\/

[1]
https://www.nntp.perl.org/group/perl.perl5.porters/2021/11/msg261926.html
Re: Pre-RFC: images in Pod [ In reply to ]
On Fri, 17 Jun 2022 19:23:24 -0400
William Lindley <wlindley@wlindley.com> wrote:

> Presumably SVG would be an acceptable image type, yes?

I think in practice we will support whatever web browsers do, and that
includes SVG.
Re: Pre-RFC: images in Pod [ In reply to ]
On Sat, Jun 18, 2022 at 01:57:29AM +0200, Tomasz Konojacki wrote:
> On Fri, 17 Jun 2022 19:23:24 -0400
> William Lindley <wlindley@wlindley.com> wrote:
>
> > Presumably SVG would be an acceptable image type, yes?
>
> I think in practice we will support whatever web browsers do, and that
> includes SVG.

So JPEG, PNG (APNG), GIF, SVG, WebP, AVIF, BMP, ICO[1] and probably JXL
(JPEG XL) soon.[2]

Makes me want a fallback mechanism.

Tony

[1] https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types
- scroll down to a table listing BMP and ICO support.

[2] https://caniuse.com/jpegxl - JXL can be enabled with a flag for
Firefox, Edge and Chrome.
Re: Pre-RFC: images in Pod [ In reply to ]
One of my concerns with P<…> is that it’s confusable with <P> in HTML, so people will see it and their brains will think it’s some kind of paragraph thing.

So then I thought, why don’t we make it IMG<…> instead? I know all formatting codes are currently single letters, but is there a hard reason why they’re single letters?

Neil
Re: Pre-RFC: images in Pod [ In reply to ]
On Mon, Jun 20, 2022 at 2:35 PM Neil Bowers <neilb@neilb.org> wrote:

> One of my concerns with P<…> is that it’s confusable with <P> in HTML, so
> people will see it and their brains will think it’s some kind of paragraph
> thing.
>
> So then I thought, why don’t we make it IMG<…> instead? I know all
> formatting codes are currently single letters, but is there a hard reason
> why they’re single letters?
>

Yes, because there is no whitespace requirement surrounding formatting tags
so they can be embedded in any position. IMG<...> would be
indistinguishable from IM G<...> (without the space).

-Dan

1 2  View All