Dave Kuhlman | 29 Sep 19:48

Adding rst2odt/odtwriter to the queue for the next release

I'd like rst2odt/odtwriter to be considered for the the next
release of Docutils.

Currently, when I run rst2odt.py on demo.txt, it successfully runs;
it produces an output file that looks good to me; and it shows me
that rst2odt does not support citations and sidebars.  Are these
required for inclusion?

I suppose that I am asking how we decide whether to include it.  I
suspect that there needs to be some demand for it and that it needs
to pass certain tests.  I believe that David (G.) said that the
ability to process demo.txt without failing was a requirement,
so it has passed that test.

So, is there anything I can do to move this forward or at least
have it considered?

And, by the way, we will have the same questions with rst2pdf, which
I'm also hoping will be included in the Docutils distribution,
soon.

- Dave

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
David Goodger | 1 Oct 06:09
Favicon

Re: Adding rst2odt/odtwriter to the queue for the next release

On Mon, Sep 29, 2008 at 13:52, Dave Kuhlman <dkuhlman <at> pacbell.net> wrote:
> I'd like rst2odt/odtwriter to be considered for the the next
> release of Docutils.

We do have documentation for this, at
http://docutils.sourceforge.net/docs/dev/policies.html#check-ins

> Currently, when I run rst2odt.py on demo.txt, it successfully runs;
> it produces an output file that looks good to me; and it shows me
> that rst2odt does not support citations and sidebars.  Are these
> required for inclusion?

No, it's not required that a writer be finished, just that it be
reasonably complete:

"""
Reasonably complete means that the code must handle all input. Here
"handle" means that no input can cause the code to fail (cause an
exception, or silently and incorrectly produce nothing). "Reasonably
complete" does not mean "finished" (no work left to be done). For
example, a writer must handle every standard element from the Docutils
document model; for unimplemented elements, it must at the very least
warn that "Output for element X is not yet implemented in writer Y".
"""

Of course, completeness ("finished") is a desirable goal. Once a
writer is in the core, that ought to happen.

> I suppose that I am asking how we decide whether to include it.  I
> suspect that there needs to be some demand for it and that it needs
(Continue reading)

Guenter Milde | 1 Oct 13:58

Re: Adding rst2odt/odtwriter to the queue for the next release

David Goodger <goodger <at> python.org> schrieb:

> See
> http://docutils.sourceforge.net/docs/dev/testing.html

I see Python version 2.1 to 2.3 mentioned there. As of docutils 0.5, support
for 2.1 was dropped. Testing with 2.4 and 2.5 seems reasonable nowadays too.
Should I update the doc?

Günter

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Docutils-develop mailing list
Docutils-develop <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-develop

Please use "Reply All" to reply to the list.
David Goodger | 1 Oct 15:36
Favicon

Re: Adding rst2odt/odtwriter to the queue for the next release

On Wed, Oct 1, 2008 at 07:58, Guenter Milde <milde <at> users.berlios.de> wrote:
> David Goodger <goodger <at> python.org> schrieb:
>> See
>> http://docutils.sourceforge.net/docs/dev/testing.html
>
> I see Python version 2.1 to 2.3 mentioned there. As of docutils 0.5, support
> for 2.1 was dropped. Testing with 2.4 and 2.5 seems reasonable nowadays too.
> Should I update the doc?

Yes, please!

--

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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Dave Kuhlman | 2 Oct 02:02

Re: Adding rst2odt/odtwriter to the queue for the next release

David Goodger <goodger <at> python.org> writes:
>
> On Mon, Sep 29, 2008 at 13:52, Dave Kuhlman wrote:
> > I'd like rst2odt/odtwriter to be considered for the the next
> > release of Docutils.
>
> We do have documentation for this, at
> http://docutils.sourceforge.net/docs/dev/policies.html#check-ins

I'll try to follow that guidance on check-ins.

>
> > Currently, when I run rst2odt.py on demo.txt, it successfully runs;
> > it produces an output file that looks good to me; and it shows me
> > that rst2odt does not support citations and sidebars.  Are these
> > required for inclusion?
>
> No, it's not required that a writer be finished, just that it be
> reasonably complete:
>
> """
> Reasonably complete means that the code must handle all input. Here
> "handle" means that no input can cause the code to fail (cause an
> exception, or silently and incorrectly produce nothing). "Reasonably
> complete" does not mean "finished" (no work left to be done). For
> example, a writer must handle every standard element from the Docutils
> document model; for unimplemented elements, it must at the very least
> warn that "Output for element X is not yet implemented in writer Y".
> """
>
(Continue reading)

David Goodger | 2 Oct 16:16
Favicon

Re: Adding rst2odt/odtwriter to the queue for the next release

