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

[ENH] Patch translations #42

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
À ne pas faire en post transformation
Signed-off-by: Vincent-Xavier JUMEL <[email protected]>
  • Loading branch information
vincentxavier committed Mar 29, 2022
commit 190955ea60125de206d40d04ac8af02bfa075c56
4 changes: 2 additions & 2 deletions sphinx_exercise/post_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ResolveTitlesInExercises(SphinxPostTransform):
def resolve_title(self, node):
title = node.children[0]
if isinstance(title, exercise_title):
updated_title = _(docutil_nodes.title())
updated_title = docutil_nodes.title()
if isinstance(node, exercise_enumerable_node):
# Numfig (HTML) will use "Exercise %s" so we just need the subtitle
if self.app.builder.format == "latex":
Expand Down Expand Up @@ -148,7 +148,7 @@ def resolve_solution_title(app, node, exercise_node):
node_number = get_node_number(app, exercise_node, "exercise")
updated_title_text += f" {node_number}"
# New Title Node
updated_title = _(docutil_nodes.title())
updated_title = docutil_nodes.title()
wrap_reference = build_reference_node(app, exercise_node)
wrap_reference += docutil_nodes.Text(updated_title_text)
node["title"] = entry_title_text + updated_title_text
Expand Down