mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Refactor to one environment per class.
Also rename sphinxcontainer to sphinxclass.
This commit is contained in:
parent
1b03748f68
commit
8ba93dd21f
@ -3,10 +3,10 @@
|
|||||||
% change this info string if making any custom modification
|
% change this info string if making any custom modification
|
||||||
\ProvidesFile{sphinxlatexcontainers.sty}[2021/05/03 containers]
|
\ProvidesFile{sphinxlatexcontainers.sty}[2021/05/03 containers]
|
||||||
|
|
||||||
% The purpose of this file is to provide a dummy environment sphinxcontainer
|
% The purpose of this file is to provide a dummy environment sphinxclass
|
||||||
% which will be inserted for every container directive. The container class
|
% which will be inserted for each class in each container directive. The class
|
||||||
% name will be passed as the argument to the environment. User-defined
|
% name will be passed as the argument to the environment. User-defined
|
||||||
% formatting of directives can be achieved by renewing the definition of
|
% formatting of directives can be achieved by renewing the definition of this
|
||||||
% this environment, and branching on the value of the argument.
|
% environment, and branching on the value of the argument.
|
||||||
|
|
||||||
\newenvironment{sphinxcontainer}[1]{}{}
|
\newenvironment{sphinxclass}[1]{}{}
|
@ -1976,11 +1976,13 @@ class LaTeXTranslator(SphinxTranslator):
|
|||||||
|
|
||||||
def visit_container(self, node: Element) -> None:
|
def visit_container(self, node: Element) -> None:
|
||||||
classes = node.get('classes', [])
|
classes = node.get('classes', [])
|
||||||
self.body.append(
|
for c in classes:
|
||||||
'\n\\bgroup\\begin{sphinxcontainer}{%s}' % ' '.join(classes))
|
self.body.append('\n\\bgroup\\begin{sphinxclass}{%s}' % c)
|
||||||
|
|
||||||
def depart_container(self, node: Element) -> None:
|
def depart_container(self, node: Element) -> None:
|
||||||
self.body.append('\n\\end{sphinxcontainer}\\egroup')
|
classes = node.get('classes', [])
|
||||||
|
for c in classes:
|
||||||
|
self.body.append('\n\\end{sphinxclass}\\egroup')
|
||||||
|
|
||||||
def visit_decoration(self, node: Element) -> None:
|
def visit_decoration(self, node: Element) -> None:
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user