Sphinx + autodoc + apidoc

Dan Stromberg drsalists at gmail.com
Mon Oct 24 19:01:52 EDT 2016


On Mon, Oct 24, 2016 at 2:39 PM, Ned Batchelder <ned at nedbatchelder.com> wrote:
> On Monday, October 24, 2016 at 5:00:47 PM UTC-4, Dan Stromberg wrote:

>> However, we aren't really a PEP8 shop; we use hard tabs expanded to 4
>> columns, and we use 120 columns total width (and sometimes a little
>> more :).

>> Is there any good way of making Sphinx use 4 column tabs and 120 column text?

> Are you sure your tabs are being changed to eight spaces? It's possible they
> are still tabs in the browser, and the browser is choosing to display them
> as eight spaces. If that's the case, you can change the width using CSS in
> the theme.  Likely the page width of 80 characters is also manipulable with
> CSS.

It turned out CSS was the answer.  I fixed it with:

    echo 'pre {tab-size: 4;width: 80em;}' > doc/_build/html/_static/custom.css
    echo 'div.document {width: 100em; margin-top: 0px; margin-bottom:
0px; margin-right: 0px; margin-left: 0px;}' >>
doc/_build/html/_static/custom.css

Though it remains to be seen if it'll look as good in other people's
browsers.  It bothers me that 120 columns of text fit so easily into
80em.  I thought 80em would be the width of 80 character cells...  It
seems like a fixed pitch font, but maybe it's really proportionate.
Using 120em was huge.

Thanks!



More information about the Python-list mailing list