From: Martin <mar...@gm...> - 2010-01-30 10:01:22
|
Does docutils support auto-enumerated nested lists with outline numbering like so: #. item #. item #.#. nested item #.#. nested item to produce: 1. item 2. item 1.1. nested item 1.2. nested item Is there any other way to achieve this effect? It seems like docutils knows how to produce outline numbering of headings. |
From: David G. <go...@py...> - 2010-01-30 13:13:35
|
I assume you're asking about HTML output. If not, please specify. On Sat, Jan 30, 2010 at 05:00, Martin <mar...@gm...> wrote: > Does docutils support auto-enumerated nested > lists with outline numbering like so: ... > #.#. nested item No. > Is there any other way to achieve this effect? The list numbering mechanism uses HTML ordered lists, which don't support a compound numbering (that I know of). Perhaps you can achieve this through styles. I don't know CSS2/3 well enough to say. > It seems like docutils knows how to produce outline numbering of headings. That is a separate mechanism. -- David Goodger <http://python.net/~goodger> |
From: Martin C. <mar...@gm...> - 2010-01-31 17:35:14
|
I am actually looking for HTML, pdf and odt output. I did not realise that the numbering relied on format specific features. On Sat, Jan 30, 2010 at 2:13 PM, David Goodger <go...@py...> wrote: > I assume you're asking about HTML output. If not, please specify. > > On Sat, Jan 30, 2010 at 05:00, Martin <mar...@gm...> wrote: >> Does docutils support auto-enumerated nested >> lists with outline numbering like so: > ... >> #.#. nested item > > No. > >> Is there any other way to achieve this effect? > > The list numbering mechanism uses HTML ordered lists, which don't > support a compound numbering (that I know of). > > Perhaps you can achieve this through styles. I don't know CSS2/3 well > enough to say. > >> It seems like docutils knows how to produce outline numbering of headings. > > That is a separate mechanism. > > -- > David Goodger <http://python.net/~goodger> > |
From: Guenter M. <mi...@us...> - 2010-01-30 21:36:53
|
On 2010-01-30, David Goodger wrote: > I assume you're asking about HTML output. If not, please specify. > On Sat, Jan 30, 2010 at 05:00, Martin <mar...@gm...> wrote: >> Does docutils support auto-enumerated nested >> lists with outline numbering like so: > ... >> #.#. nested item > No. However, you can create a sublist like so:: #. first point #. first subpoint and style it accordingly (with the html_strict writer) >> Is there any other way to achieve this effect? > The list numbering mechanism uses HTML ordered lists, which don't > support a compound numbering (that I know of). > Perhaps you can achieve this through styles. I don't know CSS2/3 well > enough to say. The HTML-strict writer (in the sandbox) can do this out of the box if you give the "nested" class argument:: .. class:: nested #. first point #. first subpoint Günter |
From: David G. <go...@py...> - 2010-01-30 21:52:58
|
On Sat, Jan 30, 2010 at 16:36, Guenter Milde <mi...@us...> wrote: > On 2010-01-30, David Goodger wrote: >> I assume you're asking about HTML output. If not, please specify. > >> On Sat, Jan 30, 2010 at 05:00, Martin <mar...@gm...> wrote: >>> Does docutils support auto-enumerated nested >>> lists with outline numbering like so: >> ... >>> #.#. nested item > >> No. > > However, you can create a sublist like so:: > > #. first point > #. first subpoint A blank line is required between those lines though, right? > and style it accordingly (with the html_strict writer) > >>> Is there any other way to achieve this effect? > >> The list numbering mechanism uses HTML ordered lists, which don't >> support a compound numbering (that I know of). > >> Perhaps you can achieve this through styles. I don't know CSS2/3 well >> enough to say. > > The HTML-strict writer (in the sandbox) can do this out of the box if > you give the "nested" class argument:: > > .. class:: nested > > #. first point > #. first subpoint How does HTML-strict do this formatting? Is it a stylesheet issue? What is the HTML produced? -- David Goodger <http://python.net/~goodger> |
From: Guenter M. <mi...@us...> - 2010-02-01 08:18:03
|
On 2010-01-30, David Goodger wrote: > On Sat, Jan 30, 2010 at 16:36, Guenter Milde <mi...@us...> wrote: >> On 2010-01-30, David Goodger wrote: >>> On Sat, Jan 30, 2010 at 05:00, Martin <mar...@gm...> wrote: >>>> Does docutils support auto-enumerated nested >>>> lists with outline numbering like so: >>> ... >>>> #.#. nested item >>> No. >> However, you can create a sublist like so:: >> #. first point >> #. first subpoint > A blank line is required between those lines though, right? Yes indeed. ... >> The HTML-strict writer (in the sandbox) can do this out of the box if >> you give the "nested" class argument:: > How does HTML-strict do this formatting? Is it a stylesheet issue? It sets up a CSS counter for enumerations. (It took me quite a lot of research and experimenting to get the layout right. This is documented in sandbox/html4strict/README.html) :: /* Ordered List (Enumeration) -------------------------- Use counters to replace the deprecated start attribute. Make sure the resulting list resembles the list-style 'outside' with a hanging indent. */ /* New ordered list: reset counter, suppress the default label */ ol { counter-reset: item; list-style-type: none ! important; } /* Set the negative indent of the list label as feature of the list item */ ol > li {text-indent: -2.5em;} /* Label */ ol > li:before { /* increment and typeset counter(s), */ counter-increment: item; content: counter(item) "."; /* display next to the content (aligned top-right), */ display: inline-block; text-align: right; vertical-align: top; width: 2em; padding-right: 0.5em; } /* The list item's first paragraph starts next to the label, without indent */ ol > li > p { display: inline-block; text-indent: 0; } /* Subsequent paragraphs are set as nested block elements */ ol > li > p + p { display: block; margin-top: 0; } /* default separator variants */ ol.loweralpha > li:before { content: counter(item, lower-alpha) ")"; } ol.upperalpha > li:before { content: counter(item, upper-alpha) "."; } ol.lowerroman > li:before { content: "(" counter(item, lower-roman) ")"; } ol.upperroman > li:before { content: counter(item, upper-roman) ")"; } /* nested counters (1, 1.1, 1.1.1, etc) */ ol.nested li:before { content: counters(item, ".") "."; } see sandbox/html4strict/html4strict/html4css2.css > What is the HTML produced? .. class:: nested #. first point #. first subpoint results in <ol class="nested arabic simple"> <li>first point<ol class="arabic"> <li>first subpoint</li> </ol> </li> </ol> Some points: * Testing revealed that the selector was too restrictive. This is fixed in the SVN commit from 2010-02-01. * There is still room for improvement with the label width/alignment of nested counters. Patches welcome. * On my machine, I have a functional test for the html4_strict writer as part of the Docutils test suite. If the writer proves usefull, I'd like to move it from the sandbox to the Docutils core - this would enable me to commit the tests as well. Günter |
From: David G. <dgo...@gm...> - 2010-02-01 14:31:23
|
>>>> On Sat, Jan 30, 2010 at 05:00, Martin <mar...@gm...> wrote: >>>>> Does docutils support auto-enumerated nested >>>>> lists with outline numbering like so: >>>> ... >>>>> #.#. nested item > On 2010-01-30, David Goodger wrote: >> How does HTML-strict do this formatting? Is it a stylesheet issue? 2010/2/1 Guenter Milde <mi...@us...>: > It sets up a CSS counter for enumerations. Correct me if I'm wrong, but there doesn't seem to be anything specific to the HTML-strict writer here. It's all done in CSS, so the same CSS can be applied to HTML generated by the HTML4CSS1 writer. > (It took me quite a lot of research and experimenting to get the layout > right. This is documented in sandbox/html4strict/README.html) Very well done! -- David Goodger <http://python.net/~goodger> |
From: Guenter M. <mi...@us...> - 2010-02-01 08:29:44
|
On 2010-01-31, Martin Clausen wrote: > I am actually looking for HTML, pdf and odt output. > I did not realise that the numbering relied on format specific features. The numbering of auto-numbered nested lists is done at the writer level. The "standard" format 1. item 1. sub item 2. item is supported by all writers. Different number formats (alpha, roman, ...) are recognized for manual numbered enumerations and supported by most writers (except html4css1). Other formatting like "nested counters" is an "add-on". Günter |
From: David G. <dgo...@gm...> - 2010-02-01 14:31:21
|
2010/2/1 Guenter Milde <mi...@us...>: > On 2010-01-31, Martin Clausen wrote: >> I am actually looking for HTML, pdf and odt output. > >> I did not realise that the numbering relied on format specific features. > > The numbering of auto-numbered nested lists is done at the writer level. Misleading. The writers facilitate the numbering, but many don't do any concrete numbering. In the case of HTML, the browser handles the actual numbering (the concrete rendering of numbers & letters). > The "standard" format > > 1. item > > 1. sub item > > 2. item > > is supported by all writers. > > Different number formats (alpha, roman, ...) are recognized for manual > numbered enumerations and supported by most writers (except html4css1). Not true. The html4css1 writer supports all numbering formats (arabic, upper/lower alpha & roman). Try it. -- David Goodger <http://python.net/~goodger> |
From: Guenter M. <mi...@us...> - 2010-02-02 09:17:43
|
On 2010-02-01, David Goodger wrote: >>>>> On Sat, Jan 30, 2010 at 05:00, Martin <mar...@gm...> wrote: >>>>>> Does docutils support auto-enumerated nested >>>>>> lists >> On 2010-01-30, David Goodger wrote: > 2010/2/1 Guenter Milde <mi...@us...>: >> It sets up a CSS counter for enumerations. > Correct me if I'm wrong, but there doesn't seem to be anything > specific to the HTML-strict writer here. It's all done in CSS, so the > same CSS can be applied to HTML generated by the HTML4CSS1 writer. You are right, the HTML is the same for this cases. However, the CSS rule set was implemented to solve the problem that the "start" argument is not valid in HTML4 strict, so the html4strict writer converts 4. viertens 5. fünftens to <ol class="arabic simple" style="counter-reset: item 3;"> <li>viertens</li> <li>fünftens</li> </ol> Improved "stylability" is a welcome side effect. >> (It took me quite a lot of research and experimenting to get the layout >> right. This is documented in sandbox/html4strict/README.html) > Very well done! Thanks, Günter |
From: Guenter M. <mi...@us...> - 2010-02-02 09:24:47
|
On 2010-02-01, David Goodger wrote: > 2010/2/1 Guenter Milde <mi...@us...>: >> On 2010-01-31, Martin Clausen wrote: >>> I am actually looking for HTML, pdf and odt output. >>> I did not realise that the numbering relied on format specific features. >> The numbering of auto-numbered nested lists is done at the writer level. > Misleading. The writers facilitate the numbering, but many don't do > any concrete numbering. In the case of HTML, the browser handles the > actual numbering (the concrete rendering of numbers & letters). OK, the point that I wanted to make clear is that there is no generic auto-numbering feature (transform) like for the section numbers or footnotes. Instead, this is left as an exercise to the writer. The writer, however, is free to pass this exercise on to the backend, be it LaTeX, Openoffice, or the HTML browser. >> The "standard" format >> 1. item >> 1. sub item >> 2. item >> is supported by all writers. >> Different number formats (alpha, roman, ...) are recognized for manual >> numbered enumerations and supported by most writers (except html4css1). > Not true. The html4css1 writer supports all numbering formats (arabic, > upper/lower alpha & roman). Try it. Sorry, I actually mixed support for number and decorator. Compare standalone_rst_html4css1.html#enumerated-lists 1. Arabic numerals. a. lower alpha) i. (lower roman) A. upper alpha. I. upper roman) with standalone_rst_html4strict.html#enumerated-lists 1. Arabic numerals. a) lower alpha) (i) (lower roman) A. upper alpha. I) upper roman) Günter |