Sphinx 8.0.1__py3-none-any.whl → 8.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of Sphinx might be problematic. Click here for more details.

Files changed (424) hide show
  1. sphinx/__init__.py +6 -3
  2. sphinx/_cli/__init__.py +40 -20
  3. sphinx/_cli/util/colour.py +5 -4
  4. sphinx/_cli/util/errors.py +28 -11
  5. sphinx/application.py +361 -38
  6. sphinx/builders/__init__.py +229 -83
  7. sphinx/builders/_epub_base.py +118 -71
  8. sphinx/builders/changes.py +39 -21
  9. sphinx/builders/dirhtml.py +4 -4
  10. sphinx/builders/dummy.py +2 -5
  11. sphinx/builders/epub3.py +43 -22
  12. sphinx/builders/gettext.py +43 -25
  13. sphinx/builders/html/__init__.py +284 -218
  14. sphinx/builders/html/_assets.py +62 -26
  15. sphinx/builders/html/_build_info.py +76 -0
  16. sphinx/builders/html/transforms.py +11 -9
  17. sphinx/builders/latex/__init__.py +139 -81
  18. sphinx/builders/latex/constants.py +7 -7
  19. sphinx/builders/latex/nodes.py +3 -2
  20. sphinx/builders/latex/theming.py +7 -5
  21. sphinx/builders/latex/transforms.py +27 -19
  22. sphinx/builders/linkcheck.py +146 -72
  23. sphinx/builders/manpage.py +30 -13
  24. sphinx/builders/singlehtml.py +22 -14
  25. sphinx/builders/texinfo.py +67 -37
  26. sphinx/builders/text.py +5 -5
  27. sphinx/builders/xml.py +6 -9
  28. sphinx/cmd/build.py +282 -103
  29. sphinx/cmd/make_mode.py +106 -63
  30. sphinx/cmd/quickstart.py +341 -145
  31. sphinx/config.py +45 -12
  32. sphinx/deprecation.py +8 -2
  33. sphinx/directives/__init__.py +28 -19
  34. sphinx/directives/code.py +86 -56
  35. sphinx/directives/other.py +50 -36
  36. sphinx/directives/patches.py +29 -19
  37. sphinx/domains/__init__.py +20 -120
  38. sphinx/domains/_domains_container.py +281 -0
  39. sphinx/domains/_index.py +110 -0
  40. sphinx/domains/c/__init__.py +3 -3
  41. sphinx/domains/c/_parser.py +10 -6
  42. sphinx/domains/changeset.py +5 -3
  43. sphinx/domains/citation.py +5 -3
  44. sphinx/domains/cpp/__init__.py +9 -11
  45. sphinx/domains/cpp/_parser.py +8 -7
  46. sphinx/domains/index.py +3 -3
  47. sphinx/domains/javascript.py +12 -7
  48. sphinx/domains/math.py +2 -2
  49. sphinx/domains/python/__init__.py +10 -5
  50. sphinx/domains/python/_object.py +1 -1
  51. sphinx/domains/rst.py +5 -5
  52. sphinx/domains/std/__init__.py +16 -11
  53. sphinx/environment/__init__.py +206 -146
  54. sphinx/environment/adapters/asset.py +3 -2
  55. sphinx/environment/adapters/indexentries.py +74 -33
  56. sphinx/environment/adapters/toctree.py +100 -43
  57. sphinx/environment/collectors/__init__.py +19 -8
  58. sphinx/environment/collectors/asset.py +47 -15
  59. sphinx/environment/collectors/dependencies.py +8 -4
  60. sphinx/environment/collectors/metadata.py +7 -2
  61. sphinx/environment/collectors/title.py +7 -2
  62. sphinx/environment/collectors/toctree.py +54 -22
  63. sphinx/errors.py +4 -1
  64. sphinx/events.py +314 -7
  65. sphinx/ext/apidoc.py +42 -18
  66. sphinx/ext/autodoc/__init__.py +52 -24
  67. sphinx/ext/autodoc/importer.py +6 -9
  68. sphinx/ext/autosectionlabel.py +1 -2
  69. sphinx/ext/autosummary/__init__.py +3 -1
  70. sphinx/ext/autosummary/generate.py +28 -14
  71. sphinx/ext/coverage.py +7 -7
  72. sphinx/ext/doctest.py +4 -8
  73. sphinx/ext/duration.py +6 -5
  74. sphinx/ext/inheritance_diagram.py +1 -1
  75. sphinx/ext/intersphinx/_cli.py +6 -4
  76. sphinx/ext/intersphinx/_load.py +77 -32
  77. sphinx/ext/intersphinx/_resolve.py +173 -79
  78. sphinx/ext/intersphinx/_shared.py +7 -5
  79. sphinx/ext/linkcode.py +7 -1
  80. sphinx/ext/mathjax.py +1 -2
  81. sphinx/ext/napoleon/__init__.py +37 -24
  82. sphinx/ext/napoleon/docstring.py +202 -134
  83. sphinx/ext/todo.py +5 -3
  84. sphinx/highlighting.py +10 -3
  85. sphinx/io.py +1 -1
  86. sphinx/jinja2glue.py +27 -6
  87. sphinx/locale/__init__.py +6 -2
  88. sphinx/locale/ar/LC_MESSAGES/sphinx.js +8 -1
  89. sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
  90. sphinx/locale/ar/LC_MESSAGES/sphinx.po +2246 -2288
  91. sphinx/locale/bg/LC_MESSAGES/sphinx.js +4 -1
  92. sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
  93. sphinx/locale/bg/LC_MESSAGES/sphinx.po +2113 -2159
  94. sphinx/locale/bn/LC_MESSAGES/sphinx.js +4 -1
  95. sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
  96. sphinx/locale/bn/LC_MESSAGES/sphinx.po +2349 -2395
  97. sphinx/locale/ca/LC_MESSAGES/sphinx.js +4 -1
  98. sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
  99. sphinx/locale/ca/LC_MESSAGES/sphinx.po +2846 -2892
  100. sphinx/locale/cak/LC_MESSAGES/sphinx.js +4 -1
  101. sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
  102. sphinx/locale/cak/LC_MESSAGES/sphinx.po +2213 -2259
  103. sphinx/locale/cs/LC_MESSAGES/sphinx.js +6 -1
  104. sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
  105. sphinx/locale/cs/LC_MESSAGES/sphinx.po +2225 -2269
  106. sphinx/locale/cy/LC_MESSAGES/sphinx.js +6 -1
  107. sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
  108. sphinx/locale/cy/LC_MESSAGES/sphinx.po +2403 -2447
  109. sphinx/locale/da/LC_MESSAGES/sphinx.js +4 -1
  110. sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
  111. sphinx/locale/da/LC_MESSAGES/sphinx.po +2214 -2260
  112. sphinx/locale/de/LC_MESSAGES/sphinx.js +4 -1
  113. sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
  114. sphinx/locale/de/LC_MESSAGES/sphinx.po +2230 -2276
  115. sphinx/locale/de_DE/LC_MESSAGES/sphinx.js +4 -1
  116. sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
  117. sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +2113 -2159
  118. sphinx/locale/el/LC_MESSAGES/sphinx.js +4 -1
  119. sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
  120. sphinx/locale/el/LC_MESSAGES/sphinx.po +2619 -2665
  121. sphinx/locale/en_DE/LC_MESSAGES/sphinx.js +4 -1
  122. sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
  123. sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +2113 -2159
  124. sphinx/locale/en_FR/LC_MESSAGES/sphinx.js +4 -1
  125. sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
  126. sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +2113 -2159
  127. sphinx/locale/en_GB/LC_MESSAGES/sphinx.js +4 -1
  128. sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
  129. sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +2519 -2565
  130. sphinx/locale/en_HK/LC_MESSAGES/sphinx.js +4 -1
  131. sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
  132. sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +2113 -2159
  133. sphinx/locale/eo/LC_MESSAGES/sphinx.js +4 -1
  134. sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
  135. sphinx/locale/eo/LC_MESSAGES/sphinx.po +2232 -2278
  136. sphinx/locale/es/LC_MESSAGES/sphinx.js +5 -1
  137. sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
  138. sphinx/locale/es/LC_MESSAGES/sphinx.po +2516 -2561
  139. sphinx/locale/es_CO/LC_MESSAGES/sphinx.js +5 -1
  140. sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
  141. sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +2114 -2159
  142. sphinx/locale/et/LC_MESSAGES/sphinx.js +4 -1
  143. sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
  144. sphinx/locale/et/LC_MESSAGES/sphinx.po +2317 -2363
  145. sphinx/locale/eu/LC_MESSAGES/sphinx.js +4 -1
  146. sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
  147. sphinx/locale/eu/LC_MESSAGES/sphinx.po +2218 -2264
  148. sphinx/locale/fa/LC_MESSAGES/sphinx.js +4 -1
  149. sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
  150. sphinx/locale/fa/LC_MESSAGES/sphinx.po +2505 -2551
  151. sphinx/locale/fi/LC_MESSAGES/sphinx.js +4 -1
  152. sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
  153. sphinx/locale/fi/LC_MESSAGES/sphinx.po +2303 -2349
  154. sphinx/locale/fr/LC_MESSAGES/sphinx.js +6 -2
  155. sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
  156. sphinx/locale/fr/LC_MESSAGES/sphinx.po +2863 -2908
  157. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.js +5 -1
  158. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
  159. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +2114 -2159
  160. sphinx/locale/gl/LC_MESSAGES/sphinx.js +4 -1
  161. sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
  162. sphinx/locale/gl/LC_MESSAGES/sphinx.po +2571 -2617
  163. sphinx/locale/he/LC_MESSAGES/sphinx.js +5 -1
  164. sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
  165. sphinx/locale/he/LC_MESSAGES/sphinx.po +2307 -2352
  166. sphinx/locale/hi/LC_MESSAGES/sphinx.js +4 -1
  167. sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
  168. sphinx/locale/hi/LC_MESSAGES/sphinx.po +2580 -2626
  169. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.js +4 -1
  170. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
  171. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +2113 -2159
  172. sphinx/locale/hr/LC_MESSAGES/sphinx.js +5 -1
  173. sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
  174. sphinx/locale/hr/LC_MESSAGES/sphinx.po +2238 -2283
  175. sphinx/locale/hu/LC_MESSAGES/sphinx.js +4 -1
  176. sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
  177. sphinx/locale/hu/LC_MESSAGES/sphinx.po +2228 -2274
  178. sphinx/locale/id/LC_MESSAGES/sphinx.js +3 -1
  179. sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
  180. sphinx/locale/id/LC_MESSAGES/sphinx.po +2787 -2834
  181. sphinx/locale/is/LC_MESSAGES/sphinx.js +4 -1
  182. sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
  183. sphinx/locale/is/LC_MESSAGES/sphinx.po +2224 -2270
  184. sphinx/locale/it/LC_MESSAGES/sphinx.js +5 -1
  185. sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
  186. sphinx/locale/it/LC_MESSAGES/sphinx.po +2231 -2276
  187. sphinx/locale/ja/LC_MESSAGES/sphinx.js +3 -1
  188. sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
  189. sphinx/locale/ja/LC_MESSAGES/sphinx.po +2507 -2554
  190. sphinx/locale/ka/LC_MESSAGES/sphinx.js +4 -1
  191. sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
  192. sphinx/locale/ka/LC_MESSAGES/sphinx.po +2428 -2474
  193. sphinx/locale/ko/LC_MESSAGES/sphinx.js +3 -1
  194. sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
  195. sphinx/locale/ko/LC_MESSAGES/sphinx.po +2516 -2563
  196. sphinx/locale/lt/LC_MESSAGES/sphinx.js +6 -1
  197. sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
  198. sphinx/locale/lt/LC_MESSAGES/sphinx.po +2425 -2469
  199. sphinx/locale/lv/LC_MESSAGES/sphinx.js +5 -1
  200. sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
  201. sphinx/locale/lv/LC_MESSAGES/sphinx.po +2362 -2407
  202. sphinx/locale/mk/LC_MESSAGES/sphinx.js +4 -1
  203. sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
  204. sphinx/locale/mk/LC_MESSAGES/sphinx.po +2121 -2167
  205. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.js +4 -1
  206. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
  207. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +2220 -2266
  208. sphinx/locale/ne/LC_MESSAGES/sphinx.js +4 -1
  209. sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
  210. sphinx/locale/ne/LC_MESSAGES/sphinx.po +2221 -2267
  211. sphinx/locale/nl/LC_MESSAGES/sphinx.js +4 -1
  212. sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
  213. sphinx/locale/nl/LC_MESSAGES/sphinx.po +2240 -2286
  214. sphinx/locale/pl/LC_MESSAGES/sphinx.js +6 -1
  215. sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
  216. sphinx/locale/pl/LC_MESSAGES/sphinx.po +2319 -2363
  217. sphinx/locale/pt/LC_MESSAGES/sphinx.js +5 -1
  218. sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
  219. sphinx/locale/pt/LC_MESSAGES/sphinx.po +2114 -2159
  220. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js +5 -1
  221. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
  222. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +2854 -2899
  223. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.js +5 -1
  224. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
  225. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +2224 -2269
  226. sphinx/locale/ro/LC_MESSAGES/sphinx.js +5 -1
  227. sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
  228. sphinx/locale/ro/LC_MESSAGES/sphinx.po +2226 -2271
  229. sphinx/locale/ru/LC_MESSAGES/sphinx.js +8 -3
  230. sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
  231. sphinx/locale/ru/LC_MESSAGES/sphinx.po +2841 -2885
  232. sphinx/locale/si/LC_MESSAGES/sphinx.js +4 -1
  233. sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
  234. sphinx/locale/si/LC_MESSAGES/sphinx.po +2294 -2340
  235. sphinx/locale/sk/LC_MESSAGES/sphinx.js +6 -1
  236. sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
  237. sphinx/locale/sk/LC_MESSAGES/sphinx.po +2497 -2541
  238. sphinx/locale/sl/LC_MESSAGES/sphinx.js +6 -1
  239. sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
  240. sphinx/locale/sl/LC_MESSAGES/sphinx.po +2331 -2375
  241. sphinx/locale/sphinx.pot +2121 -2167
  242. sphinx/locale/sq/LC_MESSAGES/sphinx.js +4 -1
  243. sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
  244. sphinx/locale/sq/LC_MESSAGES/sphinx.po +2855 -2901
  245. sphinx/locale/sr/LC_MESSAGES/sphinx.js +5 -1
  246. sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
  247. sphinx/locale/sr/LC_MESSAGES/sphinx.po +2203 -2248
  248. sphinx/locale/sr@latin/LC_MESSAGES/sphinx.mo +0 -0
  249. sphinx/locale/sr_RS/LC_MESSAGES/sphinx.mo +0 -0
  250. sphinx/locale/sv/LC_MESSAGES/sphinx.js +4 -1
  251. sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
  252. sphinx/locale/sv/LC_MESSAGES/sphinx.po +2423 -2469
  253. sphinx/locale/te/LC_MESSAGES/sphinx.js +4 -1
  254. sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
  255. sphinx/locale/te/LC_MESSAGES/sphinx.po +2113 -2159
  256. sphinx/locale/tr/LC_MESSAGES/sphinx.js +4 -1
  257. sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
  258. sphinx/locale/tr/LC_MESSAGES/sphinx.po +2443 -2489
  259. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js +6 -1
  260. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
  261. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +2329 -2373
  262. sphinx/locale/ur/LC_MESSAGES/sphinx.js +4 -1
  263. sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
  264. sphinx/locale/ur/LC_MESSAGES/sphinx.po +2113 -2159
  265. sphinx/locale/vi/LC_MESSAGES/sphinx.js +3 -1
  266. sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
  267. sphinx/locale/vi/LC_MESSAGES/sphinx.po +2199 -2246
  268. sphinx/locale/yue/LC_MESSAGES/sphinx.js +3 -1
  269. sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
  270. sphinx/locale/yue/LC_MESSAGES/sphinx.po +2112 -2159
  271. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.js +3 -1
  272. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
  273. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +2112 -2159
  274. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js +3 -1
  275. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
  276. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +2845 -2892
  277. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.js +3 -1
  278. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
  279. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +2112 -2159
  280. sphinx/parsers.py +3 -1
  281. sphinx/project.py +6 -2
  282. sphinx/pycode/__init__.py +11 -4
  283. sphinx/pycode/ast.py +58 -58
  284. sphinx/pycode/parser.py +49 -28
  285. sphinx/pygments_styles.py +49 -49
  286. sphinx/registry.py +8 -3
  287. sphinx/roles.py +133 -13
  288. sphinx/search/__init__.py +146 -87
  289. sphinx/search/da.py +2 -4
  290. sphinx/search/de.py +2 -4
  291. sphinx/search/en.py +4 -4
  292. sphinx/search/es.py +2 -4
  293. sphinx/search/fi.py +2 -4
  294. sphinx/search/fr.py +2 -4
  295. sphinx/search/hu.py +2 -4
  296. sphinx/search/it.py +2 -4
  297. sphinx/search/ja.py +55 -32
  298. sphinx/search/nl.py +2 -4
  299. sphinx/search/no.py +2 -4
  300. sphinx/search/pt.py +2 -4
  301. sphinx/search/ro.py +0 -2
  302. sphinx/search/ru.py +2 -4
  303. sphinx/search/sv.py +2 -4
  304. sphinx/search/tr.py +0 -2
  305. sphinx/search/zh.py +18 -13
  306. sphinx/templates/graphviz/graphviz.css +0 -7
  307. sphinx/testing/fixtures.py +6 -5
  308. sphinx/testing/path.py +7 -5
  309. sphinx/testing/util.py +63 -29
  310. sphinx/texinputs/sphinx.sty +107 -39
  311. sphinx/texinputs/sphinxlatexadmonitions.sty +51 -35
  312. sphinx/texinputs/sphinxlatexcontainers.sty +1 -1
  313. sphinx/texinputs/sphinxlatexgraphics.sty +3 -2
  314. sphinx/texinputs/sphinxlatexindbibtoc.sty +1 -1
  315. sphinx/texinputs/sphinxlatexlists.sty +1 -1
  316. sphinx/texinputs/sphinxlatexliterals.sty +4 -1
  317. sphinx/texinputs/sphinxlatexnumfig.sty +22 -9
  318. sphinx/texinputs/sphinxlatexobjects.sty +1 -1
  319. sphinx/texinputs/sphinxlatexshadowbox.sty +72 -10
  320. sphinx/texinputs/sphinxlatexstyleheadings.sty +7 -2
  321. sphinx/texinputs/sphinxlatexstylepage.sty +2 -8
  322. sphinx/texinputs/sphinxlatexstyletext.sty +2 -4
  323. sphinx/texinputs/sphinxlatextables.sty +1 -1
  324. sphinx/texinputs/sphinxoptionsgeometry.sty +1 -1
  325. sphinx/texinputs/sphinxoptionshyperref.sty +1 -1
  326. sphinx/themes/agogo/layout.html +1 -10
  327. sphinx/themes/agogo/static/agogo.css.jinja +0 -7
  328. sphinx/themes/basic/defindex.html +1 -8
  329. sphinx/themes/basic/domainindex.html +1 -9
  330. sphinx/themes/basic/genindex-single.html +1 -9
  331. sphinx/themes/basic/genindex-split.html +1 -9
  332. sphinx/themes/basic/genindex.html +1 -9
  333. sphinx/themes/basic/globaltoc.html +1 -9
  334. sphinx/themes/basic/layout.html +1 -9
  335. sphinx/themes/basic/localtoc.html +1 -9
  336. sphinx/themes/basic/page.html +1 -9
  337. sphinx/themes/basic/relations.html +1 -9
  338. sphinx/themes/basic/search.html +1 -9
  339. sphinx/themes/basic/searchbox.html +1 -9
  340. sphinx/themes/basic/searchfield.html +4 -10
  341. sphinx/themes/basic/sourcelink.html +1 -9
  342. sphinx/themes/basic/static/basic.css.jinja +2 -13
  343. sphinx/themes/basic/static/doctools.js +0 -7
  344. sphinx/themes/basic/static/language_data.js.jinja +0 -7
  345. sphinx/themes/basic/static/searchtools.js +25 -13
  346. sphinx/themes/bizstyle/layout.html +1 -9
  347. sphinx/themes/bizstyle/static/bizstyle.css.jinja +0 -7
  348. sphinx/themes/bizstyle/static/bizstyle.js.jinja +5 -11
  349. sphinx/themes/classic/layout.html +1 -9
  350. sphinx/themes/classic/static/classic.css.jinja +0 -7
  351. sphinx/themes/classic/static/sidebar.js.jinja +0 -6
  352. sphinx/themes/epub/epub-cover.html +1 -9
  353. sphinx/themes/epub/layout.html +1 -9
  354. sphinx/themes/epub/static/epub.css.jinja +0 -7
  355. sphinx/themes/haiku/layout.html +1 -9
  356. sphinx/themes/haiku/static/haiku.css.jinja +0 -6
  357. sphinx/themes/nature/static/nature.css.jinja +0 -7
  358. sphinx/themes/nonav/layout.html +1 -9
  359. sphinx/themes/nonav/static/nonav.css.jinja +0 -7
  360. sphinx/themes/pyramid/static/epub.css.jinja +0 -7
  361. sphinx/themes/pyramid/static/pyramid.css.jinja +0 -7
  362. sphinx/themes/scrolls/layout.html +1 -10
  363. sphinx/themes/scrolls/static/scrolls.css.jinja +0 -7
  364. sphinx/themes/sphinxdoc/static/sphinxdoc.css.jinja +2 -7
  365. sphinx/themes/traditional/static/traditional.css.jinja +0 -7
  366. sphinx/theming.py +18 -6
  367. sphinx/transforms/__init__.py +56 -35
  368. sphinx/transforms/compact_bullet_list.py +3 -2
  369. sphinx/transforms/i18n.py +132 -50
  370. sphinx/transforms/post_transforms/__init__.py +94 -43
  371. sphinx/transforms/post_transforms/code.py +7 -6
  372. sphinx/transforms/post_transforms/images.py +71 -54
  373. sphinx/transforms/references.py +1 -2
  374. sphinx/util/__init__.py +23 -194
  375. sphinx/util/_files.py +80 -0
  376. sphinx/util/_importer.py +27 -0
  377. sphinx/util/_io.py +1 -2
  378. sphinx/util/_lines.py +26 -0
  379. sphinx/util/_pathlib.py +5 -2
  380. sphinx/util/_serialise.py +53 -0
  381. sphinx/util/_timestamps.py +2 -1
  382. sphinx/util/_uri.py +16 -0
  383. sphinx/util/cfamily.py +48 -25
  384. sphinx/util/console.py +1 -0
  385. sphinx/util/display.py +1 -1
  386. sphinx/util/docfields.py +125 -45
  387. sphinx/util/docstrings.py +1 -1
  388. sphinx/util/docutils.py +118 -44
  389. sphinx/util/exceptions.py +11 -5
  390. sphinx/util/fileutil.py +53 -32
  391. sphinx/util/http_date.py +9 -7
  392. sphinx/util/i18n.py +49 -16
  393. sphinx/util/images.py +7 -6
  394. sphinx/util/inspect.py +29 -12
  395. sphinx/util/inventory.py +47 -29
  396. sphinx/util/logging.py +58 -85
  397. sphinx/util/matching.py +3 -3
  398. sphinx/util/math.py +1 -1
  399. sphinx/util/nodes.py +176 -108
  400. sphinx/util/osutil.py +13 -10
  401. sphinx/util/parallel.py +5 -4
  402. sphinx/util/parsing.py +5 -3
  403. sphinx/util/png.py +3 -3
  404. sphinx/util/requests.py +8 -4
  405. sphinx/util/rst.py +5 -3
  406. sphinx/util/tags.py +5 -2
  407. sphinx/util/template.py +26 -11
  408. sphinx/util/texescape.py +2 -2
  409. sphinx/util/typing.py +89 -38
  410. sphinx/versioning.py +3 -1
  411. sphinx/writers/html.py +22 -7
  412. sphinx/writers/html5.py +113 -64
  413. sphinx/writers/latex.py +408 -221
  414. sphinx/writers/manpage.py +25 -15
  415. sphinx/writers/texinfo.py +94 -82
  416. sphinx/writers/text.py +87 -53
  417. sphinx/writers/xml.py +5 -4
  418. sphinx-8.1.0.dist-info/LICENSE.rst +31 -0
  419. {sphinx-8.0.1.dist-info → sphinx-8.1.0.dist-info}/METADATA +13 -11
  420. sphinx-8.1.0.dist-info/RECORD +598 -0
  421. sphinx-8.0.1.dist-info/LICENSE.rst +0 -67
  422. sphinx-8.0.1.dist-info/RECORD +0 -590
  423. {sphinx-8.0.1.dist-info → sphinx-8.1.0.dist-info}/WHEEL +0 -0
  424. {sphinx-8.0.1.dist-info → sphinx-8.1.0.dist-info}/entry_points.txt +0 -0
