On 2013-08-23, Patryk Małek wrote:

> [-- Type: text/plain, Encoding: quoted-printable --]

> I would like to indent the whole *.. code-block::* . Can anyone suggest me 
> how can I do this ? 

> The problem is that I have an unnumbered list with code snippets, I can do 
> something like : 

> *    a) ``<simulators><xxx><sub_tag>`` : such sub tags are placed in top 
> level in all *INI* files for all simulators;  eg.: if you have the 
> following::*
> *
> *
> *        <?xml version="1.0" encoding="UTF-8"?>*
> *        <simulators>*
> *              …*
> *        </simulators>*

> where I will get the correct indentation but then I will get an error 

> *ERROR: Unexpected indentation.*

> Therefore I would like to use code-block and use xml syntax highlighting.

(If the indentation and leading "*"s are the same in your source, this is no
wonder. So let us assume this is mangled by some group/mail/news software.)

However, with

a) ``<simulators><xxx><sub_tag>``: such sub tags are placed in top level
   in all *INI* files for all simulators, eg., if you have the following:
   
   .. code:: xml

      <?xml version="1.0" encoding="UTF-8"?>
      <simulators>
      …
      </simulators>

there should be no problem.

* indent the directive tagline with the same amount as the preceding paragraph
  (in this case the content of the ordered list).
  
* indent the content relative to the tagline.
  The first content line's indent marks the left margin of the content
  block, i.e.
  
   .. code:: xml

       <?xml version="1.0" encoding="UTF-8"?>
      <simulators>
  
  will fail.
  
* the `"code" directive`__ is part of Docutils while "code-block" is a Sphinx
  extension. Use whatever works better in your project.
  
  __ http://docutils.sourceforge.net/docs/ref/rst/directives.html#code

  
Günter  
  

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to