Perhaps just identify and rectify the indentation/tabbing errors in the preprocessing by using python string split to first split the reST string source into lines  and then using python string replace to correct mistabbing.

Don't know of a publish method option for this but would be great if one existed.  Sort of need a reST source string "lint"


PS Ditto to being occasionally vexed by the seeming need for precise and consistent indentation in reST source for error free publishing .  Emacs handles this for me but like you will have to implement checking/rectification for documents prepared for others

On Wed, May 22, 2013 at 9:17 AM, Peter L. Soendergaard <> wrote:

I am running docutils.core.publish_string inside some python scripts and
I need to process a lot of REST files from other people, and they often
contains errors. I need to do some preprocessing to the files before
passing them onto docutils, so that is why I call publish_string from
inside of Python instead of the command line tools.

Currently, I just see errors and warnings on the command line like:

<string>:73: (ERROR/3) Unexpected indentation.
<string>:74: (WARNING/2) Block quote ends without a blank line;
unexpected unindent.

Are there some parameters that I can pass onto publish_string so that I
can capture the error output instead of it going straight to stderr?

Or some better method than calling publish_string ?


Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt!
Docutils-users mailing list

Please use "Reply All" to reply to the list.

Michael G. Prisant