On 2009-11-09, Zilupe wrote:

>> >> There are Java code snippets in my documentation. I indent code with
>> >> tabs (not spaces). When I generate HTML output, it setstabwidth to 8
>> >> characters which is annoying to me (i like 4). How do I change this
>> >> value?

> It seems like tabs have been replaced with spaces somewhere earlier in
> the chain.

Yes, Docutils replaces tabs with spaces by default.
There is a Docutils config setting:

 `tab_width`
    Number of spaces for hard tab expansion.

    Default: 8.  Options: ``--tab-width``.

but I don't know how this can be specified in Sphinx.

If you have the code snippets in code-blocks or literal blocks, tab
replacement is mandatory. If you include them from a file, there is the
"tab-width" option. In the SVN repository version, it allows to keep tabs:

  ``tab-width`` :  integer
      Number of spaces for hard tab expansion.
      A negative value prevents expansion of hard tabs. Defaults to the
      tab_width_ configuration setting.

IMO, it would make sense to implement a similar option to the code-block
directive in Sphinx.

Günter


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to