Skip to content

Commit

Permalink
Merge tag 'docs-6.8-fixes3' of git://git.lwn.net/linux
Browse files Browse the repository at this point in the history
Pull two documentation build fixes from Jonathan Corbet:

 - The XFS online fsck documentation uses incredibly deeply nested
   subsection and list nesting; that broke the PDF docs build. Tweak a
   parameter to tell LaTeX to allow the deeper nesting.

 - Fix a 6.8 PDF-build regression

* tag 'docs-6.8-fixes3' of git://git.lwn.net/linux:
  docs: translations: use attribute to store current language
  docs: Instruct LaTeX to cope with deeper nesting
  • Loading branch information
torvalds committed Feb 25, 2024
2 parents c46ac50 + b7b2ffc commit 70ff1fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ def get_cline_version():
verbatimhintsturnover=false,
''',

#
# Some of our authors are fond of deep nesting; tell latex to
# cope.
#
'maxlistdepth': '10',

# For CJK One-half spacing, need to be in front of hyperref
'extrapackages': r'\usepackage{setspace}',

Expand Down
10 changes: 4 additions & 6 deletions Documentation/sphinx/translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
}

class LanguagesNode(nodes.Element):
def __init__(self, current_language, *args, **kwargs):
super().__init__(*args, **kwargs)

self.current_language = current_language
pass

class TranslationsTransform(Transform):
default_priority = 900
Expand All @@ -49,7 +46,8 @@ def apply(self):
# normalize docname to be the untranslated one
docname = os.path.join(*components[2:])

new_nodes = LanguagesNode(all_languages[this_lang_code])
new_nodes = LanguagesNode()
new_nodes['current_language'] = all_languages[this_lang_code]

for lang_code, lang_name in all_languages.items():
if lang_code == this_lang_code:
Expand Down Expand Up @@ -84,7 +82,7 @@ def process_languages(app, doctree, docname):

html_content = app.builder.templates.render('translations.html',
context={
'current_language': node.current_language,
'current_language': node['current_language'],
'languages': languages,
})

Expand Down

0 comments on commit 70ff1fe

Please sign in to comment.