Width of HTML Output

329 views
Skip to first unread message

Lex Trotman

unread,
Sep 6, 2009, 5:00:18 AM9/6/09
to asciidoc
Hi,

Currently asciidoc generates xhtml11 with unconstrained length lines.
This is contrary to currently recommended practice (see W3C WCAG 2.0
1.4.8 for recommendations, <80 characters and links to information on
the physiology of reading long lines http://www.w3.org/TR/WCAG)

I use the simple solution for non-IE6 browsers of adding max-width =
40em or similar to the body section of xhtml11.css. I am requesting
that it be added to the standard css in asciidoc.

max-width is ignored by IE6 and before and I know of no good fix
(there are lots of bad ones on the net) but maybe something can be
added to quirks or just leave those browsers as is.

And before you say that users just have to re-size their browser (not
that you would of course :-)

1. It is inappropriate with tabbed browsers because individual tabs
can't be sized differently
2. It is not the users responsibility to meet presentation
recommendations
3. Minor but common, many users don't know they should re-size the
browser

Cheers
Lex

Stuart Rackham

unread,
Sep 9, 2009, 3:11:49 AM9/9/09
to asci...@googlegroups.com
Hi Lex

Seems like a perfectly reasonable suggestion to me. Easy to implement, just replace:

<body>

with:

<body{max-width? style="max-width:{max-width}"}>

in xhtml11.conf. Now you can set the width from the command-line e.g.

asciidoc -a max-width=40em doc/article.txt

or put this above the header in the source document e.g.

:max-width: 40em

or if you want this in all your docs put and entry in your
$HOME/.asciidoc/asciidoc.conf file [attributes] section e.g.

max-width=40em

Will that do the trick?


Cheers,
Stuart

Lex Trotman

unread,
Sep 9, 2009, 5:38:37 AM9/9/09
to asci...@googlegroups.com
2009/9/9 Stuart Rackham <srac...@gmail.com>:
>
> Hi Lex
>
> Seems like a perfectly reasonable suggestion to me. Easy to implement, just replace:
>
> <body>
>
> with:
>
> <body{max-width? style="max-width:{max-width}"}>
>
> in xhtml11.conf. Now you can set the width from the command-line e.g.
>
>   asciidoc -a max-width=40em doc/article.txt
>
> or put this above the header in the source document e.g.
>
> :max-width: 40em
>
> or if you want this in all your docs put and entry in your
> $HOME/.asciidoc/asciidoc.conf file [attributes] section e.g.
>
> max-width=40em
>
> Will that do the trick?

Wow, great, so many options :-D much better than putting it in the
css works a treat.

This is a great solution, better document all those options though. ;-)

Cheers & thanks
Lex

chickenkiller

unread,
Sep 9, 2009, 8:48:31 AM9/9/09
to asciidoc


On 9 sep, 09:11, Stuart Rackham <srack...@gmail.com> wrote:
> Hi Lex
>
> Seems like a perfectly reasonable suggestion to me. Easy to implement, just replace:
>
> <body>
>
> with:
>
> <body{max-width? style="max-width:{max-width}"}>

I would personally horizontally center the text:

<body{max-width? style="max-width:{max-width};margin-left:auto;margin-
right:auto"}>

Cheers,
Lionel

Lex Trotman

unread,
Sep 9, 2009, 8:57:58 AM9/9/09
to asci...@googlegroups.com
2009/9/9 chickenkiller <lione...@gmail.com>:
Hi Lionel,

Here we get into personal preferences, I personally hate those pages
with a strip of content in the middle of the page I prefer it left
aligned, so I wouldn't like to see it the default.

Cheers
Lex



>
> Cheers,
> Lionel
> >
>

chickenkiller

unread,
Sep 9, 2009, 10:16:39 AM9/9/09
to asciidoc
Hi Lex,

you're right that's a personal taste. I was not suggesting that as a
default, rather an alternative for people who may prefer. I agree with
the fact that the simpler/cleaner the default is, the better. And if
it can follow the W3C accessibility guidelines, that's even better.

This alignment could also be put in the stylesheet, that may be a
better place for it. But again, I'm not asking Stuart to integrate
that :)

Lionel

On 9 sep, 14:57, Lex Trotman <ele...@gmail.com> wrote:
> 2009/9/9 chickenkiller <lionel.o...@gmail.com>:

Stuart Rackham

unread,
Sep 9, 2009, 4:29:58 PM9/9/09
to asci...@googlegroups.com
Lex Trotman wrote:
> 2009/9/9 Stuart Rackham <srac...@gmail.com>:
>> Hi Lex
>>
>> Seems like a perfectly reasonable suggestion to me. Easy to implement, just replace:
>>
>> <body>
>>
>> with:
>>
>> <body{max-width? style="max-width:{max-width}"}>
>>
>> in xhtml11.conf. Now you can set the width from the command-line e.g.
>>
>> asciidoc -a max-width=40em doc/article.txt
>>
>> or put this above the header in the source document e.g.
>>
>> :max-width: 40em
>>
>> or if you want this in all your docs put and entry in your
>> $HOME/.asciidoc/asciidoc.conf file [attributes] section e.g.
>>
>> max-width=40em
>>
>> Will that do the trick?
>
> Wow, great, so many options :-D much better than putting it in the
> css works a treat.
>
> This is a great solution, better document all those options though. ;-)

Added to the trunk: http://hg.sharesource.org/asciidoc/rev/c4a3c0189311

Cheers, Stuart
Reply all
Reply to author
Forward
0 new messages