Rongits Gábor | 3 Jan 2007 16:35
Picon

paragraphs for poems

Hi!

I am Gabor, and my question is as follows: it is very useful to have a 
blank line between paragraphs, but what if I want to edit a poem in a 
way that each line is in a separate row, but there is no space between 
the single rows (this is the case when I use a blank line), practically 
the whole poem is one paragraph. So I would need an <enter> in the 
paragraph. How I can do it?

best regards
Gábor

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
David Goodger | 3 Jan 2007 17:09
Favicon

Re: paragraphs for poems

On 1/3/07, Rongits Gábor <dtp <at> madalbal.hu> wrote:
> I am Gabor, and my question is as follows: it is very useful to have a
> blank line between paragraphs, but what if I want to edit a poem in a
> way that each line is in a separate row, but there is no space between
> the single rows (this is the case when I use a blank line), practically
> the whole poem is one paragraph. So I would need an <enter> in the
> paragraph. How I can do it?

Line blocks:

    | A one, two, a one two three four
    |
    | Half a bee, philosophically,
    |     must, *ipso facto*, half not be.
    | But half the bee has got to be,
    |     *vis a vis* its entity.  D'you see?
    |
    | But can a bee be said to be
    |     or not to be an entire bee,
    |         when half the bee is not a bee,
    |             due to some ancient injury?
    |
    | Singing...

See http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#line-blocks

--

-- 
David Goodger <http://python.net/~goodger>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
(Continue reading)

grubert | 3 Jan 2007 17:51
Picon
Gravatar

Re: paragraphs for poems

john tyan requested verses short before xmas

attached is the current state, i committed it to a sandbox verse-writer
but this might take some time to get onto the web.

cheers

On Wed, 3 Jan 2007, Rongits Gábor wrote:

> Hi!
>
> I am Gabor, and my question is as follows: it is very useful to have a
> blank line between paragraphs, but what if I want to edit a poem in a
> way that each line is in a separate row, but there is no space between
> the single rows (this is the case when I use a blank line), practically
> the whole poem is one paragraph. So I would need an <enter> in the
> paragraph. How I can do it?
>
> best regards
> Gábor

-- 
Attachment (rst2verse.py): text/x-python, 3284 bytes
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
(Continue reading)

john.tynan | 3 Jan 2007 22:33
Picon

Re: Docutils Writer with the LaTeX Verse

Paul,

Thanks for the info.  Please excuse the delay in my reply.

I understand the process that you outlined.  Thanks for describiing it in 
much clearer terms.

I am choosing to go a different route with this project (which I will 
explain later).

However, to do xslt on windows (since we are already using python), simply 
use a script like:

http://svn.vintagespies.com/poems/scripts/libxml/xml2latex.py

and and xsl file of your choice.  Such as:

http://svn.vintagespies.com/poems/scripts/libxml/xml2latex.xsl

the libxml2 and libxslt bindings for windows can be found here:

http://users.skynet.be/sbi/libxml-python/

the libxml2 and libxslt executables and instructions for installing on 
Windows can be found here:

http://www.zlatkovic.com/libxml.en.html

Best regards,

(Continue reading)

john.tynan | 3 Jan 2007 22:55
Picon

Re: paragraphs for poems

Gabor,

Tell me, wouldn't you use some kind of writer to control the formatting?  If 
the poem is one long stanza, wouldn't the idea be to write it in ReST as one 
stanza (or paragraph).

Then, if you were to take the restructured text and transform it to HTML 
(for instance), wouldn't  you use a stylesheet to introduce whitespace 
between lines?

If you did want a blank line between each line (and if you were going to 
LaTeX), you might edit line 104 of Engelbert Gruber's original file (sent 
earlier), or the one I'm working on here:

http://svn.vintagespies.com/poems/scripts/docutils/rst2verse.py

And change this to have two backslashes and an exclamation point:

    def depart_line(self, node):
        self.body.append(' \\\\!\n')

In LaTeX, this would give you a blank space between each line.

On 1/3/07, Rongits G?bor <dtp <at> madalbal.hu> wrote:
> I am Gabor, and my question is as follows: it is very useful to have a
> blank line between paragraphs, but what if I want to edit a poem in a
> way that each line is in a separate row, but there is no space between
> the single rows (this is the case when I use a blank line), practically
> the whole poem is one paragraph. So I would need an <enter> in the
> paragraph. How I can do it?
(Continue reading)

john.tynan | 3 Jan 2007 23:10
Picon

Re: Docutils Writer with the LaTeX Verse Environment

Engelbert,

Thanks for writing this version of rst2verse, that I have started testing 
here:

http://svn.vintagespies.com/poems/scripts/docutils/rst2verse.py

As promised, I will create a sample target file outlining all the available 
options that a poem can have in latex.  I will also create a corresponding 
sample source file in ReST format.  I hope to have this to you later this 
week.

