Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7b25b41a160a705ae294a249df5b892fc8a67112ddf09c9162c73f4c7f4dbafd
Ticket: 7f6005a867a432cc5a83fff7b7866fabd5f677eb
Magic <meta> viewport tag in generated HTML for mobile browsers
User & Date: anonymous on 2021-06-18 18:20:45
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Currently, the HTML-format reference pages (as available from
    https://www.tcl.tk/man/) tend to look a bit odd on mobile browsers (Android,
    iOS). The exact misbehavior differs from device to device and browser to
    browser, but tends to involve rendering certain elements with extremely small
    font sizes. This occurs because mobile browsers pretend, by default, that their
    viewports are much larger than they really are, unless the page includes a
    special <meta> tag to tell them otherwise. The following adds such a tag to the
    generated reference pages, and makes them render more nicely, at least on my
    Android devices:
    
    Index: tools/tcltk-man2html-utils.tcl
    ==================================================================
    --- tools/tcltk-man2html-utils.tcl
    +++ tools/tcltk-man2html-utils.tcl
    @@ -78,11 +78,11 @@
         set level ""
         if {[lindex $args end] eq "../[indexfile]"} {
            # XXX hack - assume same level for CSS file
            set level "../"
         }
    -    set out "<!DOCTYPE html>\n<html lang=\"en\">\n<head><meta charset=\"utf-8\"><title>$title</title>\n[CSS $level]</head>\n"
    +    set out "<!DOCTYPE html>\n<html lang=\"en\">\n<head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>$title</title>\n[CSS $level]</head>\n"
         foreach {uptitle url} $args {
            set header "<a href=\"$url\">$uptitle</a> <small>&gt;</small> $header"
         }
         append out "<body><h2>$header</h2>"
         global manual
    
  5. foundin changed to: "trunk"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "d53d839b44106bbdb36827934c6b01eab6894287"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "53. Configuration and Build Tools"
  15. title changed to:
    Magic <meta> viewport tag in generated HTML for mobile browsers
    
  16. type changed to: "Patch"