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

Bob Rudis bob @end|ng |rom rud@|@
Tue Jul 9 20:24:24 CEST 2019


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.

$(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


More information about the R-devel mailing list