Lea Wiemann | 3 Jun 2007 04:32
Picon

Re: code-block directive

Alan G Isaac wrote:

> You can currently ``include`` code fragments,
> which is very useful.  Would this be added
> to a ``code-block`` directive as well?

You mean having a "start-after" and "end-before" option for the
code-block directive?  I'm not quite convinced that adding such options
to directives that have a :file: option is a good idea, even though it's
certainly possible.  It's an interesting use case though!  (It's
probably also necessary to add an option to specify the encoding of the
external file.  In fact, the csv-table directive already has such an
option.  Option proliferation ahead!)

.. code-block::
   :file: module.py
   :start-after: TAG
   :encoding: latin1

Crazy alternative (should be possible in principle though [but may
require some work]) -- nested options:

.. code-block::
   :file: module.py
       :start-after: TAG
       :encoding: latin1

These are just random ideas...  Other suggestions welcome!

// Lea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Gmane