1 Dec 09:48 2010

### Re: Modify rst source on parsing

On Tue, Nov 30, 2010 at 22:19, Aahz wrote:
> So my question is: Is it possible to extend docutils so that it modifies the
> rst source after some processing? i.e. replace :todo:fix the app > tino <
> tomorrow with :todo_id:6?

You can do it, but it's outside the bounds of what docutils supports.
Custom code can do anything.    The hard part will be finding the
point in the document to update; IIRC there's experimental parse tree to
reST code.

Off course. As I understand it now, the biggest hurdle is the parse tree-to-rst writer. Do you recall where you saw this code? The closest thing I could find was pyth: https://github.com/brendonh/pyth/

Tino
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five$500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five$500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
6 Dec 02:58 2010

### Re: Modify rst source on parsing

On Wed, Dec 01, 2010, TiNo wrote:
> On Tue, Nov 30, 2010 at 22:19, Aahz <aahz <at> pythoncraft.com> wrote:
>
>>> So my question is: Is it possible to extend docutils so that it modifies the
>>> rst source after some processing? i.e. replace :todo:fix the app > tino
>> <
>>> tomorrow with :todo_id:6?
>>
>> You can do it, but it's outside the bounds of what docutils supports.
>> Custom code can do anything.    The hard part will be finding the
>> point in the document to update; IIRC there's experimental parse tree to
>> reST code.
>
> Off course. As I understand it now, the biggest hurdle is the parse
> tree-to-rst writer. Do you recall where you saw this code? The closest thing
> I could find was pyth: https://github.com/brendonh/pyth/

implement this as a pre-processing step -- use some special tag combined
with an external database to change e.g.

$$fix the app$$

to

:todo_id:6
--

