develooper Front page | perl.perl5.porters | Postings from November 2021

Re: Pre-RFC: images in Pod

Thread Previous | Thread Next
From:
Dan Book
Date:
November 16, 2021 03:05
Subject:
Re: Pre-RFC: images in Pod
Message ID:
CABMkAVV7hyUkksCFuFbmYMnVAaxSUVg1vCQm_M4FFZ_f_7PkTQ@mail.gmail.com
On Mon, Nov 15, 2021 at 8:42 PM Tomasz Konojacki <me@xenu.pl> wrote:

> Images are one of the most frequently requested features for Pod. There
> was a proposal in the past[1] but it failed to achieve unanimous support
> of the community, mainly because it was perceived as too complicated.
>
> https://github.com/Perl/perl5/issues/18169
>
> My proposal takes a different route. Images will be inputted using the
> new formatting code, P<>, which stands for "Picture".
>
> Compared to the previous proposal this has several advantages:
>
> - It's much simpler, it doesn't require a YAML parser.
> - Images can be embedded inline inside a paragraph.
> - It plays well with the table syntax that I have proposed in the other
>   pre-RFC.
>
> Of course, there are also some disadvantages. The syntax isn't
> extensible; for example, it's impossible to specify the dimensions of
> the image. In my opinion, this isn't a big loss.
>
> Some examples:
>
> P<https://example.com/image.jpg>
> P<https://example.com/image.jpg|alt text>
> L<P<https://example.com/image.jpg|this image is a link>|
> https://example.com>
>
> P<data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAPBAMAAAAfXVIcAAAAMFBMVEWdDtesnV3g9aGo4gLH7FKz9giz5R6/6Tuy5RKkVpjz+9qwvEKgKcDQ722la4P////TI3mRAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAaUlEQVQI12P4////qlVAguH/f2djYyMQ43NoW2iwPpBx9XVo9OR+EOOAqACbPZChuufonNR+sJrQ0OB6EKMtLS0ZpPivGZCxHmSORVqaBdhA5bYMKzDji1lyPZjxv9kYYtf/L/ehDDAAACPTVSyPrPcdAAAAAElFTkSuQmCC>
>

 I like the basic idea. The loss of sizing control would be unfortunate,
but worked around by sizing the image you include as desired.

A larger question is how to refer to images without an absolute URL as it
relies on having external hosting for the image available. Most commonly
images would be included with the CPAN distribution and displayed by
metacpan so it's worth optimizing for that use case. I believe there was
some discussion of this in the previous thread that it would be worthwhile
to review.

-Dan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About