Beni Cherniavsky | 3 Dec 2005 19:08
Gravatar

Re: Re: Q&A format?

On Wed, 2005-11-30 at 18:40 +0000, Mikolaj Machowski wrote:
> Dave Kuhlman scripsit:
> > Here is a sample of what I'd like to re-format.  The format shown
> > below does not work, because some of the lines, at least, are
> > interpreted as definition lists::
> 
> Semantically Q&A *can be* definition list.

This, like the questions-are-headings solution, suffers from a
limitation: the question must fit on one line.

I like the field list approach to Q&A.  Never thought of it before.
Thanks, David.

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
David Goodger | 7 Dec 2005 00:33
Favicon

PyCon

PyCon TX 2006 is coming up, Feb. 24-26, in Addison/Dallas Texas USA.
http://www.python.org/pycon/2006/

Registration is now open, and early-bird pricing is in effect until
Dec. 31: http://www.python.org/pycon/2006/register.html

Be sure to book your room at the conference hotel:
http://www.stayatmarriott.com/Pycon2006/

There will be three Docutils-related talks:

* Docutils Developers Tutorial: Architecture, Extending, and Embedding
  (David Goodger & Felix Wiemann)

* Easy Slide Shows With reStructuredText & S5 (David Goodger)

* What is Nabu? (Martin Blais)

List of talks with summaries: http://wiki.python.org/moin/PyCon2006/Talks

I will be giving a tutorial on the day before the conference, Feb. 23,
in the morning: Text & Data Processing
(http://wiki.python.org/moin/PyCon2006/Tutorials/TextProcessing).
List of tutorials: http://wiki.python.org/moin/PyCon2006/Tutorials

We will hold a Docutils sprint in the four days following the conference:
http://wiki.python.org/moin/PyCon2006/Sprints/DocutilsSprint .
Other sprints & info: http://wiki.python.org/moin/PyCon2006/Sprints

Tell your user group.  Tell your friends, classmates, and colleagues.
(Continue reading)

Kent Tenney | 10 Dec 2005 14:31
Picon
Gravatar

Need help parsing rst

Howdy,

I am using the wonderful outlining editor, Leo
http://webpages.charter.net/edreamleo/front.html
and it's plugin for authoring reStructuredText.

Leo provides very granular configuration of
rst file generation, but the basic concept is that
a 'node' in Leo becomes a 'section' in the rst file.

I want to reverse the process, bringing the rst file
into Leo for editing.

I've banged my little head against this, I would
appreciate some direction.

Where should I look for examples of how to obtain
the tree structure of a rst file consisting of;
"This section title":"Plain text contents of This section"

Thanks,
Kent

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
David Goodger | 11 Dec 2005 00:34
Favicon

Re: Need help parsing rst

[Kent Tenney]
> Where should I look for examples of how to obtain
> the tree structure of a rst file consisting of;
> "This section title":"Plain text contents of This section"

I'm not sure what you're asking.  You can use rst2pseudoxml.py to see
the document tree:

$ rst2pseudoxml.py <<'EOF'
> This section title
> ==================
>
> Plain text contents of This section
> EOF
<document ids="this-section-title" names="this\ section\ title" source="<stdin>"
title="This section title">
    <title>
        This section title
    <paragraph>
        Plain text contents of This section

If you're asking about the internal structure, it parallels the above,
with a bunch of internal attributes.  See the docutils.nodes module
for details.

Ask some more specific, detailed questions (with code and/or
examples), and you'll get better answers!

--

-- 
David Goodger <http://python.net/~goodger>
(Continue reading)

Boris Pankin | 12 Dec 2005 20:01
Picon

Test suite failure

Hi!

Operating System: Linux polygon.home 2.6.9-22.0.1.EL #1 Thu Oct 27 12:26:11 CDT
2005 i686 i686 i386 GNU/Linux (CentOS 4.0, clone RHEL4)

Python 2.3.5 (#1, Dec 11 2005, 14:50:35) [GCC 3.4.3 20041212 (Red Hat
3.4.3-9.EL4)] on linux2

Docutils 0.3.10 [snapshot 2005-12-12, r4183] with Python 2.3.5

===
./alltests.py 
test_east_asian_text.py tests skipped; Python 2.4 or higher required.
Testing Docutils 0.3.10 [snapshot 2005-12-12, r4183] with Python 2.3.5 on
2005-12-12 at 21:46:18

======================================================================
FAIL: test_functional.py: functional/tests/dangerous.py
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/aabp/src/docutils/test/test_functional.py", line 129, in test
    'Cannot find expected output at\n' + expected_path)
  File "/usr/lib/python2.3/unittest.py", line 278, in failUnless
    if not expr: raise self.failureException, msg
AssertionError: Cannot find expected output at
functional/expected/dangerous.html