--
Aahz (aahz <at> pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Think of it as evolution in action."  --Tony Rand

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d

6 Dec 08:24 2010

### Re: Modify rst source on parsing

On 2010-12-06, Aahz wrote:
> On Wed, Dec 01, 2010, TiNo wrote:
>> On Tue, Nov 30, 2010 at 22:19, Aahz <aahz <at> pythoncraft.com> wrote:

>>>> So my question is: Is it possible to extend docutils so that it
>>>> modifies the rst source after some processing?

>>> You can do it, but it's outside the bounds of what docutils supports.
>>> Custom code can do anything.   The hard part will be finding the
>>> point in the document to update; IIRC there's experimental parse tree
>>> to reST code.

>> Off course. As I understand it now, the biggest hurdle is the parse
>> tree-to-rst writer. Do you recall where you saw this code? The closest
>> thing I could find was pyth: https://github.com/brendonh/pyth/

There is a "lossless-rst-writer" branch in the Docutils SVN
repository, created 23 Feb 2008.

Günter

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
_______________________________________________
Docutils-users mailing list
Docutils-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users


8 Dec 07:21 2010

Hello,

I'm using the API of docutils to generate HTML documentation from strings of ReST text, using docutils.core.publish_doctree and then docutils.core.publish_from_doctree.
One problem I ran into is redirection of docutils warnings/errors which go to stderr. Can I somehow access the Reporter object in the document and tell it to redirect the output to some StringIO?

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
8 Dec 15:40 2010

On Wed, Dec 8, 2010 at 01:21, Eli Bendersky <eliben <at> gmail.com> wrote:
> I'm using the API of docutils to generate HTML documentation from strings of
> ReST text, using docutils.core.publish_doctree and then
> docutils.core.publish_from_doctree.
> One problem I ran into is redirection of docutils warnings/errors which go
> to stderr. Can I somehow access the Reporter object in the document and tell
> it to redirect the output to some StringIO?

Yes, use the warning_stream setting.  See the docstring for
docutils.utils.Reporter.__init__, "stream" parameter.

--

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

------------------------------------------------------------------------------
What happens now with your Lotus Notes apps - do you make another costly
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d

11 Dec 22:05 2010

### Is it possible to get docinfo?

Hi,

I'm writing my blog application based on reST and docutils. Each blog
post is a single reST file. Each file has some meta information that is
called docinfo in docutils or elements in documentation:

http://docutils.sourceforge.net/docs/ref/doctree.html#element-reference

Is it possible some how to get those elements using docutils api?

Currently I need at least author and date elements from reST files.

--
Mantas aka sirex
__o                                   /\
_ \<,_   -- launchpad.net/~sirex --  /\/  \
___(_)/_(_)_____________________________/_/    \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
11 Dec 22:18 2010

### Document title, section numbering, page numbering in LaTeX


Hello,

trying to get a nice title for the document. But it is included in the table
of contents. I've tried using the 'local' flag but not with much success.

Also, using sectnum directive a number is inserted for every title, including
the document title.

I'm trying to get a title page without numbering it, or it showing up
in the TOC. I suppose could write some raw LaTeX, but I'm thinking
about the contents and sectnum directives. How about something like a
'start-depth' option for the latter?

And the contents directive; with --use-docutils-toc and the local flag I get a
better fit, but that has no page numbering. Otherwise I cant seem to do much
with 'local'. I get an unsupported warning (see below) in contrast with what
the text at [1] says.

This needs to be fit for print. Seems I need a hand titlepage only I'm new to
LaTex. I'm getting some progress with these [2] nice examples. But now the page
itself gets numbered. Perhaps I need to write a template for the writer?

Any suggestions?

regards, Berend

[1] http://docutils.sourceforge.net/docs/user/latex.html#table-of-contents
[2] http://zoonek.free.fr/LaTeX/LaTeX_samples_title/0.html

----

main.rst.src:15: (WARNING/2) Skipping local ToC at subparagraph level.
Feature not supported with option "use-latex-toc"

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev

11 Dec 22:30 2010

### Re: Is it possible to get docinfo?


Hi,

You need to set up a publisher with a null writer and some special transforms
that pick the data from the tree.
I'm currently blank on the details, but Nabu [1] does this using
Extractors/Storage pairs.
And there's my own project [2] that includes extractors that allow use of
RSt documents as forms, but those specific parts are lacking documentation I
think.

-- Berend

[1] http://furius.ca/nabu

On Sat, Dec 11, 2010 at 11:05:32PM +0200, Mantas wrote:
> Hi,
>
> I'm writing my blog application based on reST and docutils. Each blog
> post is a single reST file. Each file has some meta information that is
> called docinfo in docutils or elements in documentation:
>
>   http://docutils.sourceforge.net/docs/ref/doctree.html#element-reference
>
> Is it possible some how to get those elements using docutils api?
>
> Currently I need at least author and date elements from reST files.
>
>
> --
>                  Mantas aka sirex
>       __o                                   /\
>     _ \<,_   -- launchpad.net/~sirex --  /\/  \
> ___(_)/_(_)_____________________________/_/    \
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev

11 Dec 23:51 2010

### Re: Is it possible to get docinfo?

On Sat, Dec 11, 2010 at 16:05, Mantas <sirexas <at> gmail.com> wrote:
> I'm writing my blog application based on reST and docutils. Each blog
> post is a single reST file. Each file has some meta information that is
> called docinfo in docutils or elements in documentation:
>
>  http://docutils.sourceforge.net/docs/ref/doctree.html#element-reference

You seem to be confused on the terminology. "docinfo" is the name of
an element in the document tree (doctree).

> Is it possible some how to get those elements using docutils api?

Use the publish_doctree function, then traverse the tree.
http://docutils.sourceforge.net/docs/api/publisher.html

--

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

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev
_______________________________________________
Docutils-users mailing list
Docutils-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users


11 Dec 23:53 2010

### Re: Document title, section numbering, page numbering in LaTeX

Someone else will have to help with the LaTeX-specific stuff, but this
may help with the title question:
http://docutils.sourceforge.net/FAQ.html#how-can-i-indicate-the-document-title-subtitle

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

On Sat, Dec 11, 2010 at 16:18, Berend van Berkum <lists <at> dotmpe.com> wrote:
>
> Hello,
>
>
> trying to get a nice title for the document. But it is included in the table
> of contents. I've tried using the 'local' flag but not with much success.
>
> Also, using sectnum directive a number is inserted for every title, including
> the document title.
>
> I'm trying to get a title page without numbering it, or it showing up
> in the TOC. I suppose could write some raw LaTeX, but I'm thinking
> about the contents and sectnum directives. How about something like a
> 'start-depth' option for the latter?
>
> And the contents directive; with --use-docutils-toc and the local flag I get a
> better fit, but that has no page numbering. Otherwise I cant seem to do much
> with 'local'. I get an unsupported warning (see below) in contrast with what
> the text at [1] says.
>
> This needs to be fit for print. Seems I need a hand titlepage only I'm new to
> LaTex. I'm getting some progress with these [2] nice examples. But now the page
> itself gets numbered. Perhaps I need to write a template for the writer?
>
> Any suggestions?
>
>
> regards, Berend
>
>
>
> [1] http://docutils.sourceforge.net/docs/user/latex.html#table-of-contents
> [2] http://zoonek.free.fr/LaTeX/LaTeX_samples_title/0.html
>
> ----
>
> main.rst.src:15: (WARNING/2) Skipping local ToC at subparagraph level.
>  Feature not supported with option "use-latex-toc"

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages,
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev
_______________________________________________
Docutils-users mailing list
Docutils-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users