I do not want to support all of the options that the verse environment 
contains, just a minimal set so as not to mess with the simplicity of the 
initial text file, and for making sure the initial text file is written 
purely in valid ReST.

There is one small, initial change which would go a long way toward making 
this immediately useful.  I found, in looking at the documentation for the 
verse environment, that the last line of each stanza either has (either a 
blank line - not optimal), or two forward slashes and an exclamation point 
(preferred).  If this could be incorporated into the next revision, that 
would be great.

Thanks for your help with this!

John T.

> From: grubert <at> users.sourceforge.net
> john tyan requested verses short before xmas
(Continue reading)

grubert | 4 Jan 2007 12:06
Picon
Gravatar

Re: Docutils Writer with the LaTeX Verse Environment

On Wed, 3 Jan 2007, john.tynan <at> riomail.maricopa.edu wrote:

> There is one small, initial change which would go a long way toward making
> this immediately useful.  I found, in looking at the documentation for the
> verse environment, that the last line of each stanza either has (either a
> blank line - not optimal), or two forward slashes and an exclamation point
> (preferred).  If this could be incorporated into the next revision, that
> would be great.

you mean ::

   hiho hiho
   bla bla

   thanks for the fish

should become ::

   hiho hiho \\
   bla bla \\!
   thanks for the fish \\

that means dont print the blank line but the "!" or both.

although the final target might be to put options into the latex-writer
for now there is http://docutils.sourceforge.net/sandbox/verse-writer/
and svn.

cheers
--

-- 
(Continue reading)

Fernando Perez | 7 Jan 2007 00:10
Picon
Gravatar

Non-indented literal blocks?

Hi all,

I'm new to the list and relatively new to reST, but I've tried to do my
homework with the archives.  It seems to me that the /only/ way to have a
literal block in reST is the '::' directive along with indenting the
literal block below, with de-indentation indicating the end of the literal.

Is this correct?  While this mode is fine for many uses, I'm finding it
rather annoying for keeping things like long source code examples, snippets
of configuration files, and similar materials, inside reST files.  The
problem is that it forces me to indent the snippet always when pasting it
in the reST file, and then manually dedent it back when using it elsewhere
(if I'm pasting from the plaintext reST sources).

The second part is the real killer: while indenting the code when going in
is not hard (as long as I have Emacs around), it's really annoying not to
be able to use that code as-is for pasting elsewhere.  If I need to paste
it into an email editor, or I'm logged into a box without a good editor,
etc, having this pre-indented input is a real problem.

It seems to me that it would be very useful to have some alternative way of
indicating a literal block, much like Trac uses (using whatever syntax made
sense for reST):

{{{
literal block..
}}}

This type of matched begin/end syntax allows two-way copy/paste usage
without the problems I described above.
(Continue reading)

David Goodger | 7 Jan 2007 01:25
Favicon

Re: Non-indented literal blocks?

[Fernando Perez]
> I'm new to the list and relatively new to reST, but I've tried to do my
> homework with the archives.  It seems to me that the /only/ way to have a
> literal block in reST is the '::' directive along with indenting the
> literal block below, with de-indentation indicating the end of the literal.

No, there is an alternative, quoted literal blocks:

"""
Example::

> literal
> block
> here
"""

It probably doesn't help your use case though.  See
http://docutils.sf.net/docs/ref/rst/restructuredtext.html#quoted-literal-blocks

> The second part is the real killer: while indenting the code when going in
> is not hard (as long as I have Emacs around), it's really annoying not to
> be able to use that code as-is for pasting elsewhere.

Why not unindent when you copy, since you have Emacs around?  When you paste it,
why not unindent then?  Any decent editor should be able to do the unindent.

> It seems to me that it would be very useful to have some alternative way of
> indicating a literal block, much like Trac uses (using whatever syntax made
> sense for reST):
>
(Continue reading)

Fernando Perez | 7 Jan 2007 01:56
Picon
Gravatar

Re: Non-indented literal blocks?

David Goodger wrote:

> [Fernando Perez]
>> I'm new to the list and relatively new to reST, but I've tried to do my
>> homework with the archives.  It seems to me that the /only/ way to have a
>> literal block in reST is the '::' directive along with indenting the
>> literal block below, with de-indentation indicating the end of the
>> literal.
> 
> No, there is an alternative, quoted literal blocks:

Ah, yes, thanks.  I'd forgotten about those.

>> The second part is the real killer: while indenting the code when going
>> in is not hard (as long as I have Emacs around), it's really annoying not
>> to be able to use that code as-is for pasting elsewhere.
> 
> Why not unindent when you copy, since you have Emacs around?  When you
> paste it,
> why not unindent then?  Any decent editor should be able to do the
> unindent.

Well, there was this in my message:

'''If I need to paste it into an email editor, or I'm logged into a box
without a good editor, etc, having this pre-indented input is a real
problem.'''

As it turns out, there are plenty of editors out there that royally suck at
managing rigid indentation.  Yes, with Emacs I can get by just fine, but
(Continue reading)


Gmane