======================================================================
FAIL: test_functional.py: functional/tests/pep_html.py
----------------------------------------------------------------------
(Continue reading)

Kent Tenney | 12 Dec 2005 23:37
Picon
Gravatar

Re: Need help parsing rst

> Ask some more specific, detailed questions

I don't seem to know the terminology well enough to frame the questions,
I'll try an example ...

The conversion between the outline file and rst only involves
managing the hierarchy of sections/nodes, no other parsing.

Outline:

Top node (contents of the top node)
             |
              - Child node (contents of the Child node)
                               |
                                - Sub child node (contents of Sub child node)

Sibling node(My *favorite* language is Python_. \n\n.. _Python:
http://www.python.org/)

rst:

Top node
=======

contents of the top node

Child node
++++++++

contents of the Child node
(Continue reading)

David Goodger | 13 Dec 2005 15:01
Favicon

Re: Need help parsing rst

[Kent Tenney]
> I don't seem to know the terminology well enough to frame the questions,
> I'll try an example ...

Assume that we don't know what you're talking about (we don't), and
try to explain what you want in simple and direct terms.

1. Do you want to write code that uses Docutils to output a Leo file?
2. Or do you want to write code for Leo that imports a reST file?
3. Or ... (fill in the blanks)?

If #1, show the input and the desired output.

> My guess is that it will be simpler to not use docutils code.

Your guess is probably better than mine, because I really *would* be
guessing!

--

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

David Goodger | 13 Dec 2005 14:29
Favicon

Re: Test suite failure

[Boris Pankin]
> Operating System: Linux polygon.home 2.6.9-22.0.1.EL #1 Thu Oct 27
> 12:26:11 CDT 2005 i686 i686 i386 GNU/Linux (CentOS 4.0, clone RHEL4)
>
> Python 2.3.5 (#1, Dec 11 2005, 14:50:35) [GCC 3.4.3 20041212 (Red Hat
> 3.4.3-9.EL4)] on linux2
>
> Docutils 0.3.10 [snapshot 2005-12-12, r4183] with Python 2.3.5
>
> ===
> ./alltests.py

What is the directory path when you execute this command?

> ======================================================================
> FAIL: test_functional.py: functional/tests/dangerous.py
> ----------------------------------------------------------------------
...
> AssertionError: Cannot find expected output at
> functional/expected/dangerous.html
...

It seems that none of the files in test/functional/expected/ can be
found.  Please show the results of these shell commands:

    cd src/docutils/test
    ls -l functional
    ls -l functional/expected

--

-- 
(Continue reading)

David Goodger | 13 Dec 2005 18:44
Favicon

Re: [Fwd: Re: Test suite failure]

On 12/13/05, Boris Pankin <aabp <at> mail.ru> wrote:
> Repost.
>
> "Diagnostic-Code: X-mPOP-Fallback_MX; host
> mail.python.org[194.109.207.14] said:
>      554 Service unavailable; Client host [194.67.57.14] blocked using
>      t1.dnsbl.net.au;"

Hmm.  Seems like your server may have been blacklisted.

> David Goodger wrote:
>> It seems that none of the files in test/functional/expected/ can be
>> found.  Please show the results of these shell commands:
>>
>>     cd src/docutils/test
>>     ls -l functional
>>     ls -l functional/expected
>
> [aabp <at> polygon test]$ LANG=C ls -l functional/
> total 40
> -rw-rw-r--  1 aabp aabp  167 Mar 22  2005 README.txt
> drwsrwsr-x  3 aabp aabp 4096 Dec 12 21:44 expected
> drwsrwsr-x  3 aabp aabp 4096 Dec  8 08:42 input
> drwsrwsr-x  2 aabp aabp 4096 Dec 12 22:00 output
> drwsrwsr-x  2 aabp aabp 4096 Dec  8 07:57 tests
>
> [aabp <at> polygon test]$ LANG=C ls -l functional/expected/
> total 152
> -rw-rw-r--  1 aabp aabp  2344 Mar 22  2005 latex_docinfo.tex
> -rw-rw-r--  1 aabp aabp 39556 Nov 20 23:52 standalone_rst_latex.tex
(Continue reading)

David Goodger | 15 Dec 2005 00:11
Favicon

Re: Need help parsing rst

[Kent Tenney]
> 2. I want to write code for Leo that imports a reST file.
> 
> I need code which will read reST files and parse it into section
> titles and contents, which will become headlines and
> bodies of Leo nodes.

I think you should be talking to the Leo people.
I don't know anything about Leo.

It would be pretty easy to parse just the section headers.
Just look for lines consisting only of repeated non-alphanumeric
characters, with adjacent text.  The cases you'll have to deal
with are:

"""

Section Title
=============

---------------
 Section Title
---------------

"""

But not:

"""

(Continue reading)


Gmane