develooper Front page | perl.pod-people | Postings from October 2020

Re: [feature] Add =image to perl pod #18169

Thread Previous | Thread Next
From:
Patrice Dumas
Date:
October 1, 2020 10:42
Subject:
Re: [feature] Add =image to perl pod #18169
Message ID:
20201001104224.GH197129@free.fr
On Thu, Oct 01, 2020 at 11:35:45AM +0200, Dmitry Karasik wrote:
> Hello,
> 
> I've proposed addition of images to pod, as discussed at [1], and would like to
> ask for some more discussion here as well The idea is rather simple, to
> introduce a P<> tag in two forms, P<foo.png> and P<title|foo.png>, that would
> get converted to image in graphic formats, and ignored otherwise.
> 
> The image URI would be related either to the pod file location (without leading
> /) or to the distro root (with leading /), that would allow referencing both
> locally installed images as well as web views on github and metacpan.
> 
> Image title would get converted into <figcaption> in html, if present.
> 
> In case a graceful fallback is needed by an author, the following trick could be
> used:

I am not sure that it is good enough.  There is not only html and text
as output format, the proposal seems a bit too format specific to me.  
One option is to use the "title" in formats that cannot render the 
image (text, man, for example).  The downside is that if one want to 
have the title in html as alt/figcaption, but not rendered in the text
case, one would need to use a specific format block for html too
and would require format blocks for all the formats.

In that case there could be simply, if it is ok to have title as
figcaption in html and title used in pllace of the image in text

P<title|graph.png>

But if one want to do a specific formatting for text, for example, it
could be the following, with the downside that the other formats, even
those which would be able to handle P<title|graph.png> will have to 
have something explicitly specified:

=begin :html

P<title|graph.png>

=end :html

=begin text

y  **
|  ** 
|**
|----------> x

=end text


> 
> P<graph.png>
> 
> =begin text
> 
> ^ y  **
> |  ** 
> |**
> |----------> x
> 
> I'm thinking about working on a patch however I don't want to find myself in a
> situation where it would be rejected or premature because the very topic is
> undecided yet. 
> 
> Let's discuss this.
> 
> [1] https://github.com/Perl/perl5/issues/18169
> 
> 
> -- 
> Sincerely,
> 	Dmitry Karasik

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