pytorch_sphinx_theme icon indicating copy to clipboard operation
pytorch_sphinx_theme copied to clipboard

Spacing when nesting directives.

Open lezcano opened this issue 4 years ago • 10 comments

The spacing when nesting a .. code directive inside a warning or a note is not rendered correctly.

See for example the end of the first warning in https://pytorch.org/docs/stable/generated/torch.qr.html

image

cc: @mattip

lezcano avatar Jun 28 '21 14:06 lezcano

As far as I can tell, the problem is that either the div.admonition class needs a padding-bottom: 1px; value to clearly delineate where the code box ends.

mattip avatar Jun 28 '21 15:06 mattip

@brianjo thoughts?

mattip avatar Jul 15 '21 13:07 mattip

#135 did not fix this and probably should be backed out. I am not sure how to get the padding-bottom into the div.admonition.

Edit #138 was meant to fix this, but I seem to have forgotten that part of #135.

mattip avatar Aug 03 '21 11:08 mattip

This seems to be fixed on latest master, although there probably is still too much padding around the <pre>.

mattip avatar Aug 20 '21 12:08 mattip

It still does not render well in my browser: image

The difference I see is that now the background is in a slightly darker grey, and the formulae in double backticks do render as if they had both a rectangle around each letter and a large rectangle (of a slightly lighter grey) around the whole formula.

lezcano avatar Aug 20 '21 12:08 lezcano

The background color is a different issue #130. This one is about the overlap between the bottom-most <pre> containing Q,R = torch.linalg.qr(A, mode="complete") and the surrounding WARNING admonition, which now line up.

mattip avatar Aug 20 '21 13:08 mattip

Yes, sorry, I wrote that in both the issues. All I meant to write here is that the spacing between the end of .. warning:: and the end of .. code:: is still not rendered correctly.

lezcano avatar Aug 20 '21 13:08 lezcano

What would you consider to be correct? The bottom of the ..code:: directive previously extended past the surrounding warning:: directive and no longer does.

mattip avatar Aug 20 '21 13:08 mattip

Oh, In my head correct would be to leave an space the size of that just before ..code:: so that it does not look crammed. this space would have the color of the background of ..warning::. Sorry for the misunderstanding.

lezcano avatar Aug 20 '21 13:08 lezcano

Thanks for the clarification. Makes sense.

mattip avatar Aug 20 '21 14:08 mattip