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

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

Thread Previous | Thread Next
From:
Dmitry Karasik
Date:
October 7, 2020 03:31
Subject:
Re: [feature] Add =image to perl pod #18169
Message ID:
A5F86947-6F2E-43E0-8207-EC2EB6E1A0A6@karasik.eu.org
I’m not sure that I understand your argument and it feel a bit of a straw man - I’m targeting specifically html, latex, and pdf as the graphic backends, and have in mind markdown and xml as easily supported too. The proposal is that title and image are always shown together, or always ignored together. For html and others, P<> doesn’t need to be wrapped in =begin, that’s the whole point of it to not care about specific format, and only care for man pages when there is a gracious fallback. 

/dk

> On 1 Oct 2020, at 12.42, Patrice Dumas <pertusus@free.fr> wrote:
> 
> 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