Uploaded image for project: 'Cocoon'
  1. Cocoon
  2. COCOON-841

[PATCH] docs pages containing <source> are sometimes too wide

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 2.1.1
    • None
    • - Components: Avalon
    • None
    • Operating System: All
      Platform: All
    • 23796

    Description

      The document2html.xsl stylesheet renders <source> elements as HTML <pre>
      elements, which can make the resulting pages too wide to see on screen or
      print. This stylesheet appears not to have changed for ages.The "modules" page
      in the URL field shows the problem. This page is too wide for display on most
      screens. A web page that is wider than the screen is a complete bastard to
      read - you have to scroll left and right all the time. And printing in
      landscape orientation is not very nice either.

      The problem is:

      1) Browsers usually render <pre> elements in a fixed-width font, which are
      always wider than normal fonts.

      2) There is no line-wrapping in a <pre> element, so a single long line of
      source can make the web page very wide.

      The patched stylesheet includes an extra template to render simple <source>
      elements (i.e. those which contain only text content) as a <div> containing a
      sequence of <p> elements. The font itself is not specified, so it will
      generally be a proportional font. The font size is reduced anyway ("smaller").
      The template uses CSS "style" attributes to retain the original indentation
      while allowing line-wrapping. A single space of indentation is rendered as a
      4pt indent. Where a line of source wraps, the subsequent line is further
      indented by 8pt (i.e. equivalent to 2 spaces).

      This new XSL code treats the content of the <source> element as a single
      string, so I have left the old template in place to handle <source> elements
      that contain extra markup.

      CHeers

      Con

      Attachments

        Activity

          People

            Unassigned Unassigned
            conal.tuohy@vuw.ac.nz Conal Tuohy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: