martin f krafft | 3 Mar 2006 10:28

nested lists syntax

I can write lists without empty lines between items:

  * A
  * B
  * C

However, if I nest a list, I have to keep an empty line before and
after:

  * A
  * B

    - 1
    - 2

  * C

If I do not do that, the rst2html script produces e.g. "<li>B
- 1 - 2</li>". That is: it does not recognise the nested list as
a list.

Is there a reason this is required? Would it be difficult to extend
the parser to work with compact lists too?

--

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net <at> madduck

invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: madduck.bogus <at> madduck.net
(Continue reading)

David Goodger | 6 Mar 2006 15:02
Favicon

Re: nested lists syntax

[martin f krafft]
> I can write lists without empty lines between items:
>
>   * A
>   * B
>   * C
>
> However, if I nest a list, I have to keep an empty line before and
> after:
>
>   * A
>   * B
>
>     - 1
>     - 2
>
>   * C
>
> If I do not do that, the rst2html script produces e.g. "<li>B
> - 1 - 2</li>". That is: it does not recognise the nested list as
> a list.
>
> Is there a reason this is required?

Yes.  There is too much ambiguity otherwise:

    For example, a paragraph could contain an equation like "2
    - 1 = 1".

Such an accidental line wrapping would have unfortunate and unintended
(Continue reading)

David Goodger | 6 Mar 2006 21:26
Favicon

Re: Error in Docutils 0.4.0

[Andreas Jung]
> I tried to upgrade the Docutils in Zope 2 from 0.3 to 0.4 however the
> existing Docutils integration fails:
> 
> 2006-02-24 17:35:03 INFO Zope Ready to handle requests
> 2006-02-24 17:35:03 ERROR Zope.SiteErrorLog http://localhost:8080/d1
> Traceback (most recent call last):
...
> "/Users/ajung/sandboxes/Zope/Zope/lib/python/docutils/parsers/rst/__init__.py",
> line 142, in __init__
>    self.state_classes = states.state_classes
> AttributeError: 'module' object has no attribute 'state_classes'
> 
> Bug or feature?

Definitely not a feature!  But it's confusing.

That code path is followed every time the reST parser is run, but I've
never seen this error before.  Module docutils.parsers.rst.state
definitely does have an attribute state_classes: it's the last thing in
the module.

Could there be mismatched modules installed on your machine?
Could you find out exactly what module 'state' identifies when it crashes?

--

-- 
David Goodger <http://python.net/~goodger>

Pierre Rouleau | 7 Mar 2006 03:28

Problems using Epydoc 2.1 with Docutils 0.5

Hi all,

I'v been using Epydoc and Docutils to generate HTML documentation for 
Python code with docstring formatted with reStructuredText markup for 
some time and with very good success.  I was using Epydoc 2.0 and 
Docutils 0.3.  Everything is fine with those (including the code snippet 
i show below).

With Epydoc 2.1 and Docutils 0.5, however, Epydoc throws an exception on 
a very small code snippet which includes a simple table reStructuredText 
style.

I wonder if anyone have seen the same problem and whether this has been 
resolved already.

I am using Python 2.4.2 on Windows XP.

Here's the test code (placed in a file I called concrete1.py)::

#--------------
class Something(object):
     """ A class that will do something... someday...

     """

     def do___eq__(self, some_arg) :
         """Returns self == other.

         =================== ==================
         Arguments           Description
(Continue reading)

martin f krafft | 7 Mar 2006 12:56

Re: nested lists syntax

also sprach David Goodger <goodger <at> python.org> [2006.03.06.1502 +0100]:
> > Is there a reason this is required?
> 
> Yes.  There is too much ambiguity otherwise:

I should have known you guys already considered all of this. Sorry
for the noise and thanks for the explanation.

--

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net <at> madduck

invalid/expired pgp (sub)keys? use subkeys.pgp.net as keyserver!
spamtraps: madduck.bogus <at> madduck.net

"a scientist once wrote that all truth passes through three stages:
 first it is ridiculed, then violently opposed and eventually,
 accepted as self-evident."
                                                       -- schopenhauer
Felix Wiemann | 10 Mar 2006 20:39
Picon

Re: latex math

Alan G Isaac wrote:

> It does not seem to be a Wiki ...
> Do you mean "submit a documentation patch"?

It might be cool if people could submit documentation patches by hitting
"edit" on the online web page and editing the reStructuredText source
online.

That is, like a wiki, except that changes aren't committed directly but
submitted to us (David and me) instead.

Just tinkering with the idea...  I have this on my internal to-do list,
but it's only feasible if we switch to a templating system like
rest2web.  (Which we'll have to do anyway at some point.)

--

-- 
For private mail please ensure that the header contains 'Felix Wiemann'.

"the number of contributors [...] is strongly and inversely correlated with the
number of hoops each project makes a contributing user go through."      -- ESR

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Jörg W Mittag | 13 Mar 2006 04:06
Picon

Alternative punctuation and whitespace not recognized as such

=================================================================
  Alternative punctuation and whitespace not recognized as such
=================================================================

.. admonition:: Abstract

	Using whitespace or punctuation characters other than the 
	standard English ones may result in surprising__ behaviour.

.. contents::

Hi,

Inconsistent parsing
====================

I have discovered what I believe to be an inconsistency in the 
handling of whitespace and punctuation by the |reST|_ parser: the 
parser doesn’t treat all forms of whitespace and/or punctuation 
consistently.  For example, a ``space`` is considered whitespace, 
but a ``thin space`` or ``non-breaking space`` are not.

.. note:: At least for block quotes, an ``em-dash`` *is* actually 
   recognized as an attribution delimiter, while an ``en-dash`` is 
   not. See example_ below.

.. note:: I am not a programmer, so I haven't actually looked at 
   the code.  Everything is write is based purely in observing the 
   output of the HTML writer.

(Continue reading)

Jörg W Mittag | 13 Mar 2006 18:43
Picon

Re: Alternative punctuation and whitespace not recognized as such

Jörg W Mittag wrote::

> .. important:: I must admit that I have not fully understood 
>    ``directives`` and ``roles``, so maybe I might have overlooked 
>    something that renders all this moot.  If that is the case, 
>    just ignore me.  I’m a moron.

Alright, it’s official.  I *am* a moron.  Move on, people, there’s
nothing to see here!

I completely overlooked the directive idea for a ``text-replace``
directive in the entry for character-processing__ in the `Record of
reStructuredText Syntax Alternatives`__ document.

.. note:: If such a ``text-replace`` directive were to be actually 
   implemented, it would be nice to be able to load a default set of 
   simple replacement rules in one go.  Something like::

   	.. text-replace-default::

   or just an empty ``text-replace`` directive::

   	.. text-replace::

   This would make it possible to load a simple set of pre-canned 
   replacement rules without having to clutter every document with a 
   whole bunch of the same rules over and over again.  Some possible 
   candidates would be ``--``, ``---`` (dashes), ``,,``, ``´´`` 
   (quotation marks), ``>>``, ``<<`` (guillemets) or ``...`` 
   (ellipsis).
(Continue reading)

Mike Orr | 13 Mar 2006 21:29
Picon

Re: Re: Alternative punctuation and whitespace not recognized as such

On 3/13/06, Jörg W Mittag <Joerg.Mittag <at> web.de> wrote:
> Alright, it's official.  I *am* a moron.  Move on, people, there's
> nothing to see here!

But your original message in ReST format was delightful.  I did wonder
how long it took to compose and get all the ``markup`` right, though.
:)

--
Mike Orr <sluggoster <at> gmail.com>
(mso <at> oz.net address is semi-reliable)

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
Jörg W Mittag | 14 Mar 2006 00:08
Picon

Re: Re: Alternative punctuation and whitespace not recognized as such

Mike Orr wrote::

> On 3/13/06, Jörg W Mittag <Joerg.Mittag <at> web.de> wrote:
>> Alright, it's official.  I *am* a moron.  Move on, people, there's
>> nothing to see here!
> But your original message in ReST format was delightful.  I did wonder
> how long it took to compose and get all the ``markup`` right, though.
> :)

Not *that* long.  I mean, that’s the point of ReST, isn’t it?  I only
discovered ReST four days ago, and learning the basic syntax took me
about 10 seconds.  It was basically like: “Hey, that’s how I do it
anyway!”—I had been writing ReST documents all my life without even
knowing it (-;

Now, coming up with the message took some time, but that had nothing
to do with ReST.  The *real* thing that was slowing me down was having
to think in English.

*Writing* the message down was rather easy. Sure, I had to match up
the odd link or look up some syntax (remember, I’m only using ReST for
four days now), but all in all, it went smoothly. However, entering
all those fscking special characters was a major PITA and took quite
some time—which, of course, was one of the points I wanted to
demonstrate.

jwm

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
(Continue reading)


Gmane