Tim Daneliuk | 13 Jan 2010 22:15
Favicon
Gravatar

rst -> txt | man

I want to (finally!) quit editing troff files when creating new man
pages.  Restructured Text is perfect for my needs BUT, I need a way to
either generate a plain text file (i.e., no markup at all) or generate
a .1 file in troff format that I an then use as before.

Ideas?
--

-- 
----------------------------------------------------------------------------
Tim Daneliuk     tundra <at> tundraware.com
PGP Key:         http://www.tundraware.com/PGP/

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
Ben Finney | 14 Jan 2010 02:15
Picon

Re: rst -> txt | man

Tim Daneliuk <tundra <at> tundraware.com> writes:

> I need a way to either generate a plain text file (i.e., no markup at
> all)

This is a long-standing request, and I'd love to see someone (with more
disposable programming time than I) to tackle it.

Although I can't find a bug report for this feature request at
<URL:http://sourceforge.net/tracker/?group_id=38414>.

> or generate a .1 file in troff format that I an then use as before.

Docutils 0.6 includes the ‘manpage’ writer, and a ‘rst2man’ program to
use it.

--

-- 
 \        “With Lisp or Forth, a master programmer has unlimited power |
  `\     and expressiveness. With Python, even a regular guy can reach |
_o__)                               for the stars.” —Raymond Hettinger |
Ben Finney

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Docutils-users mailing list
(Continue reading)

Roberto Alsina | 14 Jan 2010 03:03
Picon
Gravatar

Re: rst -> txt | man

On Wednesday 13 January 2010 22:15:27 Ben Finney wrote:
> Tim Daneliuk <tundra <at> tundraware.com> writes:
> > I need a way to either generate a plain text file (i.e., no markup at
> > all) 
> > or generate a .1 file in troff format that I an then use as before.
> 
> Docutils 0.6 includes the ‘manpage’ writer, and a ‘rst2man’ program to
> use it.

If you can live with a *very* plain text file, rst2man plus redirecting man to 
a file (or running troff the right way, which I won't bother figuring out) 
should do the trick.

A probably better result is using rst2html and links.

--

-- 
 ("\''/").__..-''"`-. .         Roberto Alsina
 `9_ 9  )   `-. (    ).`-._.`)  KDE Developer (MFCH)
 (_Y_.)' ._   ) `._`.  " -.-'  http://lateral.netmanagers.com.ar 
  _..`-'_..-_/ /-'_.'     The 6,855th most popular site of Slovenia   
(l)-'' ((i).' ((!.'       according to alexa.com (27/5/2007) 

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Docutils-users mailing list
(Continue reading)

Tim Daneliuk | 14 Jan 2010 20:11
Favicon
Gravatar

Strange docutils/latex Formatting

I have the following markup that is giving me fits:

NAME
----

**command** - Advanced Somethingorother

SYNOPSIS
--------

To do X::

  command.py [-hqtv] oldstring newstring filelist

To do Y::

  command.py -d [-hipqstv] filelist

This renders properly as html.  However, when I go to latex, the dvi
(and thus the pdf) file renders the string "To do Y" indented right
rather than aligned under "To do X".  The two "command.py" statements
are properly indented and aligned with each other.

Ideas?  TIA...

----------------------------------------------------------------------------
Tim Daneliuk     tundra <at> tundraware.com
PGP Key:         http://www.tundraware.com/PGP/

------------------------------------------------------------------------------
(Continue reading)

Alan G Isaac | 14 Jan 2010 20:18
Picon
Favicon

Re: Strange docutils/latex Formatting

On 1/14/2010 2:11 PM, Tim Daneliuk wrote:
> This renders properly as html.  However, when I go to latex, the dvi
> (and thus the pdf) file renders the string "To do Y" indented right
> rather than aligned under "To do X".  The two "command.py" statements
> are properly indented and aligned with each other.

This is because you are using a LaTeX style that does not
indent the first paragraph of a section but does indent
all other paragraphs.

One work around might be to use definition lists.
E.g.,

To do X:
   ``command.py [-hqtv] oldstring newstring filelist``
To do Y:
   ``command.py -d [-hipqstv] filelist``

fwiw,
Alan Isaac

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
Leo | 14 Jan 2010 20:46

Re: rst -> txt | man

Hi Tim,

a few months ago I started a project named Transcribo. It can generate
formatted plain text from a reasonable subset of RST while remaining
open to other input formats. It is still in alpha stage and I have
little time to work on it right now. But I already use it for various
productive tasks. If you want to have a look, visit
http://pypi.python.org/pypi/Transcribo/0.5.2

Leo

On 13/01/2010, Tim Daneliuk <tundra <at> tundraware.com> wrote:
> I want to (finally!) quit editing troff files when creating new man
> pages.  Restructured Text is perfect for my needs BUT, I need a way to
> either generate a plain text file (i.e., no markup at all) or generate
> a .1 file in troff format that I an then use as before.
>
> Ideas?
> --
> ----------------------------------------------------------------------------
> Tim Daneliuk     tundra <at> tundraware.com
> PGP Key:         http://www.tundraware.com/PGP/
>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
(Continue reading)

Tim Daneliuk | 14 Jan 2010 22:56
Favicon
Gravatar

Question About Option Lists

I am trying to write a unix-style manage.  In the Options section, I have
something like:

   -a    do a
   -b    do b
   -c string1=string2     something
   -d    do d

Since standard getopt processing only sees one argument after a
command line switch I'm trying to come up with a way to pass it two
args and then split it in the running program. Hence the s=s construct
on the command line.

In every case, RST complains about exiting the options list without a
blank line and encountering an unexpected outdent.  I have tried all manner
of escaping, using a delimiter other than = and even something like
\/string1\/string2/ (how very sed of me ;) to do this but I consistently
get the same problem.

What am I missing here?
--

-- 
----------------------------------------------------------------------------
Tim Daneliuk     tundra <at> tundraware.com
PGP Key:         http://www.tundraware.com/PGP/

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
(Continue reading)

Guenter Milde | 14 Jan 2010 23:37
Picon

Re: rst -> txt | man

On 2010-01-13, Tim Daneliuk wrote:
> I want to (finally!) quit editing troff files when creating new man
> pages.  Restructured Text is perfect for my needs BUT, I need a way to
> either generate a plain text file (i.e., no markup at all) or generate
> a .1 file in troff format that I an then use as before.

> Ideas?

The manpage writer (frontend rst2man.py) does write a troff man file.
It's in Docutils since version 0.6.

Günter

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Docutils-users mailing list
Docutils-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
Guenter Milde | 14 Jan 2010 23:42
Picon

Re: Strange docutils/latex Formatting

On 2010-01-14, Tim Daneliuk wrote:
> I have the following markup that is giving me fits:

> NAME
> ----

> **command** - Advanced Somethingorother

> SYNOPSIS
> --------

> To do X::

>   command.py [-hqtv] oldstring newstring filelist

> To do Y::

>   command.py -d [-hipqstv] filelist

> This renders properly as html.  However, when I go to latex, the dvi
> (and thus the pdf) file renders the string "To do Y" indented right
> rather than aligned under "To do X".  The two "command.py" statements
> are properly indented and aligned with each other.

> Ideas?  TIA...

If you want a rendering as in HTML, call rst2latex with
``--stylesheet=parskip``.

See http://docutils.sourceforge.net/docs/user/latex.html
(Continue reading)

Tim Daneliuk | 14 Jan 2010 23:47
Favicon
Gravatar

Re: Strange docutils/latex Formatting

On 1/14/2010 4:42 PM, Guenter Milde wrote:
> On 2010-01-14, Tim Daneliuk wrote:
>> I have the following markup that is giving me fits:
> 
> 
>> NAME
>> ----
> 
>> **command** - Advanced Somethingorother
> 
>> SYNOPSIS
>> --------
> 
>> To do X::
> 
>>   command.py [-hqtv] oldstring newstring filelist
> 
>> To do Y::
> 
>>   command.py -d [-hipqstv] filelist
> 
>> This renders properly as html.  However, when I go to latex, the dvi
>> (and thus the pdf) file renders the string "To do Y" indented right
>> rather than aligned under "To do X".  The two "command.py" statements
>> are properly indented and aligned with each other.
> 
>> Ideas?  TIA...
> 
> If you want a rendering as in HTML, call rst2latex with
> ``--stylesheet=parskip``.
(Continue reading)


Gmane