[Grok-dev] Text doesn't wrap on website

Uli Fouquet uli at gnufix.de
Thu Jan 17 18:00:41 EST 2008


Hi Sebastian,

first of all: thanks for using restructured text, that's great! And fine
to have another document in our collection :-)

Sebastian Ware wrote:
> Apart from the font size being a tad on the large side. I wonder why  
> the lines don't soft wrap. I mean, I have widescreen on my laptop, but  
> not that wide a screen...

I think, this was solved, right? The very long line with the
`proxy_pass` directive cannot easily be shortened and it is correct to
render it as (unwrapped) raw text.

>  Also, I don't know how to add linenumbers to  
> the code block in reST

Linenumbers are currently disabled on the grok site (my fault).

Kevin, if you kindly could do an 'svn up' for the rest-extensions/
directory in ``gzo.plonepolicy`` (and eventually restart the instance),
this would enable linenumber support.

Some hints for docwriters:

To add linenumbers in your restructured text documents, you have to do
two things:

 1) Format the appropriate text block as ``code-block``. Plain raw 
    blocks are not linenumbered, because this is a `pygments` extension 
    and only real ``code-blocks`` are handled by it.

 2) Add the option `:linenos:`.

Example:

.. code-block:: python
   :linenos:

   class Cave(object):
       pass

The linenumbering starts with one (not zero). I currently have no clue,
how to pass different linenumbers to start with.

If you want to have other types of text rendered than Python snippets,
then you have to give different code type as argument (above it's
`python`, the word after `::`). Some other supported types are: `c`,
`pycon` (for console sessions, the stuff with `>>>`), `sh` (for shell
scripts) and dozens other more. If your codetypes' syntax is not
natively supported (this is true for nginx configs, unfortunately), then
you can simply use `text`::

.. code-block:: text
   :linenos:

   http {
      other text with unknow syntax;
   }

I explained all that in more detail on

	https://svn.gnufix.de/repos/rest-extensions/trunk/USAGE.txt

which was updated a few minutes ago.

Please note, that on the site you can use the `:linenos:` option
immediately, but they will stay invisible, until someone had the time to
update the instance on the server.

>  or reduce the generous line spacing.

This is CSS driven (in a `gzo.plonesmashtheme` stylesheet). I think it's
currently 1.5em which looks really very 'spacy' to me too, but I am not
a web-designer, but, well, I could cope very well with a less generous
line spacing. ;-)

Sorry, Sebastian, for messing around with your text. You might have a
look at the line numbers as soon as they appear. Currently, the source
lines and description line numbers do not match, I think. Anyway, it's
really nice to have an nginx-howto!

Kind regards,

-- 
Uli




More information about the Grok-dev mailing list