Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing spaces inside dt's #694

Closed
joshkel opened this issue Oct 31, 2018 · 10 comments
Closed

Missing spaces inside dt's #694

joshkel opened this issue Oct 31, 2018 · 10 comments
Labels
Bug A bug

Comments

@joshkel
Copy link

joshkel commented Oct 31, 2018

Problem

dts that contain formatting lose the spaces between their formatting.

Reproducible Project

The pybind11 project uses Breathe to include Doxygen-generated C++ information in its docs. This should have spaces between the keywords and identifiers (e.g., iterator begin() const). However, because the dt is set as display: table, any internal spaces are lost, and the text shows as iteratorbegin()const.

See https://pybind11.readthedocs.io/en/master/reference.html#_CPPv3NK10object_api5beginEv for an example.

This problem was apparently introduced with #384's change from display: inline-block to display: table (that was made to fix #90). If I undo the change from #384 (either by building the pybind11 docs with an older version of the theme or by using Chrome Dev Tools to change the style on the fly), the pybind11 docs look correct.

I tinkered with styles some and couldn't find a way to fix both this problem and the problem from #384 without changing the HTML. For what it's worth, I noticed that the sample document that demonstrated #90 had updated its documentation style to no longer be affected by #90. I'm fairly new to RST, though, so I don't know which .. data:: style is preferred.)

Error Logs/Results

Current (bad) pybind11:

2018-10-30 22_55_58-reference pybind11 2 3 dev0 documentation

Expected Results

Building pybind11 with a display: inline-block:

2018-10-30 22_59_45-reference pybind11 2 3 dev0 documentation

Environment Info

Here's the information for locally building the pybind11 docs (which does NOT demonstrate thisbug).

  • Python Version: 3.5.2
  • Sphinx Version: 1.6.4
  • RTD Theme Version: 0.2.4
  • Breathe: 4.10.0
@breathe67
Copy link

I have just started using Sphinx & Breathe (version as of Jun 1, 2020) to convert my Doxygen docs to the RTD theme. I'm also having this problem, where my C++ types and other identifiers have no spaces between them.

@mbenlioglu
Copy link

Is there any progress on this one?

@Lucide
Copy link

Lucide commented Nov 11, 2020

I'm also having the issue with sphinx-rtd-theme==0.5.0, on a C project when viewed in Chrome (incognito mode to exclude extensions interference):
1
2
3
The issue doesn't seem to occur in Firefox, but there's still a lot of space after const.

@Blendify
Copy link
Member

Hi, can you paste the RST code to generate the issue. It makes testing for us easier.

@Lucide
Copy link

Lucide commented Nov 28, 2020

I'm using breathe's directives:

.. doxygenfunction:: vtInitializeArray

From the C function prototype documented with Doxygen:

void vtInitializeArray(VTObj *obj, VTChar const *v);

Note that

The issue doesn't seem to occur in Firefox, but there's still a lot of space after const.

@Andrei1Byte
Copy link

@Blendify / @stsewd Do you know if is in plan to fix soon this Bug as is a very old one? Or if there are some workarounds for this?

@IvanoBilenchi
Copy link

I'm experiencing the same issue, using Breathe to bridge Doxygen's XML to Sphinx.

For those in need of a quick hack until this is fixed upstream: you can override the display property for dt by providing an additional CSS file to Sphinx via conf.py:

def setup(app):
    app.add_css_file('path/to/style.css')

Then in style.css:

dt {
    display: inline-block !important;
}

@Blendify
Copy link
Member

I looked into this add found that fix however there are still some spacing issues because some elements manually add padding but its hard to make a CSS selector add padding to all the correct places, a bit more investigation is needed.

@jakobandersen
Copy link

For C and C++ declarations I believe the issue should be fixed from Sphinx v4, as the declarations are rendered using a new set of nodes. This includes all spaces being in spans instead of in the top-level dt (e.g., see breathe-doc/breathe#655 (comment)).
See sphinx-doc/sphinx#9023 for more on the new rendering scheme.

@Blendify
Copy link
Member

Yes, this should now be fixed in newer sphinx versions. There are currently no intentions in fixing this for older versions so this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

No branches or pull requests

9 participants