On Wed, Oct 1, 2008 at 20:02, Dave Kuhlman <dkuhlman <at> rexx.com> wrote:
> David Goodger <goodger <at> python.org> writes:
>>
>> On Mon, Sep 29, 2008 at 13:52, Dave Kuhlman wrote:
>> > I'd like rst2odt/odtwriter to be considered for the the next
>> > release of Docutils.
>>
>> We do have documentation for this, at
>> http://docutils.sourceforge.net/docs/dev/policies.html#check-ins
>
> I'll try to follow that guidance on check-ins.
>
>> > Currently, when I run rst2odt.py on demo.txt, it successfully runs;
>> > it produces an output file that looks good to me; and it shows me
>> > that rst2odt does not support citations and sidebars.  Are these
>> > required for inclusion?
>>
>> No, it's not required that a writer be finished, just that it be
>> reasonably complete:
>>
>> """
>> Reasonably complete means that the code must handle all input. Here
>> "handle" means that no input can cause the code to fail (cause an
>> exception, or silently and incorrectly produce nothing). "Reasonably
>> complete" does not mean "finished" (no work left to be done). For
>> example, a writer must handle every standard element from the Docutils
>> document model; for unimplemented elements, it must at the very least
>> warn that "Output for element X is not yet implemented in writer Y".
>> """
>>
(Continue reading)

Guenter Milde | 7 Oct 14:19

syntax highlighting directive (was: Adding rst2odt/odtwriter to the queue for the next release)

David Goodger <goodger <at> python.org> schrieb:

> A syntax highlighting directive is a common request, and there are
> several implementations out there. Let's work on generalizing the
> directive for all of Docutils (so it works with all writers), and move
> it into the parser code.

May I recall our earlier discussion on this topic (and some new thoughts
after the math-mode directive plans)?

For the full proposal see syntax-highlight_
(Newest version on SVN: syntax-highlight.txt_.)

`code-block` directive proposal
-------------------------------

Syntax
""""""

:Directive Type: "code-block"
:Doctree Element: literal_block
:Directive Arguments: One (`language`) or more (class names), optional.
:Directive Options: None.
:Directive Content: Becomes the body of the literal block.

The "code-block" directive constructs a literal block where the content is
parsed as source code and syntax highlight rules for `language` are
applied. If syntax rules for `language` are not known to docutils, it
is rendered like an ordinary literal block.

(Continue reading)

Mark Nodine | 8 Oct 04:32

Re: syntax highlighting directive

Guenter Milde wrote:
 > David Goodger <goodger <at> python.org> schrieb:
 >
 >> A syntax highlighting directive is a common request, and there are
 >> several implementations out there. Let's work on generalizing the
 >> directive for all of Docutils (so it works with all writers), and move
 >> it into the parser code.
 >
 > May I recall our earlier discussion on this topic (and some new thoughts
 > after the math-mode directive plans)?
 >
 > For the full proposal see syntax-highlight_
 > (Newest version on SVN: syntax-highlight.txt_.)
 >
 >
 > `code-block` directive proposal
 > -------------------------------
 >
 > Syntax
 > """"""
 >
 > :Directive Type: "code-block"
 > :Doctree Element: literal_block
 > :Directive Arguments: One (`language`) or more (class names), optional.
 > :Directive Options: None.
 > :Directive Content: Becomes the body of the literal block.
 >
 > The "code-block" directive constructs a literal block where the 
content is
 > parsed as source code and syntax highlight rules for `language` are
(Continue reading)

Guenter Milde | 8 Oct 11:40

Re: syntax highlighting directive

Mark Nodine <marknodine <at> austin.rr.com> schrieb:
> Guenter Milde wrote:
> > David Goodger <goodger <at> python.org> schrieb:

> >> A syntax highlighting directive is a common request, and there are
> >> several implementations out there. Let's work on generalizing the
> >> directive for all of Docutils (so it works with all writers), and move
> >> it into the parser code.

> Just for your info, the Perl reStructuredText has a syntax highlighting
> directive already, and it has the same name and syntax.

One more argument to get a code-block directive into Docutils: It's a
much wanted feature and unifying the approchaes in the "reStructuredText
reference implementation" would be good.

> Regarding the two levels of markup, it really does both.  Without
> any options, it returns basically a parsed-literal block.  If you
> give it the :color: option, it produces the high-level markup, which
> in the HTML writer at least, sets the span styles according to the
> syntax categories.

This is a misunderstanding: my high-level/low-level distinction was
about the internal representation in the doctree:

  low-level: store content un-parsed  but tag with "code-block" and 
  	     "language" classes. Parse during the writing.

  high-level: parse during the reading, store as "rich" text (tagging
  	      the individual objects like keywords or strings).
(Continue reading)

David Goodger | 8 Oct 16:13
Favicon

Re: syntax highlighting directive

