unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
@ 2024-09-22 16:06 Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-09-22 17:45 ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-22 16:06 UTC (permalink / raw)
  To: 73425; +Cc: Philip Kaludercic


Hi,

I'm opening this feature request following a discussion with Philip
elsewhere: Texinfo manual can include images, but AFAIK (and please
correct me if I'm wrong here) there's currently no way for ELPA packages
to include images in their manuals and have these images appear also in
the HTML version of the manual that the ELPA server builds and serves.

An example is my GNU ELPA package Kubed.  In the development version,
the manual refers to images which are present on my web server, where I
provide HTML versions[1][2] of the manual.  There, the images are
displayed properly.  On the ELPA server[3], OTOH, the images are nowhere
to be found, and we instead get just the alt text and caption.  That's
expected, but the alt text is shown with no distinctive styling so the
result seems quite confusing.

Ideally, I would like a way to be able to do one of the following:

- Include images in the package repository, somehow indicate in the
  package specification that the manual refers to these images, and have
  the ELPA server keep the images around in a predictable location, so I
  can link to it from the manual.
- Provide a IMAGE_LINK_PREFIX value (e.g. pointing to my web server)
  that the ELPA server will use while building the HTML manual.
- Override the creation of the HTML manual entirely, and have the ELPA
  server redirect or link to the version hosted on my web server.


Thanks,

Eshel

[1] https://eshelyaron.com/kubed.html
[2] https://eshelyaron.com/man/kubed/
[3] https://elpa.gnu.org/devel/doc/kubed.html





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 16:06 bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-22 17:45 ` Eli Zaretskii
  2024-09-22 18:03   ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2024-09-22 17:45 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: 73425, philipk

> Cc: Philip Kaludercic <philipk@posteo.net>
> Date: Sun, 22 Sep 2024 18:06:16 +0200
> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> I'm opening this feature request following a discussion with Philip
> elsewhere: Texinfo manual can include images, but AFAIK (and please
> correct me if I'm wrong here) there's currently no way for ELPA packages
> to include images in their manuals and have these images appear also in
> the HTML version of the manual that the ELPA server builds and serves.

Why "no way"?  If the image files are present at their filenames as
mentioned by the HTML version of the documentation, they will be shown
by the browser.

> An example is my GNU ELPA package Kubed.  In the development version,
> the manual refers to images which are present on my web server, where I
> provide HTML versions[1][2] of the manual.  There, the images are
> displayed properly.  On the ELPA server[3], OTOH, the images are nowhere
> to be found, and we instead get just the alt text and caption.  That's
> expected, but the alt text is shown with no distinctive styling so the
> result seems quite confusing.

To show images, your HTML version of the manual should reference local
files, not URLs from your some other server.  And, of course, the
image files should be part of the package tarball.

> - Include images in the package repository, somehow indicate in the
>   package specification that the manual refers to these images, and have
>   the ELPA server keep the images around in a predictable location, so I
>   can link to it from the manual.

I don't understand why this would be needed.  Simply include the image
files with the package, and the rest should "just work", AFAIU.

> - Provide a IMAGE_LINK_PREFIX value (e.g. pointing to my web server)
>   that the ELPA server will use while building the HTML manual.

That's definitely not TRT: ELPA packages should be self-contained as
far as their documentation is concerned.

> - Override the creation of the HTML manual entirely, and have the ELPA
>   server redirect or link to the version hosted on my web server.

Likewise: there should be no dependency on any server.

Apologies if I misunderstood the problem.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 17:45 ` Eli Zaretskii
@ 2024-09-22 18:03   ` Philip Kaludercic
  2024-09-22 18:13     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-09-22 18:15     ` Eli Zaretskii
  0 siblings, 2 replies; 16+ messages in thread
From: Philip Kaludercic @ 2024-09-22 18:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 73425, Eshel Yaron

Eli Zaretskii <eliz@gnu.org> writes:

>> Cc: Philip Kaludercic <philipk@posteo.net>
>> Date: Sun, 22 Sep 2024 18:06:16 +0200
>> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> 
>> I'm opening this feature request following a discussion with Philip
>> elsewhere: Texinfo manual can include images, but AFAIK (and please
>> correct me if I'm wrong here) there's currently no way for ELPA packages
>> to include images in their manuals and have these images appear also in
>> the HTML version of the manual that the ELPA server builds and serves.
>
> Why "no way"?  If the image files are present at their filenames as
> mentioned by the HTML version of the documentation, they will be shown
> by the browser.

The issue is that when generating the HTML documentation for
elpa.gnu.org, we don't copy out any files, but just generate the HTML
version of the manual.

What we need is some kind of an indication in the package specification,
what files should be copied out for the manual to access, as otherwise
the images would only be hidden in the package tarball, that a web
browser cannot access (AFAIK).

>> An example is my GNU ELPA package Kubed.  In the development version,
>> the manual refers to images which are present on my web server, where I
>> provide HTML versions[1][2] of the manual.  There, the images are
>> displayed properly.  

  Unrelated to this issue, have you considered rendering screenshots as
  SVG files using `x-export-frames'?
                        
                        On the ELPA server[3], OTOH, the images are nowhere
>> to be found, and we instead get just the alt text and caption.  That's
>> expected, but the alt text is shown with no distinctive styling so the
>> result seems quite confusing.
>
> To show images, your HTML version of the manual should reference local
> files, not URLs from your some other server.  And, of course, the
> image files should be part of the package tarball.
>
>> - Include images in the package repository, somehow indicate in the
>>   package specification that the manual refers to these images, and have
>>   the ELPA server keep the images around in a predictable location, so I
>>   can link to it from the manual.
>
> I don't understand why this would be needed.  Simply include the image
> files with the package, and the rest should "just work", AFAIU.

Do you know if TeXinfo has an option to inline images?  If the
"makeinfo" command could somehow generate data: urls when exporting
images, then this could be very easily solved.

[0] https://developer.mozilla.org/en-US/docs/Web/URI/Schemes/data

>> - Provide a IMAGE_LINK_PREFIX value (e.g. pointing to my web server)
>>   that the ELPA server will use while building the HTML manual.
>
> That's definitely not TRT: ELPA packages should be self-contained as
> far as their documentation is concerned.
>
>> - Override the creation of the HTML manual entirely, and have the ELPA
>>   server redirect or link to the version hosted on my web server.
>
> Likewise: there should be no dependency on any server.

I agree.

> Apologies if I misunderstood the problem.

-- 
	Philip Kaludercic on siskin





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 18:03   ` Philip Kaludercic
@ 2024-09-22 18:13     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-09-22 18:16       ` Philip Kaludercic
  2024-09-22 18:15     ` Eli Zaretskii
  1 sibling, 1 reply; 16+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-22 18:13 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Eli Zaretskii, 73425

Philip Kaludercic <philipk@posteo.net> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> Cc: Philip Kaludercic <philipk@posteo.net>
>>> Date: Sun, 22 Sep 2024 18:06:16 +0200
>>> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>> 
>>> I'm opening this feature request following a discussion with Philip
>>> elsewhere: Texinfo manual can include images, but AFAIK (and please
>>> correct me if I'm wrong here) there's currently no way for ELPA packages
>>> to include images in their manuals and have these images appear also in
>>> the HTML version of the manual that the ELPA server builds and serves.
>>
>> Why "no way"?  If the image files are present at their filenames as
>> mentioned by the HTML version of the documentation, they will be shown
>> by the browser.
>
> The issue is that when generating the HTML documentation for
> elpa.gnu.org, we don't copy out any files, but just generate the HTML
> version of the manual.
>
> What we need is some kind of an indication in the package specification,
> what files should be copied out for the manual to access, as otherwise
> the images would only be hidden in the package tarball, that a web
> browser cannot access (AFAIK).

Yes.

>>> An example is my GNU ELPA package Kubed.  In the development version,
>>> the manual refers to images which are present on my web server, where I
>>> provide HTML versions[1][2] of the manual.  There, the images are
>>> displayed properly.  
>
>   Unrelated to this issue, have you considered rendering screenshots as
>   SVG files using `x-export-frames'?

I haven't, but I'll be sure to check it out.  Thanks for the tip :)

>>> On the ELPA server[3], OTOH, the images are nowhere
>>> to be found, and we instead get just the alt text and caption.  That's
>>> expected, but the alt text is shown with no distinctive styling so the
>>> result seems quite confusing.
>>
>> To show images, your HTML version of the manual should reference local
>> files, not URLs from your some other server.  And, of course, the
>> image files should be part of the package tarball.
>>
>>> - Include images in the package repository, somehow indicate in the
>>>   package specification that the manual refers to these images, and have
>>>   the ELPA server keep the images around in a predictable location, so I
>>>   can link to it from the manual.
>>
>> I don't understand why this would be needed.  Simply include the image
>> files with the package, and the rest should "just work", AFAIU.
>
> Do you know if TeXinfo has an option to inline images?  If the
> "makeinfo" command could somehow generate data: urls when exporting
> images, then this could be very easily solved.

I'm not aware of such an option.  BTW, which version of Texinfo does the
ELPA server run?


Thanks,

Eshel





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 18:03   ` Philip Kaludercic
  2024-09-22 18:13     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-22 18:15     ` Eli Zaretskii
  2024-09-22 18:23       ` Philip Kaludercic
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2024-09-22 18:15 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 73425, me

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: Eshel Yaron <me@eshelyaron.com>,  73425@debbugs.gnu.org
> Date: Sun, 22 Sep 2024 18:03:26 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> Cc: Philip Kaludercic <philipk@posteo.net>
> >> Date: Sun, 22 Sep 2024 18:06:16 +0200
> >> From:  Eshel Yaron via "Bug reports for GNU Emacs,
> >>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> >> 
> >> I'm opening this feature request following a discussion with Philip
> >> elsewhere: Texinfo manual can include images, but AFAIK (and please
> >> correct me if I'm wrong here) there's currently no way for ELPA packages
> >> to include images in their manuals and have these images appear also in
> >> the HTML version of the manual that the ELPA server builds and serves.
> >
> > Why "no way"?  If the image files are present at their filenames as
> > mentioned by the HTML version of the documentation, they will be shown
> > by the browser.
> 
> The issue is that when generating the HTML documentation for
> elpa.gnu.org, we don't copy out any files, but just generate the HTML
> version of the manual.
> 
> What we need is some kind of an indication in the package specification,
> what files should be copied out for the manual to access, as otherwise
> the images would only be hidden in the package tarball, that a web
> browser cannot access (AFAIK).

"Copied" where and why?  Aren't the HTML docs generated in the
package's tree, like the Info docs?

> >> - Include images in the package repository, somehow indicate in the
> >>   package specification that the manual refers to these images, and have
> >>   the ELPA server keep the images around in a predictable location, so I
> >>   can link to it from the manual.
> >
> > I don't understand why this would be needed.  Simply include the image
> > files with the package, and the rest should "just work", AFAIU.
> 
> Do you know if TeXinfo has an option to inline images?  If the
> "makeinfo" command could somehow generate data: urls when exporting
> images, then this could be very easily solved.

This is already supported, for a long time, both in Info and HTML
formats (and in other formats as well; see the node "Image Syntax" in
the Texinfo manual.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 18:13     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-09-22 18:16       ` Philip Kaludercic
  2024-09-22 18:43         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2024-09-22 18:16 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: Eli Zaretskii, 73425

Eshel Yaron <me@eshelyaron.com> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>>>> Cc: Philip Kaludercic <philipk@posteo.net>
>>>> Date: Sun, 22 Sep 2024 18:06:16 +0200
>>>> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>>>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>>> 
>>>> I'm opening this feature request following a discussion with Philip
>>>> elsewhere: Texinfo manual can include images, but AFAIK (and please
>>>> correct me if I'm wrong here) there's currently no way for ELPA packages
>>>> to include images in their manuals and have these images appear also in
>>>> the HTML version of the manual that the ELPA server builds and serves.
>>>
>>> Why "no way"?  If the image files are present at their filenames as
>>> mentioned by the HTML version of the documentation, they will be shown
>>> by the browser.
>>
>> The issue is that when generating the HTML documentation for
>> elpa.gnu.org, we don't copy out any files, but just generate the HTML
>> version of the manual.
>>
>> What we need is some kind of an indication in the package specification,
>> what files should be copied out for the manual to access, as otherwise
>> the images would only be hidden in the package tarball, that a web
>> browser cannot access (AFAIK).
>
> Yes.
>
>>>> An example is my GNU ELPA package Kubed.  In the development version,
>>>> the manual refers to images which are present on my web server, where I
>>>> provide HTML versions[1][2] of the manual.  There, the images are
>>>> displayed properly.  
>>
>>   Unrelated to this issue, have you considered rendering screenshots as
>>   SVG files using `x-export-frames'?
>
> I haven't, but I'll be sure to check it out.  Thanks for the tip :)
>
>>>> On the ELPA server[3], OTOH, the images are nowhere
>>>> to be found, and we instead get just the alt text and caption.  That's
>>>> expected, but the alt text is shown with no distinctive styling so the
>>>> result seems quite confusing.
>>>
>>> To show images, your HTML version of the manual should reference local
>>> files, not URLs from your some other server.  And, of course, the
>>> image files should be part of the package tarball.
>>>
>>>> - Include images in the package repository, somehow indicate in the
>>>>   package specification that the manual refers to these images, and have
>>>>   the ELPA server keep the images around in a predictable location, so I
>>>>   can link to it from the manual.
>>>
>>> I don't understand why this would be needed.  Simply include the image
>>> files with the package, and the rest should "just work", AFAIU.
>>
>> Do you know if TeXinfo has an option to inline images?  If the
>> "makeinfo" command could somehow generate data: urls when exporting
>> images, then this could be very easily solved.
>
> I'm not aware of such an option.  BTW, which version of Texinfo does the
> ELPA server run?

--8<---------------cut here---------------start------------->8---
$ ssh elpa makeinfo --version
texi2any (GNU texinfo) 6.8

Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
--8<---------------cut here---------------end--------------->8---

I.e. the version distributed by Debian stable. 

>
>
> Thanks,
>
> Eshel

-- 
	Philip Kaludercic on siskin





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 18:15     ` Eli Zaretskii
@ 2024-09-22 18:23       ` Philip Kaludercic
  2024-09-22 19:05         ` Eli Zaretskii
  0 siblings, 1 reply; 16+ messages in thread
From: Philip Kaludercic @ 2024-09-22 18:23 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 73425, me

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: Eshel Yaron <me@eshelyaron.com>,  73425@debbugs.gnu.org
>> Date: Sun, 22 Sep 2024 18:03:26 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> Cc: Philip Kaludercic <philipk@posteo.net>
>> >> Date: Sun, 22 Sep 2024 18:06:16 +0200
>> >> From:  Eshel Yaron via "Bug reports for GNU Emacs,
>> >>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> >> 
>> >> I'm opening this feature request following a discussion with Philip
>> >> elsewhere: Texinfo manual can include images, but AFAIK (and please
>> >> correct me if I'm wrong here) there's currently no way for ELPA packages
>> >> to include images in their manuals and have these images appear also in
>> >> the HTML version of the manual that the ELPA server builds and serves.
>> >
>> > Why "no way"?  If the image files are present at their filenames as
>> > mentioned by the HTML version of the documentation, they will be shown
>> > by the browser.
>> 
>> The issue is that when generating the HTML documentation for
>> elpa.gnu.org, we don't copy out any files, but just generate the HTML
>> version of the manual.
>> 
>> What we need is some kind of an indication in the package specification,
>> what files should be copied out for the manual to access, as otherwise
>> the images would only be hidden in the package tarball, that a web
>> browser cannot access (AFAIK).
>
> "Copied" where and why?  Aren't the HTML docs generated in the
> package's tree, like the Info docs?

No, these are the files we generate for a package under
https://elpa.gnu.org/packages:

  -rw-r--r--  1 phi phi 368640 Mar 22  2024 compat-29.1.4.5.tar
  -rw-r--r--  1 phi phi  11183 Mar 22  2024 compat.html
  -rw-r--r--  1 phi phi    997 Mar 22  2024 compat-readme.txt
  -rw-r--r--  1 phi phi   1230 Mar 22  2024 compat.svg
  lrwxrwxrwx  1 phi phi     19 Mar 22  2024 compat.tar -> compat-29.1.4.5.tar
  -rw-r--r--  1 phi phi   1016 Mar 22  2024 compat.xml

plus the manual under https://elpa.gnu.org/packages/doc/[package name]

  -rw-r--r--  1 phi phi 46640 Mar 21  2024 corfu.html

(there is another symlink to this file but that is not important now).
Other than that, no files are copied out.

>> >> - Include images in the package repository, somehow indicate in the
>> >>   package specification that the manual refers to these images, and have
>> >>   the ELPA server keep the images around in a predictable location, so I
>> >>   can link to it from the manual.
>> >
>> > I don't understand why this would be needed.  Simply include the image
>> > files with the package, and the rest should "just work", AFAIU.
>> 
>> Do you know if TeXinfo has an option to inline images?  If the
>> "makeinfo" command could somehow generate data: urls when exporting
>> images, then this could be very easily solved.
>
> This is already supported, for a long time, both in Info and HTML
> formats (and in other formats as well; see the node "Image Syntax" in
> the Texinfo manual.

I did take a look at that node, but I couldn't find anything that would
help me.

-- 
	Philip Kaludercic on siskin





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 18:16       ` Philip Kaludercic
@ 2024-09-22 18:43         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 16+ messages in thread
From: Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-22 18:43 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Eli Zaretskii, 73425

Philip Kaludercic <philipk@posteo.net> writes:

> Eshel Yaron <me@eshelyaron.com> writes:
>
>> Philip Kaludercic <philipk@posteo.net> writes:
>>
>>> Do you know if TeXinfo has an option to inline images?  If the
>>> "makeinfo" command could somehow generate data: urls when exporting
>>> images, then this could be very easily solved.
>>
>> I'm not aware of such an option.  BTW, which version of Texinfo does the
>> ELPA server run?
>
> $ ssh elpa makeinfo --version
> texi2any (GNU texinfo) 6.8
>
> Copyright (C) 2021 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> I.e. the version distributed by Debian stable. 

Good to know, thanks!





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 18:23       ` Philip Kaludercic
@ 2024-09-22 19:05         ` Eli Zaretskii
  2024-09-23 10:48           ` Philip Kaludercic
  0 siblings, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2024-09-22 19:05 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 73425, me

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: me@eshelyaron.com,  73425@debbugs.gnu.org
> Date: Sun, 22 Sep 2024 18:23:38 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> What we need is some kind of an indication in the package specification,
> >> what files should be copied out for the manual to access, as otherwise
> >> the images would only be hidden in the package tarball, that a web
> >> browser cannot access (AFAIK).
> >
> > "Copied" where and why?  Aren't the HTML docs generated in the
> > package's tree, like the Info docs?
> 
> No, these are the files we generate for a package under
> https://elpa.gnu.org/packages:
> 
>   -rw-r--r--  1 phi phi 368640 Mar 22  2024 compat-29.1.4.5.tar
>   -rw-r--r--  1 phi phi  11183 Mar 22  2024 compat.html
>   -rw-r--r--  1 phi phi    997 Mar 22  2024 compat-readme.txt
>   -rw-r--r--  1 phi phi   1230 Mar 22  2024 compat.svg
>   lrwxrwxrwx  1 phi phi     19 Mar 22  2024 compat.tar -> compat-29.1.4.5.tar
>   -rw-r--r--  1 phi phi   1016 Mar 22  2024 compat.xml

Then the image files should be in the same directory (or in its
images/ subdirectory, but that would need to be coordinated with the
package developers).

How do we generate these HTML files from the Texinfo sources?

> plus the manual under https://elpa.gnu.org/packages/doc/[package name]

So we have the HTML docs in two places?  Why two?  And why do I see
both https://elpa.gnu.org/packages/doc/compat.html and
https://elpa.gnu.org/packages/doc/compat/compat.html?

In any case, what I propose is to have the image files right near the
HTML files which reference them.

> >> Do you know if TeXinfo has an option to inline images?  If the
> >> "makeinfo" command could somehow generate data: urls when exporting
> >> images, then this could be very easily solved.
> >
> > This is already supported, for a long time, both in Info and HTML
> > formats (and in other formats as well; see the node "Image Syntax" in
> > the Texinfo manual.
> 
> I did take a look at that node, but I couldn't find anything that would
> help me.

??? What are you looking for that is not there?





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-22 19:05         ` Eli Zaretskii
@ 2024-09-23 10:48           ` Philip Kaludercic
  2024-09-23 12:03             ` Eli Zaretskii
  2024-09-23 14:00             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 16+ messages in thread
From: Philip Kaludercic @ 2024-09-23 10:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 73425, me, Stefan Monnier

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: me@eshelyaron.com,  73425@debbugs.gnu.org
>> Date: Sun, 22 Sep 2024 18:23:38 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> What we need is some kind of an indication in the package specification,
>> >> what files should be copied out for the manual to access, as otherwise
>> >> the images would only be hidden in the package tarball, that a web
>> >> browser cannot access (AFAIK).
>> >
>> > "Copied" where and why?  Aren't the HTML docs generated in the
>> > package's tree, like the Info docs?
>> 
>> No, these are the files we generate for a package under
>> https://elpa.gnu.org/packages:
>> 
>>   -rw-r--r--  1 phi phi 368640 Mar 22  2024 compat-29.1.4.5.tar
>>   -rw-r--r--  1 phi phi  11183 Mar 22  2024 compat.html
>>   -rw-r--r--  1 phi phi    997 Mar 22  2024 compat-readme.txt
>>   -rw-r--r--  1 phi phi   1230 Mar 22  2024 compat.svg
>>   lrwxrwxrwx  1 phi phi     19 Mar 22  2024 compat.tar -> compat-29.1.4.5.tar
>>   -rw-r--r--  1 phi phi   1016 Mar 22  2024 compat.xml
>
> Then the image files should be in the same directory (or in its
> images/ subdirectory, but that would need to be coordinated with the
> package developers).

Right, and we can facilitate this by allowing package specifications to
annotate where images are found.

> How do we generate these HTML files from the Texinfo sources?

Basically by executing,

--8<---------------cut here---------------start------------->8---
makeinfo --no-split [input-name] -o [output-name] --html --css-ref=[css-url]
--8<---------------cut here---------------end--------------->8---

>> plus the manual under https://elpa.gnu.org/packages/doc/[package name]
>
> So we have the HTML docs in two places?  Why two?  And why do I see
> both https://elpa.gnu.org/packages/doc/compat.html and
> https://elpa.gnu.org/packages/doc/compat/compat.html?

I am not sure, my suspicion is some kind of historical backwards
compatibility.  I have CC'ed Stefan who might know more.

> In any case, what I propose is to have the image files right near the
> HTML files which reference them.

That would make sense.

>> >> Do you know if TeXinfo has an option to inline images?  If the
>> >> "makeinfo" command could somehow generate data: urls when exporting
>> >> images, then this could be very easily solved.
>> >
>> > This is already supported, for a long time, both in Info and HTML
>> > formats (and in other formats as well; see the node "Image Syntax" in
>> > the Texinfo manual.
>> 
>> I did take a look at that node, but I couldn't find anything that would
>> help me.
>
> ??? What are you looking for that is not there?

Some kind of --embed flag, that would inline images.  So instead of
generating

  <img src="/path/to/image.png" />

makeinfo could produce

  <img src="data:image/png;base64,iVBORw0KGgoAAAANS..."

-- 
	Philip Kaludercic on siskin





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-23 10:48           ` Philip Kaludercic
@ 2024-09-23 12:03             ` Eli Zaretskii
  2024-09-23 12:46               ` Philip Kaludercic
  2024-09-23 14:00             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 16+ messages in thread
From: Eli Zaretskii @ 2024-09-23 12:03 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 73425, me, monnier

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: me@eshelyaron.com,  73425@debbugs.gnu.org, "Stefan Monnier"
>  <monnier@iro.umontreal.ca>
> Date: Mon, 23 Sep 2024 10:48:41 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Then the image files should be in the same directory (or in its
> > images/ subdirectory, but that would need to be coordinated with the
> > package developers).
> 
> Right, and we can facilitate this by allowing package specifications to
> annotate where images are found.
> 
> > How do we generate these HTML files from the Texinfo sources?
> 
> Basically by executing,
> 
> --8<---------------cut here---------------start------------->8---
> makeinfo --no-split [input-name] -o [output-name] --html --css-ref=[css-url]
> --8<---------------cut here---------------end--------------->8---
> 
> >> plus the manual under https://elpa.gnu.org/packages/doc/[package name]
> >
> > So we have the HTML docs in two places?  Why two?  And why do I see
> > both https://elpa.gnu.org/packages/doc/compat.html and
> > https://elpa.gnu.org/packages/doc/compat/compat.html?
> 
> I am not sure, my suspicion is some kind of historical backwards
> compatibility.  I have CC'ed Stefan who might know more.
> 
> > In any case, what I propose is to have the image files right near the
> > HTML files which reference them.
> 
> That would make sense.

OK, so we agree.  I guess what's left is to somehow make sure this all
does indeed happen?

> >> >> Do you know if TeXinfo has an option to inline images?  If the
> >> >> "makeinfo" command could somehow generate data: urls when exporting
> >> >> images, then this could be very easily solved.
> >> >
> >> > This is already supported, for a long time, both in Info and HTML
> >> > formats (and in other formats as well; see the node "Image Syntax" in
> >> > the Texinfo manual.
> >> 
> >> I did take a look at that node, but I couldn't find anything that would
> >> help me.
> >
> > ??? What are you looking for that is not there?
> 
> Some kind of --embed flag, that would inline images.  So instead of
> generating
> 
>   <img src="/path/to/image.png" />
> 
> makeinfo could produce
> 
>   <img src="data:image/png;base64,iVBORw0KGgoAAAANS..."

Ah, apologies for my misunderstanding.  No, such inlining is not
supported by Texinfo for HTML, AFAIK, they only support external image
files for HTML.  (DVI and PDF outputs do embed the image, I believe.)





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-23 12:03             ` Eli Zaretskii
@ 2024-09-23 12:46               ` Philip Kaludercic
  2024-09-23 14:19                 ` Eli Zaretskii
  2024-09-26  4:02                 ` Stefan Kangas
  0 siblings, 2 replies; 16+ messages in thread
From: Philip Kaludercic @ 2024-09-23 12:46 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 73425, me, monnier

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Philip Kaludercic <philipk@posteo.net>
>> Cc: me@eshelyaron.com,  73425@debbugs.gnu.org, "Stefan Monnier"
>>  <monnier@iro.umontreal.ca>
>> Date: Mon, 23 Sep 2024 10:48:41 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> > Then the image files should be in the same directory (or in its
>> > images/ subdirectory, but that would need to be coordinated with the
>> > package developers).
>> 
>> Right, and we can facilitate this by allowing package specifications to
>> annotate where images are found.
>> 
>> > How do we generate these HTML files from the Texinfo sources?
>> 
>> Basically by executing,
>> 
>> --8<---------------cut here---------------start------------->8---
>> makeinfo --no-split [input-name] -o [output-name] --html --css-ref=[css-url]
>> --8<---------------cut here---------------end--------------->8---
>> 
>> >> plus the manual under https://elpa.gnu.org/packages/doc/[package name]
>> >
>> > So we have the HTML docs in two places?  Why two?  And why do I see
>> > both https://elpa.gnu.org/packages/doc/compat.html and
>> > https://elpa.gnu.org/packages/doc/compat/compat.html?
>> 
>> I am not sure, my suspicion is some kind of historical backwards
>> compatibility.  I have CC'ed Stefan who might know more.
>> 
>> > In any case, what I propose is to have the image files right near the
>> > HTML files which reference them.
>> 
>> That would make sense.
>
> OK, so we agree.  I guess what's left is to somehow make sure this all
> does indeed happen?

Yes.  My suggestion is to allow listing additional non-.texi/.org files
under :doc that would be copied out to the web server.  So in Eshel's
case, we could update the specification to be

 (kubed			:url "https://git.sr.ht/~eshel/kubed"
  :doc ("kubed.texi" "images/"))

and the HTTP server could host all files under images/.

>> >> >> Do you know if TeXinfo has an option to inline images?  If the
>> >> >> "makeinfo" command could somehow generate data: urls when exporting
>> >> >> images, then this could be very easily solved.
>> >> >
>> >> > This is already supported, for a long time, both in Info and HTML
>> >> > formats (and in other formats as well; see the node "Image Syntax" in
>> >> > the Texinfo manual.
>> >> 
>> >> I did take a look at that node, but I couldn't find anything that would
>> >> help me.
>> >
>> > ??? What are you looking for that is not there?
>> 
>> Some kind of --embed flag, that would inline images.  So instead of
>> generating
>> 
>>   <img src="/path/to/image.png" />
>> 
>> makeinfo could produce
>> 
>>   <img src="data:image/png;base64,iVBORw0KGgoAAAANS..."
>
> Ah, apologies for my misunderstanding.  No, such inlining is not
> supported by Texinfo for HTML, AFAIK, they only support external image
> files for HTML.  (DVI and PDF outputs do embed the image, I believe.)

What about the Info viewer in Emacs?

-- 
	Philip Kaludercic on siskin





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-23 10:48           ` Philip Kaludercic
  2024-09-23 12:03             ` Eli Zaretskii
@ 2024-09-23 14:00             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 16+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-23 14:00 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Eli Zaretskii, me, 73425

>> How do we generate these HTML files from the Texinfo sources?
>
> Basically by executing,
>
> --8<---------------cut here---------------start------------->8---
> makeinfo --no-split [input-name] -o [output-name] --html --css-ref=[css-url]
> --8<---------------cut here---------------end--------------->8---
>
>>> plus the manual under https://elpa.gnu.org/packages/doc/[package name]
>>
>> So we have the HTML docs in two places?  Why two?  And why do I see
>> both https://elpa.gnu.org/packages/doc/compat.html and
>> https://elpa.gnu.org/packages/doc/compat/compat.html?
>
> I am not sure, my suspicion is some kind of historical backwards
> compatibility.  I have CC'ed Stefan who might know more.

On disk, this is only one place: the `doc/compat.html` is a symlink to
`doc/compat/compat.html`.  The only URL we want to expose is
the `doc/compat.html`, OTOH (which is why `doc/compat.html` is a symlink
rather than an HTTP redirect).

The reason is the following:

- We put all the generated files into the `doc/PKG/` subdir so we know
  which files belong to which package when we need to "garbage collect"
  old files when updating a package.
- We need to the URL to be `doc/compat.html` (i.e. include only the
  manual name but not the package name) so that links from one
  manual to the other work correctly regardless if the other manual
  belongs to the same package or not.


        Stefan






^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-23 12:46               ` Philip Kaludercic
@ 2024-09-23 14:19                 ` Eli Zaretskii
  2024-09-26  4:02                 ` Stefan Kangas
  1 sibling, 0 replies; 16+ messages in thread
From: Eli Zaretskii @ 2024-09-23 14:19 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 73425, me, monnier

> From: Philip Kaludercic <philipk@posteo.net>
> Cc: me@eshelyaron.com,  73425@debbugs.gnu.org,  monnier@iro.umontreal.ca
> Date: Mon, 23 Sep 2024 12:46:25 +0000
> 
> >> Some kind of --embed flag, that would inline images.  So instead of
> >> generating
> >> 
> >>   <img src="/path/to/image.png" />
> >> 
> >> makeinfo could produce
> >> 
> >>   <img src="data:image/png;base64,iVBORw0KGgoAAAANS..."
> >
> > Ah, apologies for my misunderstanding.  No, such inlining is not
> > supported by Texinfo for HTML, AFAIK, they only support external image
> > files for HTML.  (DVI and PDF outputs do embed the image, I believe.)
> 
> What about the Info viewer in Emacs?

Same: it displays external image files, given a special control
sequence which refers to it.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-23 12:46               ` Philip Kaludercic
  2024-09-23 14:19                 ` Eli Zaretskii
@ 2024-09-26  4:02                 ` Stefan Kangas
  2024-09-26 20:10                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 1 reply; 16+ messages in thread
From: Stefan Kangas @ 2024-09-26  4:02 UTC (permalink / raw)
  To: Philip Kaludercic, Eli Zaretskii; +Cc: 73425, me, monnier

Philip Kaludercic <philipk@posteo.net> writes:

> Yes.  My suggestion is to allow listing additional non-.texi/.org files
> under :doc that would be copied out to the web server.  So in Eshel's
> case, we could update the specification to be
>
>  (kubed			:url "https://git.sr.ht/~eshel/kubed"
>   :doc ("kubed.texi" "images/"))
>
> and the HTTP server could host all files under images/.

That has a significant drawback: when package maintainers want to add a
new image, they have to patch the (Non-)GNU ELPA package listing.

It would be better to keep that information it in the package itself
somehow, like we do with .elpaignore.  Or we could just copy all image
files automatically.





^ permalink raw reply	[flat|nested] 16+ messages in thread

* bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals
  2024-09-26  4:02                 ` Stefan Kangas
@ 2024-09-26 20:10                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 16+ messages in thread
From: Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-09-26 20:10 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Philip Kaludercic, me, Eli Zaretskii, 73425

>> Yes.  My suggestion is to allow listing additional non-.texi/.org files
>> under :doc that would be copied out to the web server.  So in Eshel's
>> case, we could update the specification to be
>>
>>  (kubed			:url "https://git.sr.ht/~eshel/kubed"
>>   :doc ("kubed.texi" "images/"))
>>
>> and the HTTP server could host all files under images/.
>
> That has a significant drawback: when package maintainers want to add a
> new image, they have to patch the (Non-)GNU ELPA package listing.

Agreed.

> It would be better to keep that information it in the package itself
> somehow, like we do with .elpaignore.  Or we could just copy all image
> files automatically.

I think we should provide a "generic" way to provide some of the
`elpa-packages` contents directly from the package's own files.
I was thinking of something like a

    ;; ELPA-spec: (:readme "README.md" :doc "clear.texi" ...)

there's a security implication, so we'd need to "sanitize" this info
before using it, but other than that it should not be too hard
to implement.

But to get back to the "real" problem of images: in order for manual
`foo` to be able to have (working) cross-links to manual `bar`, it's
important that they are both exposed as `.../doc/foo.html` and
`.../doc/bar.html`, so they can't both use an image with a relative
URL of `snapshot1.png`.


        Stefan






^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-09-26 20:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-22 16:06 bug#73425: 31.0.50; Support images in HTML versions of ELPA package manuals Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-22 17:45 ` Eli Zaretskii
2024-09-22 18:03   ` Philip Kaludercic
2024-09-22 18:13     ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-22 18:16       ` Philip Kaludercic
2024-09-22 18:43         ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-22 18:15     ` Eli Zaretskii
2024-09-22 18:23       ` Philip Kaludercic
2024-09-22 19:05         ` Eli Zaretskii
2024-09-23 10:48           ` Philip Kaludercic
2024-09-23 12:03             ` Eli Zaretskii
2024-09-23 12:46               ` Philip Kaludercic
2024-09-23 14:19                 ` Eli Zaretskii
2024-09-26  4:02                 ` Stefan Kangas
2024-09-26 20:10                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-23 14:00             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).