- From: Wayne Dick <wayneedick@gmail.com>
- Date: Fri, 1 Feb 2019 10:45:07 -0800
- To: Alastair Campbell <acampbell@nomensa.com>
- Cc: WCAG list <w3c-wai-gl@w3.org>
- Message-ID: <CAJeQ8SAh2aWxS8nJBJf_cOBeNYUMW7rC4pm3CnLJ9SnounV3rA@mail.gmail.com>
Hi All, Code is another problem. I will try to define it. The Problem of Display Code Code that is displayed (display code) in documentation is not programming language code (pl code). Sometimes snippets presented for display can be run as is, but it is frequently incomplete. Moreover, you cannot compile the HTML or PDF that is used to display code as anything but HTML or PDF respectively. The question is this: Can the semantics of display code be represented in pre format? I don’t think so. What is a body of display code? Display code is a nested list structure, that is not defined in HTML. Therein lies the problem. Identification of nesting levels is critical to meaning, but it does not need to be done with indentation. If indentation is used to denote meaning it should be preserved with word wrap for readability. It can also be removed as long as the block level is identifiable. For example: the javascript below has now indentation, but the block divides are clear enough to follow. We use this format at the “Visually Handicapped Training Course” back in 1974. (Yep that’s what they called us back then.) 001 this.colorSheet = 002 { 003 "name": this.colorNameRec, 004 "purpose": "change to user colors", 005 "source": "user", 006 "rules": 007 [ 008 { 009 "selector": this.colorSelect, 010 "list": 011 [ 012 this.bkColorRec, 013 this.txtColorRec 014 ] 015 }, 016 { 017 "selector": this.selectionSelect, 018 "List": 019 [ 020 this.bkSelectionRec, 021 this.txtSelectionRec 022 ] 023 } 024 ] 025 }; The point is display code is a highly structured object. One could write Extended BNF for display code, and it would be different than the BNF for the actual pl code it represents. One could also write IDL to facilitate interfaces. It hasn’t been done for the same reason people used to just scan text images into PDF. It is vary easy to copy code from an IDE and slap a pre around it. This defines the problem. I think it will take a while. You can get the sructure above from pre if the pre is displayed correctly. Sometimes: pre-line works, but sometimes it is gruesome. Best, Wayne On Fri, Feb 1, 2019 at 9:01 AM Wayne Dick <wayneedick@gmail.com> wrote: > Hi Everyone > There appears to be one category of literature that requires fixed layout > for meaning. That is writing where the layout of the letters is part of the > art. > > Most poetry falls outside of this category. It can keep its cuplet, > quatrian or sonnet format can be preserved at low enlargement and wrapped > at higher levels. > > I actually think of lines differently when they wrap. I think of them as a > line-groups. It is very much like my IDE that wrap a line but keeps the > same line number for the entire group of text. > > Conclusion: In literature, pre is only necessary when text layout is part > of the visual art. > > Best Wayne > > On Thu, Jan 31, 2019 at 9:07 AM Alastair Campbell <acampbell@nomensa.com> > wrote: > >> > when line-wrapping introduces additional line-breaks, *THEN* it >> impacts the formatted meaning, >> >> >> >> I don’t think it is that binary, there are mitigations, like there are >> with code samples. >> >> >> >> Starting with your Haiku example, if you assume that this symbol >> represented a linebreak: § >> (I can’t see how to insert a line break symbol, just pretend!) >> >> >> >> The summer river: § >> >> although there is a >> >> bridge, my horse § >> >> goes through the >> >> water. § >> >> >> >> (The email version of this has light grey shading on the top & bottom >> sentences, that will be lost for some email clients and in the archive.) >> >> >> >> I’m not saying that should be the default view, but it is a technique >> that could be used to maintain the meaning created by the formatting. >> >> >> >> There is a continuum here: >> >> - Most text shouldn’t use a pre or have a fixed-width (i.e. standard >> text that reflows now). >> - For some types of text it makes sense to have in a pre, but it >> should wrap fairly easily. >> - For some types of text it makes sense to have in a pre, but it >> could wrap with great difficulty. >> - Some text could only work in a fixed-format (definitely essential). >> >> >> >> Let’s start with sufficient techniques at the top-end of that, and work >> down until it gets too difficult to be practical. >> >> >> >> It was (and still is) a good idea to gather some examples though, the >> more the better. >> >> >> >> -Alastair >> >>
Received on Friday, 1 February 2019 18:46:06 UTC