Overriding the default field name limit in sphinx/docutils

前端 未结 3 1583
别跟我提以往
别跟我提以往 2021-02-05 22:26

I am using sphinx for generating html documentation for a project. I make extensive use of field lists.

When generating html, each label/value pair is rendered as a sing

相关标签:
3条回答
  • 2021-02-05 23:03

    Sphinx-1.2 will support docutils.conf for html writer if no objection. https://bitbucket.org/birkenfeld/sphinx/commits/67682aca

    0 讨论(0)
  • 2021-02-05 23:10

    I think your approach doesn't work because sphinx uses its own html writer.

    However I think it should work, if you adapt the style for field_name. I (once) used a custom css file with

    .field-name {
        white-space: nowrap;
    }
    

    or set it to a fixed width.

    0 讨论(0)
  • 2021-02-05 23:17

    One way to do this is to override the setting in custom sphinx builder class extending original html builder, and set self.settings.field_name_limit = 0 in prepare_writing(self, docnames) function. That said, this is a little overkill, unless you already have a custom builder class ...

    0 讨论(0)
提交回复
热议问题