[Rd] Addition of a meta viewport tag to HTML manuals

Bob Rudis bob @end|ng |rom rud@|@
Thu Jul 18 10:17:43 CEST 2019


Thanks for both the support & sage advice, Martin!

And, aye, tis straightforward to convert the perl one-liner to a
shell/sed idiom.

A kind soul from the list has also offered to walk me through the
"provide a patch" process and I'll do my best to get it right on Par 1
:-)

-Bob

On Mon, Jul 15, 2019 at 5:54 AM Martin Maechler
<maechler using stat.math.ethz.ch> wrote:
>
> >>>>> Bob Rudis
> >>>>>     on Tue, 9 Jul 2019 14:24:24 -0400 writes:
>
>     > The addition of a single line:
>     > <meta name="viewport" content="width=device-width, initial-scale=1.0">
>
>     > at in the <head> of the R HTML generated manuals would make them much easier to read on mobile devices.
>
>     > texi2any (which generates the HTML files) is based on long-working Perl code that includes many modern HTML elements but does not include this one.
>
>     > A Perl one-liner in the install-html: Makefile directive in Makefile.in:
>
>     > install-html: installdirs
>     > @for f in $(OBJECTS_HTML); do \
>     > if test -f $${f} ; then \
>     > $(INSTALL_DATA) $${f} "$(DESTDIR)$(rdocdir)/manual"; \
>     > perl -pi -e 's/\<meta name="desc/<meta name="viewport" content="width=device-width, initial-scale=1.0">\n<meta name="desc/' "$(DESTDIR)$(rdocdir)/manual/*.html"; \
>     > fi \
>     > done
>
>     > would insert this (I still need to read Makefile.win to see where it should go there) and I'd be glad to create a PR unless folks do not think better accessibility on mobile is a good idea.
>
> To the contrary.
> Thank you very much, Bob, for bringing this up, here!
>
>     > $(PERL) does not seem to be defined but Perl itself is a requirement for texi2any so it is definitely something that would work in the current installation process.
>
>     > -Bob
>
> Hmm,.. a very long time ago,  perl was an absolute requirement
> for building R from the sources, but in the mean time, it's not
> been required anymore strictly *).  AFAIK, there are alternative versions
> of versions/alternatives to texi2any  (say on Windoze .. or
> bizarre Linux distros or non-linux unices), and I'm almost sure
> we do not want to require perl explicitly.
>
> We are using R itself in many places for installation things,
> but here, it should be possible to use smaller unix tools (such
> as 'sed' and 'grep' say) instead.
>
> If you (or someone else) provided a small patch for using those
> instead of perl, I don't see a reason not to be grateful and
> apply it to the sources.
>
> Thank you once more
> Martin
>
>
> --
> *)  perl is mentioned twice in the "R Administration and
>     Installation" manual:
>     1. maybe needed for 'install-info'  *if* there's no
>       'install-info' command on the system [but on my Fedora and
>        probably most "math-y" Linux dist there is a binary]
>
>     2. On Windoze, the texinfo 5.x package needs perl



More information about the R-devel mailing list