sphinx/testing/util.py CHANGED
@@ -29,7 +29,7 @@ if TYPE_CHECKING:
29
29
  from docutils.nodes import Node
30
30
 
31
31
 
32
- def assert_node(node: Node, cls: Any = None, xpath: str = "", **kwargs: Any) -> None:
32
+ def assert_node(node: Node, cls: Any = None, xpath: str = '', **kwargs: Any) -> None:
33
33
  if cls:
34
34
  if isinstance(cls, list):
35
35
  assert_node(node, cls[0], xpath=xpath, **kwargs)
@@ -37,36 +37,43 @@ def assert_node(node: Node, cls: Any = None, xpath: str = "", **kwargs: Any) ->
37
37
  if isinstance(cls[1], tuple):
38
38
  assert_node(node, cls[1], xpath=xpath, **kwargs)
39
39
  else:
40
- assert isinstance(node, nodes.Element), \
41
- 'The node%s does not have any children' % xpath
42
- assert len(node) == 1, \
43
- 'The node%s has %d child nodes, not one' % (xpath, len(node))
44
- assert_node(node[0], cls[1:], xpath=xpath + "[0]", **kwargs)
40
+ assert (
41
+ isinstance(node, nodes.Element)
42
+ ), f'The node{xpath} does not have any children' # fmt: skip
43
+ assert (
44
+ len(node) == 1
45
+ ), f'The node{xpath} has {len(node)} child nodes, not one'
46
+ assert_node(node[0], cls[1:], xpath=xpath + '[0]', **kwargs)
45
47
  elif isinstance(cls, tuple):