On Wed, Oct 8, 2008 at 05:40, Guenter Milde <milde <at> users.berlios.de> wrote:
> This is a misunderstanding: my high-level/low-level distinction was
> about the internal representation in the doctree:
>
>  low-level: store content un-parsed  but tag with "code-block" and
>             "language" classes. Parse during the writing.
>
>  high-level: parse during the reading, store as "rich" text (tagging
>              the individual objects like keywords or strings).
>              Write similar to a parsed-literal block.

"high-level" is definitely the way to go. Parsing is what parsers do.
Writers should not be doing any parsing.

--

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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Guenter Milde | 8 Oct 17:13

Re: syntax highlighting directive

David Goodger <goodger <at> python.org> schrieb:
> On Wed, Oct 8, 2008 at 05:40, Guenter Milde <milde <at> users.berlios.de> wrote:
>> ... internal representation in the doctree:

>>  low-level: store content un-parsed  but tag with "code-block" and
>>             "language" classes. Parse during the writing.

>>  high-level: parse during the reading, store as "rich" text (tagging
>>              the individual objects like keywords or strings).
>>              Write similar to a parsed-literal block.

> "high-level" is definitely the way to go. 

Why "high-level" for source-code but not for math?
Both are cases of "foreign syntax" inside a reStructuredText document.

> Parsing is what parsers do.

Yes.  But a *reStructuredText* parser should parse *reStructuredText*,
not Python, C, Html, Latex, or other languages.

> Writers should not be doing any parsing.

I agree that writers schould not parse reStructuredText constructs.
But I would define syntax highlight of "foreign" languages as a *layout*
task (even if this can require some parsing of these languages).

In the math directive discussion, it was agreed not to touch the content
of a math directive during the parsing. This save us from defining a
"reStructuredMath" syntax. Layout of math should be left to the writers,
(Continue reading)

David Goodger | 8 Oct 17:57
Favicon

Re: syntax highlighting directive

On Wed, Oct 8, 2008 at 11:13, Guenter Milde <milde <at> users.berlios.de> wrote:
> In the math directive discussion, it was agreed not to touch the content
> of a math directive during the parsing. This save us from defining a
> "reStructuredMath" syntax. Layout of math should be left to the writers,
> as this facilitates the task.

You're mis-remembering or mis-stating the decision.  Please re-read
the math thread to refresh your understanding:
http://thread.gmane.org/gmane.text.docutils.devel/4256/focus=4267

The writers need not and should not know anything about math, or
source code. We agreed on using a Transform to handle math, as
described in the reference above. Source code could be handled the
same way, but it need not be.

> David Goodger <goodger <at> python.org> schrieb:
>> On Wed, Oct 8, 2008 at 05:40, Guenter Milde <milde <at> users.berlios.de> wrote:
>>> ... internal representation in the doctree:
>
>>>  low-level: store content un-parsed  but tag with "code-block" and
>>>             "language" classes. Parse during the writing.
>
>>>  high-level: parse during the reading, store as "rich" text (tagging
>>>              the individual objects like keywords or strings).
>>>              Write similar to a parsed-literal block.
>
>> "high-level" is definitely the way to go.
>
> Why "high-level" for source-code but not for math?
> Both are cases of "foreign syntax" inside a reStructuredText document.
(Continue reading)

Guenter Milde | 9 Oct 14:35

Re: syntax highlighting directive

David Goodger <goodger <at> python.org> schrieb:
> On Wed, Oct 8, 2008 at 11:13, Guenter Milde <milde <at> users.berlios.de> wrote:

>> Layout of math should be left to the writers, as this facilitates the
>> task.

> You're mis-remembering or mis-stating the decision. 
> We agreed on using a Transform to handle math. 

You are right, thanks for the pointer.

...

>> Why "high-level" for source-code but not for math?
>> Both are cases of "foreign syntax" inside a reStructuredText document.

> Source code *can* be fully parsed into a standard Docutils doctree.
> Math cannot.

I see.

...

> And a LaTeX writer should parse Python? That's ridiculous.

Not the LaTeX *writer* should parse Python, latex (the program) should
(and can) parse Python.

* The parallel between math and source-code, is that latex (the
  program) can handle (parse and typeset) both::
(Continue reading)

Stefan Merten | 6 Oct 09:08
Favicon

Re: Adding rst2odt/odtwriter to the queue for the next release


Hi Dave, David and all!

Last week (7 days ago) Dave Kuhlman wrote:
> I'd like rst2odt/odtwriter to be considered for the the next
> release of Docutils.

+1

> I
> suspect that there needs to be some demand for it

Count me in please :-) . I'm using (and patching) rst2odt for some
time now and it's simply great to be able to convert reST to ODT and
via OOo to Word.

						Grüße

						Stefan

Gmane