Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: conf.py: rename some vars at latex_documents logic

Currently, the logic uses fn and doc vars, but they don't
properly describe what such vars do.

Make them clearer:
- fname: points to the file name to search (index.rst);
- doc: contains the name of the LaTeX or PDF doc to
be produced.

With that, the checks for SPHINXDIRS and for subdirs will
be more coherent.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/b030d9bc53550905adbe9367b2a3915d7331b4c5.1755763127.git.mchehab+huawei@kernel.org

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
9fd4e4ce 280fa75c

+11 -11
+11 -11
Documentation/conf.py
··· 93 93 94 94 # When SPHINXDIRS is used, we just need to get index.rst, if it exists 95 95 if not os.path.samefile(doctree, app.srcdir): 96 - doc = "index" 97 - doc_name = os.path.basename(app.srcdir) 98 - if os.path.exists(os.path.join(app.srcdir, doc + ".rst")): 99 - latex_documents.append((doc, doc_name + ".tex", 100 - "Linux %s Documentation" % doc_name.capitalize(), 96 + doc = os.path.basename(app.srcdir) 97 + fname = "index" 98 + if os.path.exists(os.path.join(app.srcdir, fname + ".rst")): 99 + latex_documents.append((fname, doc + ".tex", 100 + "Linux %s Documentation" % doc.capitalize(), 101 101 "The kernel development community", 102 102 "manual")) 103 103 return 104 104 105 105 # When building all docs, or when a main index.rst doesn't exist, seek 106 106 # for it on subdirectories 107 - for fn in os.listdir(app.srcdir): 108 - doc = os.path.join(fn, "index") 109 - if not os.path.exists(os.path.join(app.srcdir, doc + ".rst")): 107 + for doc in os.listdir(app.srcdir): 108 + fname = os.path.join(doc, "index") 109 + if not os.path.exists(os.path.join(app.srcdir, fname + ".rst")): 110 110 continue 111 111 112 112 has = False 113 113 for l in latex_documents: 114 - if l[0] == doc: 114 + if l[0] == fname: 115 115 has = True 116 116 break 117 117 118 118 if not has: 119 - latex_documents.append((doc, fn + ".tex", 120 - "Linux %s Documentation" % fn.capitalize(), 119 + latex_documents.append((fname, doc + ".tex", 120 + "Linux %s Documentation" % doc.capitalize(), 121 121 "The kernel development community", 122 122 "manual")) 123 123