46
- assert isinstance(node, list | nodes.Element), \
47
- 'The node%s does not have any items' % xpath
48
- assert len(node) == len(cls), \
49
- 'The node%s has %d child nodes, not %r' % (xpath, len(node), len(cls))
48
+ assert (
49
+ isinstance(node, list | nodes.Element)
50
+ ), f'The node{xpath} does not have any items' # fmt: skip
51
+ assert (
52
+ len(node) == len(cls)
53
+ ), f'The node{xpath} has {len(node)} child nodes, not {len(cls)!r}' # fmt: skip
50
54
  for i, nodecls in enumerate(cls):
51
- path = xpath + "[%d]" % i
55
+ path = xpath + f'[{i}]'
52
56
  assert_node(node[i], nodecls, xpath=path, **kwargs)
53
57
  elif isinstance(cls, str):
54
58
  assert node == cls, f'The node {xpath!r} is not {cls!r}: {node!r}'
55
59
  else:
56
- assert isinstance(node, cls), \
57
- f'The node{xpath} is not subclass of {cls!r}: {node!r}'
60
+ assert (
61
+ isinstance(node, cls)
62
+ ), f'The node{xpath} is not subclass of {cls!r}: {node!r}' # fmt: skip
58
63
 
59
64
  if kwargs:
60
- assert isinstance(node, nodes.Element), \
61
- 'The node%s does not have any attributes' % xpath
65
+ assert (
66
+ isinstance(node, nodes.Element)
67
+ ), f'The node{xpath} does not have any attributes' # fmt: skip
62
68
 
63
69
  for key, value in kwargs.items():
64
70
  if key not in node:
65
71
  if (key := key.replace('_', '-')) not in node:
66
72
  msg = f'The node{xpath} does not have {key!r} attribute: {node!r}'
67
73
  raise AssertionError(msg)
68
- assert node[key] == value, \
69
- f'The node{xpath}[{key}] is not {value!r}: {node[key]!r}'
74
+ assert (
75
+ node[key] == value
76
+ ), f'The node{xpath}[{key}] is not {value!r}: {node[key]!r}'
70
77
 
71
78
 
72
79
  # keep this to restrict the API usage and to have a correct return type
@@ -86,7 +93,7 @@ class SphinxTestApp(sphinx.application.Sphinx):
86
93
 
87
94
  It is recommended to use::
88
95
 
89
- @pytest.mark.sphinx('html')
96
+ @pytest.mark.sphinx('html', testroot='root')
90
97
  def test(app):
91
98
  app = ...
92
99
 
@@ -117,11 +124,14 @@ class SphinxTestApp(sphinx.application.Sphinx):
117
124
  parallel: int = 0,
118
125
  # additional arguments at the end to keep the signature
119
126
  verbosity: int = 0, # argument is not in the same order as in the superclass
120
- keep_going: bool = False,
121
127
  warningiserror: bool = False, # argument is not in the same order as in the superclass
128
+ pdb: bool = False,
129
+ exception_on_warning: bool = False,
122
130
  # unknown keyword arguments
123
131
  **extras: Any,
124
132
  ) -> None:
133
+ self._builder_name = buildername
134
+
125
135
  assert srcdir is not None
126
136
 
127
137
  if verbosity == -1:
@@ -135,7 +145,7 @@ class SphinxTestApp(sphinx.application.Sphinx):
135
145
  # but allow the stream to be /dev/null by passing verbosity=-1
136
146
  status = None if quiet else StringIO()
137
147
  elif not isinstance(status, StringIO):
138
- err = "%r must be an io.StringIO object, got: %s" % ('status', type(status))
148
+ err = f"'status' must be an io.StringIO object, got: {type(status)}"
139
149
  raise TypeError(err)
140
150
 
141
151
  if warning is None:
@@ -143,7 +153,7 @@ class SphinxTestApp(sphinx.application.Sphinx):
143
153
  # but allow the stream to be /dev/null by passing verbosity=-1
144
154
  warning = None if quiet else StringIO()
145
155
  elif not isinstance(warning, StringIO):
146
- err = '%r must be an io.StringIO object, got: %s' % ('warning', type(warning))
156
+ err = f"'warning' must be an io.StringIO object, got: {type(warning)}"
147
157
  raise TypeError(err)
148
158
 
149
159
  self.docutils_conf_path = srcdir / 'docutils.conf'
@@ -167,16 +177,36 @@ class SphinxTestApp(sphinx.application.Sphinx):
167
177
 
168
178
  try:
169
179
  super().__init__(
170
- srcdir, confdir, outdir, doctreedir, buildername,
171
- confoverrides=confoverrides, status=status, warning=warning,
172
- freshenv=freshenv, warningiserror=warningiserror, tags=tags,
173
- verbosity=verbosity, parallel=parallel, keep_going=keep_going,
174
- pdb=False,
180
+ srcdir,
181
+ confdir,
182
+ outdir,
183
+ doctreedir,
184
+ buildername,
185
+ confoverrides=confoverrides,
186
+ status=status,
187
+ warning=warning,
188
+ freshenv=freshenv,
189
+ warningiserror=warningiserror,
190
+ tags=tags,
191
+ verbosity=verbosity,
192
+ parallel=parallel,
193
+ pdb=pdb,
194
+ exception_on_warning=exception_on_warning,
175
195
  )
176
196
  except Exception:
177
197
  self.cleanup()
178
198
  raise
179
199
 
200
+ def _init_builder(self) -> None:
201
+ # override the default theme to 'basic' rather than 'alabaster'
202
+ # for test independence
203
+
204
+ if 'html_theme' in self.config._overrides:
205
+ pass # respect overrides
206
+ elif 'html_theme' in self.config and self.config.html_theme == 'alabaster':
207
+ self.config.html_theme = self.config._overrides.get('html_theme', 'basic')
208
+ super()._init_builder()
209
+
180
210
  @property
181
211
  def status(self) -> StringIO:
182
212
  """The in-memory text I/O for the application status messages."""
@@ -198,9 +228,11 @@ class SphinxTestApp(sphinx.application.Sphinx):
198
228
  os.remove(self.docutils_conf_path)
199
229
 
200
230
  def __repr__(self) -> str:
201
- return f'<{self.__class__.__name__} buildername={self.builder.name!r}>'
231
+ return f'<{self.__class__.__name__} buildername={self._builder_name!r}>'
202
232
 
203
- def build(self, force_all: bool = False, filenames: list[str] | None = None) -> None:
233
+ def build(
234
+ self, force_all: bool = False, filenames: list[str] | None = None
235
+ ) -> None:
204
236
  self.env._pickled_doctree_cache.clear()
205
237
  super().build(force_all, filenames)
206
238
 
@@ -212,7 +244,9 @@ class SphinxTestAppWrapperForSkipBuilding(SphinxTestApp):
212
244
  if it has already been built and there are any output files.
213
245
  """
214
246
 
215
- def build(self, force_all: bool = False, filenames: list[str] | None = None) -> None:
247
+ def build(
248
+ self, force_all: bool = False, filenames: list[str] | None = None
249
+ ) -> None:
216
250
  if not os.listdir(self.outdir):
217
251
  # if listdir is empty, do build.
218
252
  super().build(force_all, filenames)
@@ -9,7 +9,7 @@
9
9
  % by the Sphinx LaTeX writer.
10
10
 
11
11
  \NeedsTeXFormat{LaTeX2e}[1995/12/01]
12
- \ProvidesPackage{sphinx}[2024/07/01 v7.4.0 Sphinx LaTeX package (sphinx-doc)]
12
+ \ProvidesPackage{sphinx}[2024/07/28 v8.1.0 Sphinx LaTeX package (sphinx-doc)]
13
13
 
14
14
  % provides \ltx@ifundefined
15
15
  % (many packages load ltxcmds: graphicx does for pdftex and lualatex but
@@ -156,6 +156,7 @@
156
156
  \DeclareStringOption[-1]{numfigreset}
157
157
  \DeclareBoolOption[false]{nonumfigreset}
158
158
  \DeclareBoolOption[false]{mathnumfig}
159
+ \DeclareStringOption[.]{mathnumsep}
159
160
  \define@key{sphinx}{bookmarksdepth}{\AtBeginDocument{\hypersetup{bookmarksdepth=#1}}}
160
161
  \AtBeginDocument{\define@key{sphinx}{bookmarksdepth}{\hypersetup{bookmarksdepth=#1}}}
161
162
  % \DeclareBoolOption[false]{usespart}% not used
@@ -350,6 +351,11 @@
350
351
  % is handled as an admonition with the same customizability. And the
351
352
  % todo directive.
352
353
  %
354
+ % 8.1.0: style separately topic, contents, and sidebar directives
355
+ % ---------------------------------------------------------------
356
+ %
357
+ % And use some title row also for them (but without icon, per default).
358
+ %
353
359
  \def\spxstring@none{none}
354
360
  \def\spxstring@clone{clone}
355
361
  %
@@ -397,6 +403,15 @@
397
403
  % macro prefix option prefix legacy option init value
398
404
  \spx@tempa{spx@pre@} {pre_} {verbatimborder} {0.4pt}
399
405
  \spx@tempa{spx@topic@} {div.topic_} {shadowrule} {0.5pt}% mod. at 7.4.0
406
+ \spx@tempa{spx@contents@} {div.contents_} {shadowrule} {0.5pt}% 8.1.0
407
+ \spx@tempa{spx@sidebar@} {div.sidebar_} {shadowrule} {1pt}% 8.1.0
408
+ % let legacy shadowrule key set all topic/contents/sidebar border
409
+ % keys to the common value given by user to shadowrule
410
+ \def\KV@sphinx@shadowrule #1{%
411
+ \@nameuse{KV@sphinx@div.topic_border-width}{#1}%
412
+ \@nameuse{KV@sphinx@div.contents_border-width}{#1}%
413
+ \@nameuse{KV@sphinx@div.sidebar_border-width}{#1}%
414
+ }%
400
415
  \spx@tempa{spx@note@} {div.note_} {noteborder} {0.5pt}
401
416
  \spx@tempa{spx@hint@} {div.hint_} {hintborder} {0.5pt}
402
417
  \spx@tempa{spx@important@}{div.important_}{importantborder}{0.5pt}
@@ -444,9 +459,13 @@
444
459
  % In order for perfect exact same vertical alignment of contents from all such
445
460
  % directives, the value of horizontal border-width+padding is kept constant
446
461
  % (equal to 7.5pt since 7.4.0).
462
+ % 8.1.0 styles separately topic, contents, and sidebar.
447
463
  % #1 macro prefix #6 option prefix top right bottom left
448
464
  \spx@tempa{spx@pre@} {pre_} {3pt}{3pt}{3pt}{3pt}
449
- \spx@tempa{spx@topic@} {div.topic_} {10pt}{7pt}{12pt}{7pt}
465
+ \spx@tempa{spx@topic@} {div.topic_} {6pt}{7pt}{6pt}{7pt}% mod. at 8.1.0
466
+ % contents styling inherits at 8.1.0 the former 7.4.0 topic defaults
467
+ \spx@tempa{spx@contents@} {div.contents_} {10pt}{7pt}{12pt}{7pt}% 8.1.0
468
+ \spx@tempa{spx@sidebar@} {div.sidebar_} {6pt}{6.5pt}{6pt}{6.5pt}% 8.1.0
450
469
  % 7.4.0 drops legacy settings which linked strangely padding with border width
451
470
  \spx@tempa{spx@note@} {div.note_} {6pt}{7pt}{6pt}{7pt}
452
471
  \spx@tempa{spx@hint@} {div.hint_} {6pt}{7pt}{6pt}{7pt}
@@ -462,8 +481,13 @@
462
481
  \spx@tempa{spx@box@} {box_} {3pt}{3pt}{3pt}{3pt}
463
482
  % define legacy verbatimsep key as alias of pre_padding key
464
483
  \expandafter\let\expandafter\KV@sphinx@verbatimsep\csname KV@sphinx@pre_padding\endcsname
465
- % define legacy shadowsep key as alias of div.topic_padding key
466
- \expandafter\let\expandafter\KV@sphinx@shadowsep\csname KV@sphinx@div.topic_padding\endcsname
484
+ % let legacy shadowsep key set all topic/contents/sidebar padding
485
+ % keys to the common value given by user to shadosep
486
+ \def\KV@sphinx@shadowsep #1{%
487
+ \@nameuse{KV@sphinx@div.topic_padding}{#1}%
488
+ \@nameuse{KV@sphinx@div.contents_padding}{#1}%
489
+ \@nameuse{KV@sphinx@div.sidebar_padding}{#1}%
490
+ }%
467
491
 
468
492
  % Corner radii keys
469
493
  %
@@ -491,9 +515,16 @@
491
515
  % - the 3pt is used (which is normal value of \fboxsep).
492
516
  % - some admonitions use rounded corners as well.
493
517
  % - topic boxed have only their bottom right corner rounded.
518
+ % At 8.1.0 topic, contents and sidebar separately styled.
494
519
  % macro prefix option prefix tl tr br bl
495
520
  \spx@tempa{spx@pre@} {pre_} {3pt}{3pt}{3pt}{3pt}
496
- \spx@tempa{spx@topic@} {div.topic_} \z@ \z@ {12pt} \z@
521
+ % use four rounded corners (and no shadow) for topic at 8.1.0
522
+ \spx@tempa{spx@topic@} {div.topic_} {8pt}{8pt}{8pt}{8pt}
523
+ % contents inherits at 8.1.0 the 7.4.0 former styling of topic
524
+ \spx@tempa{spx@contents@} {div.contents_} \z@ \z@ {12pt} \z@
525
+ % make sidebard distinctive as we can't really safely implement
526
+ % it with text flowing around it, but rather as a full width block
527
+ \spx@tempa{spx@sidebar@} {div.sidebar_} {12pt}\z@ {12pt} \z@
497
528
  \spx@tempa{spx@note@} {div.note_} {5pt}{5pt}{5pt}{5pt}
498
529
  \spx@tempa{spx@hint@} {div.hint_} {5pt}{5pt}{5pt}{5pt}
499
530
  \spx@tempa{spx@important@}{div.important_} \z@\z@\z@\z@
@@ -522,6 +553,8 @@
522
553
  % macro prefix
523
554
  \spx@tempa{spx@pre@}
524
555
  \spx@tempa{spx@topic@}
556
+ \spx@tempa{spx@contents@}% 8.1.0
557
+ \spx@tempa{spx@sidebar@}% 8.1.0
525
558
  \spx@tempa{spx@note@}
526
559
  \spx@tempa{spx@hint@}
527
560
  \spx@tempa{spx@important@}
@@ -555,13 +588,10 @@
555
588
  % used here. Since 6.2.0, expansion is delayed to time of use as for
556
589
  % the other dimensions handled above. This is synched with an added
557
590
  % encapsulation in \dimexpr...\relax by the "setup" from
558
- % sphinxpackageboxes.sty. An induced regression had to be fixed in
559
- % the sphinxShadowBox environment as it was using in an \ifdim the
560
- % \spx@topic@shadow@yoffset macro, now holding by default 4pt+\z@
561
- % rather than an already digested 262144sp. The +\z@ is in case ##2
562
- % is empty.
591
+ % sphinxpackageboxes.sty.
563
592
  \else #1%
564
- \def#6{##1}\def#7{##2+\z@}%
593
+ \def#6{##1}%
594
+ \if\relax\detokenize{##2}\relax\let#7#6\else\def#7{##2}\fi
565
595
  \if\relax\detokenize{##3}\relax#4\else#3\fi
566
596
  \fi
567
597
  }%
@@ -569,8 +599,12 @@
569
599
  }
570
600
  \spx@tempa{spx@pre@} {pre_}
571
601
  \spx@tempa{spx@topic@} {div.topic_}
572
- % This corresponds to the legacy parameters of ShadowBox
573
- \spx@topic@shadow@setter 4pt 4pt {} \@nnil
602
+ \spx@tempa{spx@contents@} {div.contents_}
603
+ \spx@tempa{spx@sidebar@} {div.sidebar_}
604
+ % This corresponds to the legacy parameters for topic/contents/sidebar,
605
+ % but they are now only kept for contents
606
+ \spx@contents@shadow@setter 4pt 4pt {} \@nnil
607
+ % topic and sidebar default to no shadow
574
608
  \spx@tempa{spx@note@} {div.note_}
575
609
  \spx@tempa{spx@hint@} {div.hint_}
576
610
  \spx@tempa{spx@important@}{div.important_}
@@ -584,18 +618,28 @@
584
618
  \spx@tempa{spx@error@} {div.error_}
585
619
  \spx@tempa{spx@box@} {box_}
586
620
 
587
- % Support for legacy shadowsize (topic/contents)
621
+ % Support for legacy shadowsize (topic/contents/sidebar)
588
622
  % This definition was broken due to a typo at 5.1.0 and got fixed at 6.1.2
589
623
  % MEMO: at 6.2.0 this no longer does \number\dimexpr in an \edef. Reason is to
590
624
  % keep in sync with div.topic_box-shadow handling of xoffset and yoffset.
591
625
  \define@key{sphinx}{shadowsize}{%
592
626
  \def\spx@topic@shadow@xoffset{#1}%
593
- \let\spx@topic@shadow@yoffset\spx@topic@shadow@xoffset
627
+ \let\spx@contents@shadow@xoffset\spx@topic@shadow@xoffset
628
+ \let\spx@sidebar@shadow@xoffset \spx@topic@shadow@xoffset
629
+ \let\spx@topic@shadow@yoffset \spx@topic@shadow@xoffset
630
+ \let\spx@contents@shadow@yoffset\spx@topic@shadow@xoffset
631
+ \let\spx@sidebar@shadow@yoffset \spx@topic@shadow@xoffset
594
632
  \ifdim\dimexpr\spx@topic@shadow@xoffset=\z@
595
633
  \spx@topic@withshadowfalse
634
+ \spx@contents@withshadowfalse
635
+ \spx@sidebar@withshadowfalse
596
636
  \else
597
637
  \spx@topic@withshadowtrue
598
638
  \spx@topic@insetshadowfalse
639
+ \spx@contents@withshadowtrue
640
+ \spx@contents@insetshadowfalse
641
+ \spx@sidebar@withshadowtrue
642
+ \spx@sidebar@insetshadowfalse
599
643
  \fi
600
644
  }%
601
645
 
@@ -638,6 +682,8 @@
638
682
  % macro prefix
639
683
  \spx@tempa{spx@pre@}
640
684
  \spx@tempa{spx@topic@}
685
+ \spx@tempa{spx@contents@}
686
+ \spx@tempa{spx@sidebar@}
641
687
  \spx@tempa{spx@note@}
642
688
  \spx@tempa{spx@hint@}
643
689
  \spx@tempa{spx@important@}
@@ -690,7 +736,11 @@
690
736
  \csname KV@sphinx@pre_background-TeXcolor\endcsname
691
737
  % (6.2.0 modified some internal namings for the colors of topic boxes)
692
738
  % macro prefix option prefix color name prefix
693
- \spx@tempa{spx@topic@} {div.topic_} {sphinxtopic}% (no legacy interface)
739
+ % There was no legacy interface for topic/contents/sidebar
740
+ % 8.1.0 allows separate styling for topic/contents/sidebar
741
+ \spx@tempa{spx@topic@} {div.topic_} {sphinxtopic}
742
+ \spx@tempa{spx@contents@} {div.contents_} {sphinxcontents}
743
+ \spx@tempa{spx@sidebar@} {div.sidebar_} {sphinxsidebar}
694
744
  \spx@tempa{spx@note@} {div.note_} {sphinxnote}
695
745
  \spx@tempa{spx@hint@} {div.hint_} {sphinxhint}
696
746
  \spx@tempa{spx@important@}{div.important_} {sphinximportant}
@@ -731,7 +781,7 @@
731
781
  \spx@tempa{div.important_} {important}
732
782
  \spx@tempa{div.tip_} {tip}
733
783
 
734
- % Add "legacy" hintTeXextras etc...
784
+ % Add "legacy" hintTeXextras etc...
735
785
  \def\spx@tempa#1#2{% #1 = CSS like option prefix, #2 = legacy option prefix
736
786
  \expandafter\let\csname KV@sphinx@#2TeXextras\expandafter\endcsname
737
787
  \csname KV@sphinx@#1TeXextras\endcsname
@@ -743,10 +793,19 @@
743
793
 
744
794
  % At 7.4.0, let topic/contents boxes acquire background and border colours
745
795
  % and give the shadow some colour other than black
746
- \setkeys{sphinx}{div.topic_border-TeXcolor=sphinx-admonition-bordercolor,
747
- div.topic_background-TeXcolor=sphinx-admonition-bgcolor,
748
- div.topic_box-shadow-TeXcolor={RGB}{108,108,108},
749
- }
796
+ % 8.1.0 styles separately topic/contents/sidebar
797
+ % topic has no shadow but we keep 7.4.0 color in case it gets needed
798
+ \setkeys{sphinx}{%
799
+ div.topic_border-TeXcolor=sphinx-admonition-bordercolor,
800
+ div.topic_background-TeXcolor=sphinx-admonition-bgcolor,
801
+ div.topic_box-shadow-TeXcolor={RGB}{108,108,108},
802
+ div.contents_border-TeXcolor=sphinx-admonition-bordercolor,
803
+ div.contents_background-TeXcolor=sphinx-admonition-bgcolor,
804
+ div.contents_box-shadow-TeXcolor={RGB}{108,108,108},
805
+ div.sidebar_border-TeXcolor=sphinx-admonition-bordercolor,
806
+ div.sidebar_background-TeXcolor=sphinx-admonition-bgcolor,
807
+ div.sidebar_box-shadow-TeXcolor=sphinx-admonition-bordercolor!80,% #9eacaf
808
+ }
750
809
 
751
810
 
752
811
  % 7.4.0 lets all types of admonitions style especially their titlss.
@@ -799,15 +858,21 @@
799
858
  div.error_title-background-TeXcolor=sphinx-error-title-bgcolor,
800
859
  div.error_title-foreground-TeXcolor=sphinx-error-title-fgcolor,
801
860
  %
802
- % TODO: implement todo (sic)
803
- %
861
+ % 8.1.0 add title rows, but will not use icons per default, so
862
+ % the fgcolor setting will be used only if user uses title-icon key
863
+ div.topic_title-background-TeXcolor=sphinx-admonition-title-bgcolor,
864
+ div.topic_title-foreground-TeXcolor=sphinx-admonition-title-fgcolor,
865
+ div.contents_title-background-TeXcolor=sphinx-admonition-title-bgcolor,
866
+ div.contents_title-foreground-TeXcolor=sphinx-admonition-title-fgcolor,
867
+ div.sidebar_title-background-TeXcolor=sphinx-note-title-bgcolor,
868
+ div.sidebar_title-foreground-TeXcolor=sphinx-note-title-fgcolor,
804
869
  }
805
870
 
806
871
  % 7.4.0 Support for icons in admonition titles
807
872
  % We try to
808
873
  % - get Sphinx PDF builds to process fine in absence of fontawesome5
809
874
  % - use fontawesome5 if present, but not if user prefers another package
810
- % - provide an interface for using other LaTeX code for icons
875
+ % - provide an interface for using other LaTeX code for icons
811
876
  % - provide an interface for using some other package than fontawesome5
812
877
  % Indeed we can't load fontawesome5 unconditionally even if available,
813
878
  % as it proves incompatible with fontawesome package.
@@ -881,6 +946,9 @@
881
946
  div.attention_title-icon = \spx@faIcon{exclamation-triangle},
882
947
  div.danger_title-icon = \spx@faIcon{radiation},
883
948
  div.error_title-icon = \spx@faIcon{times-circle},
949
+ % MEMO: the new at 8.1.0 defaults for contents/topic/sidebar directives
950
+ % use no icons, they use \sphinxdotitlerow which detects automatically
951
+ % whether title-icon key has been set or not.
884
952
  }
885
953
 
886
954
  \newif\ifspx@opt@box@addstrut
@@ -945,9 +1013,9 @@
945
1013
  %% PASS OPTIONS
946
1014
  %
947
1015
  % pass options to hyperref; it must not have been loaded already
948
- \input{sphinxoptionshyperref.sty}
1016
+ \RequirePackage{sphinxoptionshyperref}
949
1017
  % pass options to geometry; it must not have been loaded already
950
- \input{sphinxoptionsgeometry.sty}
1018
+ \RequirePackage{sphinxoptionsgeometry}
951
1019
 
952
1020
 
953
1021
  %% COLOR (general)
@@ -986,7 +1054,7 @@
986
1054
  %
987
1055
  % It will always be needed, so let's load it here
988
1056
  \RequirePackage{graphicx}
989
- \input{sphinxlatexgraphics.sty}
1057
+ \RequirePackage{sphinxlatexgraphics}
990
1058
 
991
1059
 
992
1060
  %% FRAMED ENVIRONMENTS
@@ -1051,14 +1119,14 @@
1051
1119
  addstrut=false,
1052
1120
  }%
1053
1121
  \RequirePackage{sphinxpackageboxes}
1054
- \input{sphinxlatexadmonitions.sty}
1055
- \input{sphinxlatexliterals.sty}
1056
- \input{sphinxlatexshadowbox.sty}
1122
+ \RequirePackage{sphinxlatexadmonitions}
1123
+ \RequirePackage{sphinxlatexliterals}
1124
+ \RequirePackage{sphinxlatexshadowbox}
1057
1125
 
1058
1126
 
1059
1127
  %% CONTAINERS
1060
1128
  %
1061
- \input{sphinxlatexcontainers.sty}
1129
+ \RequirePackage{sphinxlatexcontainers}
1062
1130
 
1063
1131
 
1064
1132
  %% PYGMENTS
@@ -1068,17 +1136,17 @@
1068
1136
 
1069
1137
  %% TABLES
1070
1138
  %
1071
- \input{sphinxlatextables.sty}
1139
+ \RequirePackage{sphinxlatextables}
1072
1140
 
1073
1141
 
1074
1142
  %% NUMBERING OF FIGURES, TABLES, AND LITERAL BLOCKS
1075
1143
  %
1076
- \input{sphinxlatexnumfig.sty}
1144
+ \RequirePackage{sphinxlatexnumfig}
1077
1145
 
1078
1146
 
1079
1147
  %% LISTS
1080
1148
  %
1081
- \input{sphinxlatexlists.sty}
1149
+ \RequirePackage{sphinxlatexlists}
1082
1150
 
1083
1151
 
1084
1152
  %% FOOTNOTES
@@ -1108,19 +1176,19 @@
1108
1176
 
1109
1177
  %% INDEX, BIBLIOGRAPHY, APPENDIX, TABLE OF CONTENTS
1110
1178
  %
1111
- \input{sphinxlatexindbibtoc.sty}
1179
+ \RequirePackage{sphinxlatexindbibtoc}
1112
1180
 
1113
1181
 
1114
1182
  %% STYLING
1115
1183
  %
1116
- \input{sphinxlatexstylepage.sty}
1117
- \input{sphinxlatexstyleheadings.sty}
1118
- \input{sphinxlatexstyletext.sty}
1184
+ \RequirePackage{sphinxlatexstylepage}
1185
+ \RequirePackage{sphinxlatexstyleheadings}
1186
+ \RequirePackage{sphinxlatexstyletext}
1119
1187
 
1120
1188
 
1121
1189
  %% MODULE RELEASE DATA AND OBJECT DESCRIPTIONS
1122
1190
  %
1123
- \input{sphinxlatexobjects.sty}
1191
+ \RequirePackage{sphinxlatexobjects}
1124
1192
 
1125
1193
 
1126
1194
  % FIXME: this line should be dropped, as "9" is default anyhow.
@@ -1,15 +1,12 @@
1
1
  %% NOTICES AND ADMONITIONS
2
2
  %
3
3
  % change this info string if making any custom modification
4
- \ProvidesFile{sphinxlatexadmonitions.sty}[2024/07/01 v7.4.0 admonitions]
4
+ \ProvidesPackage{sphinxlatexadmonitions}[2024/07/28 v8.1.0 admonitions]
5
5
 
6
6
  % Provides support for this output mark-up from Sphinx latex writer:
7
7
  %
8
8
  % - sphinxseealso environment added at 6.1.0.
9
9
  %
10
- % At 7.4.0 it too now uses sphinxheavybox, and has the same associated
11
- % sphinxsetup CSS keys as admonitions do.
12
- %
13
10
  % - sphinxtodo environment added at 7.4.0.
14
11
  %
15
12
  % - sphinxadmonition (environment)
@@ -19,16 +16,21 @@
19
16
  % sphinxheavybox since 6.2.0),
20
17
  % - warning, caution, attention, danger, error to use sphinxheavybox.
21
18
  %
22
- % At 7.4.0 all admonitions use sphinxheavybox.
19
+ % Since 7.4.0 all admonitions use sphinxheavybox.
23
20
  %
24
21
  % - All environments sphinxnote, sphinxwarning, etc... can be redefined as
25
22
  % will by user. Thay have a single parameter #1 which is the title.
26
23
  %
27
- % - The default sphinxnote, sphinxwarning, etc... use associated
28
- % one-argument macros \sphinxstylenotetitle, \sphinxstylewarningtitle, etc
29
- % which can be redefined. Their default is to use \sphinxdotitlerowwithicon
30
- % to typeset the title in a coloured header row at top of the
31
- % admonition. (new with 7.4.0)
24
+ % - Also redefinable by user are the one-argument commands
25
+ % * \sphinxstylenotetitle,
26
+ % * \sphinxstylewarningtitle,
27
+ % * etc.... one for each admonition type (also seealso and todo).
28
+ %
29
+ % - At 7.4.0, all commands of previous item use \sphinxdotitlerow.
30
+ % (the 7.4.0 name, still usable, was \sphinxdotitlerowwithicon; the 8.1.0
31
+ % version is also used for topic, contents and sidebar directives, see
32
+ % sphinxlatexshadowbox.sty, and handles both "with icon" and "without
33
+ % icon" situations).
32
34
  %
33
35
  % The sphinxlightbox environment is kept for backward compatiblity, for user
34
36
  % custom code which used it via custom definitions done in preamble or via
@@ -42,20 +44,21 @@
42
44
  % (the 7.4.0 redefined \sphinxstylenotetitle will not work in sphinxlightbox,
43
45
  % so \sphinxstrong{#1}<space> which was its former default is used above).
44
46
 
45
- %
46
- % Requires:
47
- \RequirePackage{sphinxpackageboxes}
48
- % 7.4.0 removes unneeded \spx@boxes@border
49
- \RequirePackage{framed}% used by sphinxheavybox
50
- %
51
47
  % Dependencies (they do not need to be defined at time of loading):
52
48
  %
53
49
  % - of course the various colour and dimension options handled via sphinx.sty
54
- %
55
50
  % - dimension register \spx@image@maxheight from sphinxlatexgraphics.sty
51
+ % - \savenotes/\spewnotes from sphinxpackagefootnote.sty
52
+ % - \ifspx@inframed defined in sphinx.sty
53
+ % - \spx@boxes@fcolorbox@setup from sphinxpackageboxes.sty
54
+ %
55
+ \RequirePackage{framed}
56
+ % Those are required either before or after by sphinx.sty anyhow, but for
57
+ % clarity we list them here:
58
+ \RequirePackage{sphinxlatexgraphics}
59
+ \RequirePackage{sphinxpackagefootnote}
60
+ \RequirePackage{sphinxpackageboxes}
56
61
  %
57
- % - \savenotes/\spewnotes from sphinxpackagefootnote (for sphinxheavybox)
58
-
59
62
  % Provides: (also in sphinxlatexliterals.sty)
60
63
  % Only needed here by legacy (deprecated) sphinxlightbox environment.
61
64
  \providecommand*\sphinxvspacefixafterfrenchlists{%
@@ -300,10 +303,15 @@
300
303
  % workaround some LaTeX "feature" of \end command (i.e. can't use "sphinx#1" here)
301
304
  {\edef\spx@temp{\noexpand\end{sphinx\spx@noticetype}}\spx@temp}
302
305
 
306
+ % TODO: allow these next three settings to be customized individually.
307
+ % This can however already be done at user level by \renewcommand
308
+ % inside renew'ed environments sphinxnote, sphinxhint etc...
303
309
  \newcommand\sphinxtitlerowtoppadding{5pt}
304
310
  \newcommand\sphinxtitlerowbottompadding{3pt}
305
311
  \newcommand\sphinxtitlerowaftericonspacecmd{\hskip0.5em\relax}
306
- \newcommand\sphinxdotitlerowwithicon[2]{% #1=type, #2=heading (without final colon)
312
+ % 7.4.0 used this longer name:
313
+ \newcommand\sphinxdotitlerowwithicon{\sphinxdotitlerow}
314
+ \newcommand\sphinxdotitlerow[2]{% #1=type, #2=heading (without final colon)
307
315
  \begingroup
308
316
  \kern-\spx@boxes@padding@top
309
317
  \parskip\z@skip % the \parskip business is a workaround to a vertical
@@ -325,16 +333,24 @@
325
333
  \spx@boxes@withshadowfalse
326
334
  \sphinxcolorlet{spx@boxes@backgroundcolor}{sphinx#1TtlBgColor}%
327
335
  \spx@boxes@fcolorbox{%
328
- \makebox[\linewidth][l]{%
329
- \textcolor{sphinx#1TtlFgColor}{%
336
+ \parbox[t]{\linewidth}{% 7.4.0 used \makebox, but wrapping of long titles
337
+ % is needed for generic admonition or topic box.
338
+ \sphinxAtStartPar
339
+ % 8.1.0 auto-drops extra space if no icon
340
+ \sbox\z@{\@nameuse{sphinx#1TtlIcon}}%
341
+ \ifdim\wd\z@>\z@
342
+ \textcolor{sphinx#1TtlFgColor}{%
330
343
  \@nameuse{sphinx#1TtlIcon}%
331
344
  % This macro is located here and not after the closing brace
332
345
  % for reasons of fall-back \spx@faIcon definition in sphinx.sty
333
346
  % in case fontawesome5 package not found.
334
347
  \sphinxtitlerowaftericonspacecmd
335
- }%
348
+ }%
349
+ \fi
336
350
  \sphinxstrong{#2}%
337
- \strut}%
351
+ \strut
352
+ \par
353
+ }%
338
354
  }%
339
355
  \kern-\spx@boxes@padding@right
340
356
  \par
@@ -347,17 +363,17 @@
347
363
  % \sphinxremovefinalcolon{#1} will typeset #1 without the colon.
348
364
  % Legacy definitions (done in sphinxlatexstyletext.sty) were all using
349
365
  % a boring plain \sphinxstrong{#1}, now we use a coloured title row.
350
- \newcommand\sphinxstylenotetitle [1]{\sphinxdotitlerowwithicon{note}{\sphinxremovefinalcolon{#1}}}
351
- \newcommand\sphinxstylehinttitle [1]{\sphinxdotitlerowwithicon{hint}{\sphinxremovefinalcolon{#1}}}
352
- \newcommand\sphinxstyleimportanttitle[1]{\sphinxdotitlerowwithicon{important}{\sphinxremovefinalcolon{#1}}}
353
- \newcommand\sphinxstyletiptitle [1]{\sphinxdotitlerowwithicon{tip}{\sphinxremovefinalcolon{#1}}}
354
- \newcommand\sphinxstylewarningtitle [1]{\sphinxdotitlerowwithicon{warning}{\sphinxremovefinalcolon{#1}}}
355
- \newcommand\sphinxstylecautiontitle [1]{\sphinxdotitlerowwithicon{caution}{\sphinxremovefinalcolon{#1}}}
356
- \newcommand\sphinxstyleattentiontitle[1]{\sphinxdotitlerowwithicon{attention}{\sphinxremovefinalcolon{#1}}}
357
- \newcommand\sphinxstyledangertitle [1]{\sphinxdotitlerowwithicon{danger}{\sphinxremovefinalcolon{#1}}}
358
- \newcommand\sphinxstyleerrortitle [1]{\sphinxdotitlerowwithicon{error}{\sphinxremovefinalcolon{#1}}}
359
- \newcommand\sphinxstyleseealsotitle [1]{\sphinxdotitlerowwithicon{seealso}{\sphinxremovefinalcolon{#1}}}
360
- \newcommand\sphinxstyletodotitle [1]{\sphinxdotitlerowwithicon{todo}{\sphinxremovefinalcolon{#1}}}
366
+ \newcommand\sphinxstylenotetitle [1]{\sphinxdotitlerow{note}{\sphinxremovefinalcolon{#1}}}
367
+ \newcommand\sphinxstylehinttitle [1]{\sphinxdotitlerow{hint}{\sphinxremovefinalcolon{#1}}}
368
+ \newcommand\sphinxstyleimportanttitle[1]{\sphinxdotitlerow{important}{\sphinxremovefinalcolon{#1}}}
369
+ \newcommand\sphinxstyletiptitle [1]{\sphinxdotitlerow{tip}{\sphinxremovefinalcolon{#1}}}
370
+ \newcommand\sphinxstylewarningtitle [1]{\sphinxdotitlerow{warning}{\sphinxremovefinalcolon{#1}}}
371
+ \newcommand\sphinxstylecautiontitle [1]{\sphinxdotitlerow{caution}{\sphinxremovefinalcolon{#1}}}
372
+ \newcommand\sphinxstyleattentiontitle[1]{\sphinxdotitlerow{attention}{\sphinxremovefinalcolon{#1}}}
373
+ \newcommand\sphinxstyledangertitle [1]{\sphinxdotitlerow{danger}{\sphinxremovefinalcolon{#1}}}
374
+ \newcommand\sphinxstyleerrortitle [1]{\sphinxdotitlerow{error}{\sphinxremovefinalcolon{#1}}}
375
+ \newcommand\sphinxstyleseealsotitle [1]{\sphinxdotitlerow{seealso}{\sphinxremovefinalcolon{#1}}}
376
+ \newcommand\sphinxstyletodotitle [1]{\sphinxdotitlerow{todo}{\sphinxremovefinalcolon{#1}}}
361
377
  %
362
378
  % A utility to remove a final colon. Removing last token is not easy in
363
379
  % LaTeX, and there are additional complications:
@@ -1,7 +1,7 @@
1
1
  %% CONTAINER DIRECTIVES
2
2
  %
3
3
  % change this info string if making any custom modification
4
- \ProvidesFile{sphinxlatexcontainers.sty}[2021/05/03 containers]
4
+ \ProvidesPackage{sphinxlatexcontainers}[2021/05/03 containers]
5
5
 
6
6
  % The purpose of this file is to provide a dummy environment sphinxclass which
7
7
  % will be inserted for each class in each container directive. The class name