1

I am new to Sphinx and can't figure out how to solve this formatting issue. Currently, the Sphinx generated HTML output looks like this:

formatting_problem

The long module and function names lead to the blue text boxes ending up outside the white space. Similarly, in the left sidebar, the long function names are not fully visible. Is there a way to to automatically wrap/line-break the function names?

The .rst files are created with sphinx-apidoc, which produces relevant code blocks like this one:

.. automodule:: monai_inference_from_nnunet_folder.custom_transforms.custom_transforms_array
   :members:
   :undoc-members:
   :show-inheritance:

The image above shows the read-the-docs theme "sphinx-rtd-theme". I tried different themes, the default "alabaster" theme works better in the sidebar, where it breaks the long function names into multiple lines:

alabaster theme sidebar

But on the main page, the same problem occurs:

alabaster theme main page

mzjn
  • 48,958
  • 13
  • 128
  • 248
aaronkawa
  • 11
  • 1
  • 1
    You should tune the CSS styles of the sphinx theme you use (or simply switch to a better theme), not the HTML generated. Don't choose the wrong way and waste your time. – Lex Li Dec 15 '22 at 17:26

0 Answers0