Sphinx 7.3.6__py3-none-any.whl → 7.4.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 (357) hide show
  1. sphinx/__init__.py +5 -6
  2. sphinx/_cli/__init__.py +296 -0
  3. sphinx/_cli/util/__init__.py +0 -0
  4. sphinx/_cli/util/colour.py +103 -0
  5. sphinx/_cli/util/errors.py +165 -0
  6. sphinx/application.py +78 -43
  7. sphinx/builders/__init__.py +59 -15
  8. sphinx/builders/_epub_base.py +11 -5
  9. sphinx/builders/changes.py +2 -2
  10. sphinx/builders/epub3.py +2 -2
  11. sphinx/builders/gettext.py +10 -10
  12. sphinx/builders/html/__init__.py +56 -54
  13. sphinx/builders/latex/__init__.py +5 -5
  14. sphinx/builders/latex/constants.py +5 -0
  15. sphinx/builders/linkcheck.py +73 -38
  16. sphinx/builders/texinfo.py +1 -1
  17. sphinx/cmd/build.py +1 -1
  18. sphinx/cmd/quickstart.py +11 -11
  19. sphinx/config.py +57 -38
  20. sphinx/directives/__init__.py +7 -9
  21. sphinx/directives/code.py +12 -15
  22. sphinx/directives/other.py +12 -15
  23. sphinx/directives/patches.py +26 -0
  24. sphinx/domains/__init__.py +1 -1
  25. sphinx/domains/c/__init__.py +5 -5
  26. sphinx/domains/c/_ast.py +436 -12
  27. sphinx/domains/c/_symbol.py +89 -134
  28. sphinx/domains/changeset.py +3 -4
  29. sphinx/domains/cpp/__init__.py +5 -6
  30. sphinx/domains/cpp/_ast.py +822 -25
  31. sphinx/domains/cpp/_symbol.py +3 -0
  32. sphinx/domains/javascript.py +3 -6
  33. sphinx/domains/math.py +3 -2
  34. sphinx/domains/python/__init__.py +45 -6
  35. sphinx/domains/python/_object.py +7 -5
  36. sphinx/domains/rst.py +2 -2
  37. sphinx/domains/std/__init__.py +95 -14
  38. sphinx/environment/__init__.py +35 -15
  39. sphinx/environment/adapters/indexentries.py +71 -24
  40. sphinx/environment/adapters/toctree.py +1 -1
  41. sphinx/environment/collectors/__init__.py +18 -4
  42. sphinx/environment/collectors/asset.py +4 -4
  43. sphinx/environment/collectors/toctree.py +27 -14
  44. sphinx/events.py +7 -6
  45. sphinx/ext/apidoc.py +377 -170
  46. sphinx/ext/autodoc/__init__.py +13 -13
  47. sphinx/ext/autodoc/directive.py +10 -13
  48. sphinx/ext/autodoc/mock.py +10 -7
  49. sphinx/ext/autodoc/preserve_defaults.py +1 -1
  50. sphinx/ext/autodoc/typehints.py +2 -2
  51. sphinx/ext/autosummary/__init__.py +15 -9
  52. sphinx/ext/autosummary/generate.py +270 -154
  53. sphinx/ext/coverage.py +108 -18
  54. sphinx/ext/duration.py +10 -3
  55. sphinx/ext/extlinks.py +3 -2
  56. sphinx/ext/graphviz.py +3 -3
  57. sphinx/ext/ifconfig.py +1 -2
  58. sphinx/ext/imgconverter.py +1 -0
  59. sphinx/ext/imgmath.py +7 -6
  60. sphinx/ext/inheritance_diagram.py +3 -3
  61. sphinx/ext/intersphinx/__init__.py +81 -0
  62. sphinx/ext/intersphinx/__main__.py +10 -0
  63. sphinx/ext/intersphinx/_cli.py +44 -0
  64. sphinx/ext/intersphinx/_load.py +253 -0
  65. sphinx/ext/{intersphinx.py → intersphinx/_resolve.py} +17 -368
  66. sphinx/ext/intersphinx/_shared.py +53 -0
  67. sphinx/ext/mathjax.py +1 -1
  68. sphinx/ext/todo.py +2 -2
  69. sphinx/io.py +2 -6
  70. sphinx/locale/__init__.py +1 -5
  71. sphinx/locale/ar/LC_MESSAGES/sphinx.js +1 -1
  72. sphinx/locale/ar/LC_MESSAGES/sphinx.mo +0 -0
  73. sphinx/locale/ar/LC_MESSAGES/sphinx.po +678 -471
  74. sphinx/locale/bg/LC_MESSAGES/sphinx.js +1 -1
  75. sphinx/locale/bg/LC_MESSAGES/sphinx.mo +0 -0
  76. sphinx/locale/bg/LC_MESSAGES/sphinx.po +684 -476
  77. sphinx/locale/bn/LC_MESSAGES/sphinx.js +1 -1
  78. sphinx/locale/bn/LC_MESSAGES/sphinx.mo +0 -0
  79. sphinx/locale/bn/LC_MESSAGES/sphinx.po +679 -472
  80. sphinx/locale/ca/LC_MESSAGES/sphinx.js +1 -1
  81. sphinx/locale/ca/LC_MESSAGES/sphinx.mo +0 -0
  82. sphinx/locale/ca/LC_MESSAGES/sphinx.po +681 -474
  83. sphinx/locale/cak/LC_MESSAGES/sphinx.js +1 -1
  84. sphinx/locale/cak/LC_MESSAGES/sphinx.mo +0 -0
  85. sphinx/locale/cak/LC_MESSAGES/sphinx.po +678 -471
  86. sphinx/locale/cs/LC_MESSAGES/sphinx.js +1 -1
  87. sphinx/locale/cs/LC_MESSAGES/sphinx.mo +0 -0
  88. sphinx/locale/cs/LC_MESSAGES/sphinx.po +679 -472
  89. sphinx/locale/cy/LC_MESSAGES/sphinx.js +1 -1
  90. sphinx/locale/cy/LC_MESSAGES/sphinx.mo +0 -0
  91. sphinx/locale/cy/LC_MESSAGES/sphinx.po +679 -472
  92. sphinx/locale/da/LC_MESSAGES/sphinx.js +1 -1
  93. sphinx/locale/da/LC_MESSAGES/sphinx.mo +0 -0
  94. sphinx/locale/da/LC_MESSAGES/sphinx.po +679 -472
  95. sphinx/locale/de/LC_MESSAGES/sphinx.js +1 -1
  96. sphinx/locale/de/LC_MESSAGES/sphinx.mo +0 -0
  97. sphinx/locale/de/LC_MESSAGES/sphinx.po +679 -472
  98. sphinx/locale/de_DE/LC_MESSAGES/sphinx.js +1 -1
  99. sphinx/locale/de_DE/LC_MESSAGES/sphinx.mo +0 -0
  100. sphinx/locale/de_DE/LC_MESSAGES/sphinx.po +678 -471
  101. sphinx/locale/el/LC_MESSAGES/sphinx.js +1 -1
  102. sphinx/locale/el/LC_MESSAGES/sphinx.mo +0 -0
  103. sphinx/locale/el/LC_MESSAGES/sphinx.po +701 -494
  104. sphinx/locale/en_DE/LC_MESSAGES/sphinx.js +1 -1
  105. sphinx/locale/en_DE/LC_MESSAGES/sphinx.mo +0 -0
  106. sphinx/locale/en_DE/LC_MESSAGES/sphinx.po +700 -493
  107. sphinx/locale/en_FR/LC_MESSAGES/sphinx.js +1 -1
  108. sphinx/locale/en_FR/LC_MESSAGES/sphinx.mo +0 -0
  109. sphinx/locale/en_FR/LC_MESSAGES/sphinx.po +700 -493
  110. sphinx/locale/en_GB/LC_MESSAGES/sphinx.js +1 -1
  111. sphinx/locale/en_GB/LC_MESSAGES/sphinx.mo +0 -0
  112. sphinx/locale/en_GB/LC_MESSAGES/sphinx.po +701 -494
  113. sphinx/locale/en_HK/LC_MESSAGES/sphinx.js +1 -1
  114. sphinx/locale/en_HK/LC_MESSAGES/sphinx.mo +0 -0
  115. sphinx/locale/en_HK/LC_MESSAGES/sphinx.po +700 -493
  116. sphinx/locale/eo/LC_MESSAGES/sphinx.js +1 -1
  117. sphinx/locale/eo/LC_MESSAGES/sphinx.mo +0 -0
  118. sphinx/locale/eo/LC_MESSAGES/sphinx.po +701 -494
  119. sphinx/locale/es/LC_MESSAGES/sphinx.js +1 -1
  120. sphinx/locale/es/LC_MESSAGES/sphinx.mo +0 -0
  121. sphinx/locale/es/LC_MESSAGES/sphinx.po +701 -494
  122. sphinx/locale/es_CO/LC_MESSAGES/sphinx.js +1 -1
  123. sphinx/locale/es_CO/LC_MESSAGES/sphinx.mo +0 -0
  124. sphinx/locale/es_CO/LC_MESSAGES/sphinx.po +700 -493
  125. sphinx/locale/et/LC_MESSAGES/sphinx.js +1 -1
  126. sphinx/locale/et/LC_MESSAGES/sphinx.mo +0 -0
  127. sphinx/locale/et/LC_MESSAGES/sphinx.po +701 -494
  128. sphinx/locale/eu/LC_MESSAGES/sphinx.js +1 -1
  129. sphinx/locale/eu/LC_MESSAGES/sphinx.mo +0 -0
  130. sphinx/locale/eu/LC_MESSAGES/sphinx.po +701 -494
  131. sphinx/locale/fa/LC_MESSAGES/sphinx.js +1 -1
  132. sphinx/locale/fa/LC_MESSAGES/sphinx.mo +0 -0
  133. sphinx/locale/fa/LC_MESSAGES/sphinx.po +701 -494
  134. sphinx/locale/fi/LC_MESSAGES/sphinx.js +1 -1
  135. sphinx/locale/fi/LC_MESSAGES/sphinx.mo +0 -0
  136. sphinx/locale/fi/LC_MESSAGES/sphinx.po +700 -493
  137. sphinx/locale/fr/LC_MESSAGES/sphinx.js +1 -1
  138. sphinx/locale/fr/LC_MESSAGES/sphinx.mo +0 -0
  139. sphinx/locale/fr/LC_MESSAGES/sphinx.po +725 -518
  140. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.js +1 -1
  141. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.mo +0 -0
  142. sphinx/locale/fr_FR/LC_MESSAGES/sphinx.po +700 -493
  143. sphinx/locale/gl/LC_MESSAGES/sphinx.js +1 -1
  144. sphinx/locale/gl/LC_MESSAGES/sphinx.mo +0 -0
  145. sphinx/locale/gl/LC_MESSAGES/sphinx.po +701 -494
  146. sphinx/locale/he/LC_MESSAGES/sphinx.js +1 -1
  147. sphinx/locale/he/LC_MESSAGES/sphinx.mo +0 -0
  148. sphinx/locale/he/LC_MESSAGES/sphinx.po +700 -493
  149. sphinx/locale/hi/LC_MESSAGES/sphinx.js +1 -1
  150. sphinx/locale/hi/LC_MESSAGES/sphinx.mo +0 -0
  151. sphinx/locale/hi/LC_MESSAGES/sphinx.po +701 -494
  152. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.js +1 -1
  153. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.mo +0 -0
  154. sphinx/locale/hi_IN/LC_MESSAGES/sphinx.po +700 -493
  155. sphinx/locale/hr/LC_MESSAGES/sphinx.js +1 -1
  156. sphinx/locale/hr/LC_MESSAGES/sphinx.mo +0 -0
  157. sphinx/locale/hr/LC_MESSAGES/sphinx.po +701 -494
  158. sphinx/locale/hu/LC_MESSAGES/sphinx.js +1 -1
  159. sphinx/locale/hu/LC_MESSAGES/sphinx.mo +0 -0
  160. sphinx/locale/hu/LC_MESSAGES/sphinx.po +701 -494
  161. sphinx/locale/id/LC_MESSAGES/sphinx.js +1 -1
  162. sphinx/locale/id/LC_MESSAGES/sphinx.mo +0 -0
  163. sphinx/locale/id/LC_MESSAGES/sphinx.po +701 -494
  164. sphinx/locale/is/LC_MESSAGES/sphinx.js +1 -1
  165. sphinx/locale/is/LC_MESSAGES/sphinx.mo +0 -0
  166. sphinx/locale/is/LC_MESSAGES/sphinx.po +700 -493
  167. sphinx/locale/it/LC_MESSAGES/sphinx.js +1 -1
  168. sphinx/locale/it/LC_MESSAGES/sphinx.mo +0 -0
  169. sphinx/locale/it/LC_MESSAGES/sphinx.po +708 -500
  170. sphinx/locale/ja/LC_MESSAGES/sphinx.js +1 -1
  171. sphinx/locale/ja/LC_MESSAGES/sphinx.mo +0 -0
  172. sphinx/locale/ja/LC_MESSAGES/sphinx.po +701 -494
  173. sphinx/locale/ka/LC_MESSAGES/sphinx.js +1 -1
  174. sphinx/locale/ka/LC_MESSAGES/sphinx.mo +0 -0
  175. sphinx/locale/ka/LC_MESSAGES/sphinx.po +700 -493
  176. sphinx/locale/ko/LC_MESSAGES/sphinx.js +1 -1
  177. sphinx/locale/ko/LC_MESSAGES/sphinx.mo +0 -0
  178. sphinx/locale/ko/LC_MESSAGES/sphinx.po +701 -494
  179. sphinx/locale/lt/LC_MESSAGES/sphinx.js +1 -1
  180. sphinx/locale/lt/LC_MESSAGES/sphinx.mo +0 -0
  181. sphinx/locale/lt/LC_MESSAGES/sphinx.po +701 -494
  182. sphinx/locale/lv/LC_MESSAGES/sphinx.js +1 -1
  183. sphinx/locale/lv/LC_MESSAGES/sphinx.mo +0 -0
  184. sphinx/locale/lv/LC_MESSAGES/sphinx.po +701 -494
  185. sphinx/locale/mk/LC_MESSAGES/sphinx.js +1 -1
  186. sphinx/locale/mk/LC_MESSAGES/sphinx.mo +0 -0
  187. sphinx/locale/mk/LC_MESSAGES/sphinx.po +700 -493
  188. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.js +1 -1
  189. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo +0 -0
  190. sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po +701 -494
  191. sphinx/locale/ne/LC_MESSAGES/sphinx.js +1 -1
  192. sphinx/locale/ne/LC_MESSAGES/sphinx.mo +0 -0
  193. sphinx/locale/ne/LC_MESSAGES/sphinx.po +701 -494
  194. sphinx/locale/nl/LC_MESSAGES/sphinx.js +1 -1
  195. sphinx/locale/nl/LC_MESSAGES/sphinx.mo +0 -0
  196. sphinx/locale/nl/LC_MESSAGES/sphinx.po +701 -494
  197. sphinx/locale/pl/LC_MESSAGES/sphinx.js +1 -1
  198. sphinx/locale/pl/LC_MESSAGES/sphinx.mo +0 -0
  199. sphinx/locale/pl/LC_MESSAGES/sphinx.po +701 -494
  200. sphinx/locale/pt/LC_MESSAGES/sphinx.js +1 -1
  201. sphinx/locale/pt/LC_MESSAGES/sphinx.mo +0 -0
  202. sphinx/locale/pt/LC_MESSAGES/sphinx.po +700 -493
  203. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.js +1 -1
  204. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +0 -0
  205. sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +705 -498
  206. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.js +1 -1
  207. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.mo +0 -0
  208. sphinx/locale/pt_PT/LC_MESSAGES/sphinx.po +701 -494
  209. sphinx/locale/ro/LC_MESSAGES/sphinx.js +1 -1
  210. sphinx/locale/ro/LC_MESSAGES/sphinx.mo +0 -0
  211. sphinx/locale/ro/LC_MESSAGES/sphinx.po +701 -494
  212. sphinx/locale/ru/LC_MESSAGES/sphinx.js +1 -1
  213. sphinx/locale/ru/LC_MESSAGES/sphinx.mo +0 -0
  214. sphinx/locale/ru/LC_MESSAGES/sphinx.po +890 -680
  215. sphinx/locale/si/LC_MESSAGES/sphinx.js +1 -1
  216. sphinx/locale/si/LC_MESSAGES/sphinx.mo +0 -0
  217. sphinx/locale/si/LC_MESSAGES/sphinx.po +700 -493
  218. sphinx/locale/sk/LC_MESSAGES/sphinx.js +1 -1
  219. sphinx/locale/sk/LC_MESSAGES/sphinx.mo +0 -0
  220. sphinx/locale/sk/LC_MESSAGES/sphinx.po +701 -494
  221. sphinx/locale/sl/LC_MESSAGES/sphinx.js +1 -1
  222. sphinx/locale/sl/LC_MESSAGES/sphinx.mo +0 -0
  223. sphinx/locale/sl/LC_MESSAGES/sphinx.po +701 -494
  224. sphinx/locale/sphinx.pot +702 -494
  225. sphinx/locale/sq/LC_MESSAGES/sphinx.js +1 -1
  226. sphinx/locale/sq/LC_MESSAGES/sphinx.mo +0 -0
  227. sphinx/locale/sq/LC_MESSAGES/sphinx.po +704 -497
  228. sphinx/locale/sr/LC_MESSAGES/sphinx.js +1 -1
  229. sphinx/locale/sr/LC_MESSAGES/sphinx.mo +0 -0
  230. sphinx/locale/sr/LC_MESSAGES/sphinx.po +700 -493
  231. sphinx/locale/sr@latin/LC_MESSAGES/sphinx.mo +0 -0
  232. sphinx/locale/sr_RS/LC_MESSAGES/sphinx.mo +0 -0
  233. sphinx/locale/sv/LC_MESSAGES/sphinx.js +1 -1
  234. sphinx/locale/sv/LC_MESSAGES/sphinx.mo +0 -0
  235. sphinx/locale/sv/LC_MESSAGES/sphinx.po +701 -494
  236. sphinx/locale/ta/LC_MESSAGES/sphinx.po +1016 -808
  237. sphinx/locale/te/LC_MESSAGES/sphinx.js +1 -1
  238. sphinx/locale/te/LC_MESSAGES/sphinx.mo +0 -0
  239. sphinx/locale/te/LC_MESSAGES/sphinx.po +700 -493
  240. sphinx/locale/tr/LC_MESSAGES/sphinx.js +1 -1
  241. sphinx/locale/tr/LC_MESSAGES/sphinx.mo +0 -0
  242. sphinx/locale/tr/LC_MESSAGES/sphinx.po +701 -494
  243. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.js +1 -1
  244. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +0 -0
  245. sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +701 -494
  246. sphinx/locale/ur/LC_MESSAGES/sphinx.js +1 -1
  247. sphinx/locale/ur/LC_MESSAGES/sphinx.mo +0 -0
  248. sphinx/locale/ur/LC_MESSAGES/sphinx.po +700 -493
  249. sphinx/locale/vi/LC_MESSAGES/sphinx.js +1 -1
  250. sphinx/locale/vi/LC_MESSAGES/sphinx.mo +0 -0
  251. sphinx/locale/vi/LC_MESSAGES/sphinx.po +701 -494
  252. sphinx/locale/yue/LC_MESSAGES/sphinx.js +1 -1
  253. sphinx/locale/yue/LC_MESSAGES/sphinx.mo +0 -0
  254. sphinx/locale/yue/LC_MESSAGES/sphinx.po +700 -493
  255. sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +704 -496
  256. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.js +1 -1
  257. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.mo +0 -0
  258. sphinx/locale/zh_HK/LC_MESSAGES/sphinx.po +700 -493
  259. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.js +1 -1
  260. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +0 -0
  261. sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +729 -522
  262. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.js +1 -1
  263. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.mo +0 -0
  264. sphinx/locale/zh_TW.Big5/LC_MESSAGES/sphinx.po +700 -493
  265. sphinx/roles.py +1 -1
  266. sphinx/search/__init__.py +17 -9
  267. sphinx/templates/quickstart/{root_doc.rst_t → root_doc.rst.jinja} +7 -10
  268. sphinx/testing/fixtures.py +22 -20
  269. sphinx/testing/path.py +6 -2
  270. sphinx/testing/util.py +8 -13
  271. sphinx/texinputs/sphinx.sty +449 -332
  272. sphinx/texinputs/sphinxlatexadmonitions.sty +209 -66
  273. sphinx/texinputs/sphinxlatexliterals.sty +9 -16
  274. sphinx/texinputs/sphinxlatexstyletext.sty +4 -38
  275. sphinx/texinputs/sphinxlatextables.sty +6 -14
  276. sphinx/texinputs/sphinxpackageboxes.sty +15 -42
  277. sphinx/texinputs/sphinxpackagefootnote.sty +4 -3
  278. sphinx/themes/agogo/layout.html +3 -3
  279. sphinx/themes/basic/genindex-single.html +2 -1
  280. sphinx/themes/basic/layout.html +3 -6
  281. sphinx/themes/basic/static/searchtools.js +4 -3
  282. sphinx/themes/haiku/layout.html +4 -4
  283. sphinx/themes/pyramid/layout.html +1 -1
  284. sphinx/themes/scrolls/layout.html +2 -2
  285. sphinx/theming.py +42 -7
  286. sphinx/transforms/__init__.py +34 -20
  287. sphinx/transforms/i18n.py +8 -7
  288. sphinx/transforms/post_transforms/__init__.py +1 -1
  289. sphinx/transforms/post_transforms/images.py +7 -10
  290. sphinx/util/_pathlib.py +2 -2
  291. sphinx/util/cfamily.py +52 -30
  292. sphinx/util/console.py +1 -1
  293. sphinx/util/display.py +16 -11
  294. sphinx/util/docutils.py +88 -40
  295. sphinx/util/fileutil.py +15 -3
  296. sphinx/util/images.py +1 -0
  297. sphinx/util/inspect.py +66 -22
  298. sphinx/util/inventory.py +15 -0
  299. sphinx/util/logging.py +14 -21
  300. sphinx/util/math.py +3 -1
  301. sphinx/util/nodes.py +9 -12
  302. sphinx/util/osutil.py +5 -5
  303. sphinx/util/parsing.py +93 -0
  304. sphinx/util/tags.py +71 -47
  305. sphinx/util/typing.py +261 -143
  306. sphinx/versioning.py +17 -17
  307. sphinx/writers/html5.py +26 -19
  308. sphinx/writers/latex.py +58 -28
  309. sphinx/writers/manpage.py +4 -3
  310. sphinx/writers/texinfo.py +19 -14
  311. {sphinx-7.3.6.dist-info → sphinx-7.4.0.dist-info}/METADATA +21 -20
  312. sphinx-7.4.0.dist-info/RECORD +591 -0
  313. sphinx-7.3.6.dist-info/RECORD +0 -581
  314. /sphinx/templates/apidoc/{module.rst_t → module.rst.jinja} +0 -0
  315. /sphinx/templates/apidoc/{package.rst_t → package.rst.jinja} +0 -0
  316. /sphinx/templates/apidoc/{toc.rst_t → toc.rst.jinja} +0 -0
  317. /sphinx/templates/epub3/{content.opf_t → content.opf.jinja} +0 -0
  318. /sphinx/templates/epub3/{nav.xhtml_t → nav.xhtml.jinja} +0 -0
  319. /sphinx/templates/epub3/{toc.ncx_t → toc.ncx.jinja} +0 -0
  320. /sphinx/templates/gettext/{message.pot_t → message.pot.jinja} +0 -0
  321. /sphinx/templates/imgmath/{preview.tex_t → preview.tex.jinja} +0 -0
  322. /sphinx/templates/imgmath/{template.tex_t → template.tex.jinja} +0 -0
  323. /sphinx/templates/latex/{latex.tex_t → latex.tex.jinja} +0 -0
  324. /sphinx/templates/latex/{longtable.tex_t → longtable.tex.jinja} +0 -0
  325. /sphinx/templates/latex/{sphinxmessages.sty_t → sphinxmessages.sty.jinja} +0 -0
  326. /sphinx/templates/latex/{tabular.tex_t → tabular.tex.jinja} +0 -0
  327. /sphinx/templates/latex/{tabulary.tex_t → tabulary.tex.jinja} +0 -0
  328. /sphinx/templates/quickstart/{Makefile_t → Makefile.jinja} +0 -0
  329. /sphinx/templates/quickstart/{Makefile.new_t → Makefile.new.jinja} +0 -0
  330. /sphinx/templates/quickstart/{conf.py_t → conf.py.jinja} +0 -0
  331. /sphinx/templates/quickstart/{make.bat_t → make.bat.jinja} +0 -0
  332. /sphinx/templates/quickstart/{make.bat.new_t → make.bat.new.jinja} +0 -0
  333. /sphinx/texinputs/{Makefile_t → Makefile.jinja} +0 -0
  334. /sphinx/texinputs/{latexmkjarc_t → latexmkjarc.jinja} +0 -0
  335. /sphinx/texinputs/{latexmkrc_t → latexmkrc.jinja} +0 -0
  336. /sphinx/texinputs/{make.bat_t → make.bat.jinja} +0 -0
  337. /sphinx/texinputs_win/{Makefile_t → Makefile.jinja} +0 -0
  338. /sphinx/themes/agogo/static/{agogo.css_t → agogo.css.jinja} +0 -0
  339. /sphinx/themes/basic/static/{basic.css_t → basic.css.jinja} +0 -0
  340. /sphinx/themes/basic/static/{documentation_options.js_t → documentation_options.js.jinja} +0 -0
  341. /sphinx/themes/basic/static/{language_data.js_t → language_data.js.jinja} +0 -0
  342. /sphinx/themes/bizstyle/static/{bizstyle.css_t → bizstyle.css.jinja} +0 -0
  343. /sphinx/themes/bizstyle/static/{bizstyle.js_t → bizstyle.js.jinja} +0 -0
  344. /sphinx/themes/classic/static/{classic.css_t → classic.css.jinja} +0 -0
  345. /sphinx/themes/classic/static/{sidebar.js_t → sidebar.js.jinja} +0 -0
  346. /sphinx/themes/epub/static/{epub.css_t → epub.css.jinja} +0 -0
  347. /sphinx/themes/haiku/static/{haiku.css_t → haiku.css.jinja} +0 -0
  348. /sphinx/themes/nature/static/{nature.css_t → nature.css.jinja} +0 -0
  349. /sphinx/themes/nonav/static/{nonav.css_t → nonav.css.jinja} +0 -0
  350. /sphinx/themes/pyramid/static/{epub.css_t → epub.css.jinja} +0 -0
  351. /sphinx/themes/pyramid/static/{pyramid.css_t → pyramid.css.jinja} +0 -0
  352. /sphinx/themes/scrolls/static/{scrolls.css_t → scrolls.css.jinja} +0 -0
  353. /sphinx/themes/sphinxdoc/static/{sphinxdoc.css_t → sphinxdoc.css.jinja} +0 -0
  354. /sphinx/themes/traditional/static/{traditional.css_t → traditional.css.jinja} +0 -0
  355. {sphinx-7.3.6.dist-info → sphinx-7.4.0.dist-info}/LICENSE.rst +0 -0
  356. {sphinx-7.3.6.dist-info → sphinx-7.4.0.dist-info}/WHEEL +0 -0
  357. {sphinx-7.3.6.dist-info → sphinx-7.4.0.dist-info}/entry_points.txt +0 -0
@@ -3,10 +3,13 @@
3
3
  %
4
4
  % Adapted from the old python.sty, mostly written by Fred Drake,
5
5
  % by Georg Brandl.
6
- %
6
+ % This has now grown to become a full-fledged LaTeX support, split
7
+ % among multiple files, some of which provide features unavailable
8
+ % from usual LaTeX packages in interaction with the mark-up produced
9
+ % by the Sphinx LaTeX writer.
7
10
 
8
11
  \NeedsTeXFormat{LaTeX2e}[1995/12/01]
9
- \ProvidesPackage{sphinx}[2023/03/19 v6.2.0 LaTeX package (Sphinx markup)]
12
+ \ProvidesPackage{sphinx}[2024/07/01 v7.4.0 Sphinx LaTeX package (sphinx-doc)]
10
13
 
11
14
  % provides \ltx@ifundefined
12
15
  % (many packages load ltxcmds: graphicx does for pdftex and lualatex but
@@ -34,26 +37,26 @@
34
37
  }
35
38
  %% important build warnings use an undefined reference to induce latexmk
36
39
  %% into complaining (once per warning) at very end of console output
37
- \newcommand\sphinxbuildwarning[1]{%
38
- \ifcsname sphinx_emitted_#1\endcsname
40
+ \newcommand\sphinxbuildwarning[2][]{%
41
+ \ifcsname sphinx_emitted_#2\endcsname
39
42
  \else
40
- \global\expandafter\let\csname sphinx_emitted_#1\endcsname\@empty
43
+ \global\expandafter\let\csname sphinx_emitted_#2\endcsname\@empty
41
44
  \AtEndDocument{\hbox{% should the printing of text be made conditional on
42
- % some boolean?
45
+ % some boolean? (7.4.0 answers this by adding an
46
+ % optional argument and testing it here for emptiness
47
+ % but no usage is made of this novelty yet.)
48
+ \if\relax\detokenize{#1}\relax
49
+ % No [], print a red warning text at very end of document
43
50
  \bfseries\color{red}%
44
- \@nameuse{sphinx_buildwarning_#1}%
51
+ \@nameuse{sphinx_buildwarning_#2}%
52
+ \fi
45
53
  % place an undefined reference deliberately
46
54
  \let\nfss@text\@gobble % no ??
47
- \ref{!!\@nameuse{sphinx_buildwarning_#1}}%
48
- }}%
55
+ \ref{!!\@nameuse{sphinx_buildwarning_#2}}%
56
+ }%
57
+ }%
49
58
  \fi
50
59
  }
51
- \@namedef{sphinx_buildwarning_coloursyntax}{%
52
- The colours whose definition used xcolor syntax were set to white
53
- as xcolor was not found; check the latex log warnings for details}
54
- \@namedef{sphinx_buildwarning_colorblend}{%
55
- Command \string\sphinxcolorblend\space seen but ignored in tables
56
- as xcolor was not found; check the latex log warnings for details}
57
60
  \@namedef{sphinx_buildwarning_badtitlesec}{%
58
61
  Your system has titlesec version 2.10.1 which causes disappearance
59
62
  of section numbers; check the latex log warning for details}
@@ -63,29 +66,28 @@
63
66
  \@namedef{sphinx_buildwarning_badfootnotes}{%
64
67
  Footnote rendering may have had problems, due to extra package or
65
68
  document class; check latex log for instructions}%
66
-
69
+ \@namedef{sphinx_buildwarning_badiconpackage}{%
70
+ You have set iconpackage=\spx@opt@iconpackage, but this LaTeX package
71
+ is not found}%
67
72
 
68
73
  %% OPTION HANDLING
69
74
  %
70
-
71
75
  % We generally first handle options then load packages, but we need
72
- % \definecolor from xcolor/color to handle the options.
76
+ % \definecolor and \colorlet from xcolor to handle the options.
73
77
 
78
+ % Support for colour options
79
+ % --------------------------
80
+ % At 7.4.0, package xcolor is required (which has allowed to get rid of
81
+ % annoying fall-back branches). Internals here got refactored to some extent.
82
+ %
74
83
  % MEMO: xcolor \fcolorbox coloured boxes render better in some PDF viewers
75
84
  % than with color package \fcolorbox. Since 1.6.3, Sphinx uses only its own
76
85
  % custom variant of \fcolorbox when handling code-blocks. But \fcolorbox
77
- % appears also in Pygmentize output mark-up. Also, since 5.3.0, 'sphinxsetup'
78
- % color options get a richer input syntax if Sphinx knows xcolor is loaded,
79
- % and the \sphinxcolorblend (for tables) is made available only if xcolor is
80
- % loaded.
81
- \IfFileExists{xcolor.sty}{
86
+ % appears also in Pygmentize output mark-up.
82
87
  % Should Sphinx load xcolor with its dvipsnames and svgnames options?
83
- \RequirePackage{xcolor}
84
- }{
85
- \RequirePackage{color}
86
- }
88
+ \RequirePackage{xcolor}
87
89
 
88
- % the \colorlet of xcolor (if at all loaded) is overkill for most internal use
90
+ % the \colorlet of xcolor is overkill for our internal usage here
89
91
  \newcommand{\sphinxcolorlet}[2]
90
92
  {\expandafter\let\csname\@backslashchar color@#1\expandafter\endcsname
91
93
  \csname\@backslashchar color@#2\endcsname }
@@ -93,6 +95,8 @@
93
95
  % (5.3.0) Allow colour options to use both the \definecolor and the \colorlet
94
96
  % syntaxes, for example VerbatimColor={gray}{0.9} or VerbatimColor=red!10
95
97
  % In the latter case we need the real \colorlet from xcolor package.
98
+ % Prior to 7.4.0 xcolor was not required and thus \spx@colorlet was configured
99
+ % to raise a warning in case of absence of xcolor.
96
100
  \def\spx@defineorletcolor#1{%
97
101
  \def\spx@definedcolor{{#1}}%
98
102
  \futurelet\spx@token\spx@defineorlet}
@@ -101,21 +105,17 @@
101
105
  \expandafter\spx@definecolor\else\expandafter\spx@colorlet\fi}
102
106
  \def\spx@colorlet#1\relax{\expandafter\colorlet\spx@definedcolor{#1}}
103
107
  \def\spx@definecolor{\expandafter\definecolor\spx@definedcolor}
104
- %
105
- \@ifpackageloaded{xcolor}%
106
- {}%
107
- {% xcolor not loaded because it was not found in the LaTeX installation
108
- \def\spx@colorlet#1\relax{%
109
- \sphinxbuildwarning{coloursyntax}%
110
- \PackageWarning{sphinx}{%
111
- Sorry, the #1 syntax requires package xcolor,\MessageBreak
112
- which was not found on your TeX/LaTeX installation.\MessageBreak
113
- \@spaces\expandafter\@firstofone\spx@definedcolor\MessageBreak
114
- will be set to white}%
115
- \expandafter\definecolor\spx@definedcolor{rgb}{1,1,1}%
116
- }% end of redefinition of \spx@colorlet
117
- }% end of xcolor not found branch
118
-
108
+ % These internals refactored at 7.4.0:
109
+ \newcommand*{\spx@DeclareColorOption}[3][]{%
110
+ % #1 = almost always "sphinx" but left empty for a few for legacy reasons
111
+ % #2 = option name, but internal colour name is #1#2 (i.e. with prefix)
112
+ % #3 = initial default colour with either \definecolor or \colorlet syntax
113
+ % Set the initial default
114
+ \spx@defineorletcolor{#1#2}#3\relax
115
+ % Set the key handler to accept both \definecolor and \colorlet syntax
116
+ % The key name does not have the #1 prefix from the colour name
117
+ \define@key{sphinx}{#2}{\spx@defineorletcolor{#1#2}##1\relax}%
118
+ }%
119
119
 
120
120
  % Handle options via "kvoptions" (later loaded by hyperref anyhow)
121
121
  \RequirePackage{kvoptions}
@@ -159,10 +159,15 @@ will be set to white}%
159
159
  \define@key{sphinx}{bookmarksdepth}{\AtBeginDocument{\hypersetup{bookmarksdepth=#1}}}
160
160
  \AtBeginDocument{\define@key{sphinx}{bookmarksdepth}{\hypersetup{bookmarksdepth=#1}}}
161
161
  % \DeclareBoolOption[false]{usespart}% not used
162
+
163
+ % Code-blocks
164
+ % -----------
165
+ %
162
166
  % INFO: the keys for padding and border widths were extended at 5.1.0,
163
167
  % and legacy names for user interface were kept, but their definitions
164
168
  % are delayed further down. The legacy internally used dimen registers
165
169
  % \sphinxverbatimborder and \sphinxverbatimsep got removed at 6.2.0.
170
+ % More code-blocks related options are found in "CSS" part below.
166
171
  \DeclareBoolOption[true]{verbatimwithframe}
167
172
  \DeclareBoolOption[true]{verbatimwrapslines}
168
173
  \DeclareBoolOption[false]{verbatimforcewraps}
@@ -180,70 +185,50 @@ will be set to white}%
180
185
  \DeclareStringOption % must use braces to hide the brackets
181
186
  [{\makebox[2\fontcharwd\font`\x][r]{\textcolor{red}{\tiny$\m@th\hookrightarrow$}}}]%
182
187
  {verbatimcontinued}
183
- % topic boxes
188
+
189
+ % Topic boxes
190
+ % -----------
184
191
  %
185
192
  % 5.1.0 added new keys for configuration. The legacy keys shadowsep,
186
- % shadowsize, shadowrule were kept for backward compatibility. Unfortunately
187
- % this had bugs due to typos, which got fixed later at 6.1.2.
193
+ % shadowsize, shadowrule were kept for backward compatibility.
194
+ % 5.1.2 fixed some bugs.
188
195
  %
189
196
  % All configuration is now to be found in the "CSS" section below.
190
197
  %
191
- % \sphinxshadowsep, \sphinxshadowsize, \sphinxshadowrule \dimen registers
192
- % became at 5.1.0 either no-op or, for the latter, were used under an aliased
193
- % name. They got removed at 6.2.0.
194
- %
195
- % notices/admonitions
196
- %
197
- % 5.1.0 added much customizability to warning, caution, attention, danger and
198
- % error types of notices via an enhanced sphinxheavybox environment.
199
- %
200
- % 6.2.0 added the possibility to use the same kind of rendering also for
201
- % note, hint, important, and tip.
202
- %
203
- % Legacy user interface for options was kept working. All of it is handled in
204
- % the "CSS" section below.
205
- %
206
- % These 6.2.0 added booleans serve internally. There is no reason for user to
207
- % know about them, except if it is desired to toggle mid-way in the document
208
- % whether note, hint, important, and tip should use the "lightbox" or the
209
- % "heavybox" rendering.
210
- \DeclareBoolOption[false]{heavynote}
211
- \DeclareBoolOption[false]{heavyhint}
212
- \DeclareBoolOption[false]{heavyimportant}
213
- \DeclareBoolOption[false]{heavytip}
214
- % footnotes
198
+ % 6.2.0 removed \sphinxshadowsep, \sphinxshadowsize, \sphinxshadowrule
199
+ % \dimen registers
200
+
201
+ % Footnotes
202
+ % ---------
215
203
  \DeclareStringOption[\mbox{ }]{AtStartFootnote}
216
204
  % we need a public macro name for direct use in latex file
217
205
  \newcommand*{\sphinxAtStartFootnote}{\spx@opt@AtStartFootnote}
218
206
  % no such need for this one, as it is used inside other macros
219
207
  \DeclareStringOption[\leavevmode\unskip]{BeforeFootnote}
220
- % some font styling.
208
+
209
+ % Some font styling
210
+ % -----------------
211
+ % TODO: the replacement of old syntax \py@HeaderFamily as used
212
+ % in sphinxlatexstyle{page,headings}.sty and sphinx{manual,howto}.cls
213
+ % has never been really put in place. Hence this isolated tidbit here.
221
214
  \DeclareStringOption[\sffamily\bfseries]{HeaderFamily}
222
- % colours
223
- % same problems as for dimensions: we want the key handler to use \definecolor.
224
- % first, some colours with no prefix, for backward compatibility
225
- \newcommand*{\sphinxDeclareColorOption}[2]{%
226
- % set the initial default; only \definecolor syntax for defaults!
227
- \definecolor{#1}#2%
228
- % set the key handler to accept both \definecolor and \colorlet syntax
229
- \define@key{sphinx}{#1}{\spx@defineorletcolor{#1}##1\relax}%
230
- }%
231
- \sphinxDeclareColorOption{TitleColor}{{rgb}{0.126,0.263,0.361}}
232
- \sphinxDeclareColorOption{InnerLinkColor}{{rgb}{0.208,0.374,0.486}}
233
- \sphinxDeclareColorOption{OuterLinkColor}{{rgb}{0.216,0.439,0.388}}
234
- \sphinxDeclareColorOption{VerbatimColor}{{gray}{0.95}}
235
- \sphinxDeclareColorOption{VerbatimBorderColor}{{RGB}{32,32,32}}
236
- % all other colours will be named with a "sphinx" prefix
237
- \newcommand*{\sphinxDeclareSphinxColorOption}[2]{%
238
- % set the initial default; only \definecolor syntax for defaults!
239
- \definecolor{sphinx#1}#2%
240
- % set the key handler to accept both \definecolor and \colorlet syntax
241
- \define@key{sphinx}{#1}{\spx@defineorletcolor{sphinx#1}##1\relax}%
242
- }%
243
- % table row colors
244
- \sphinxDeclareSphinxColorOption{TableRowColorHeader}{{gray}{0.86}}
245
- \sphinxDeclareSphinxColorOption{TableRowColorOdd}{{gray}{0.92}}
246
- \sphinxDeclareSphinxColorOption{TableRowColorEven}{{gray}{0.98}}
215
+
216
+ % Some legacy colour options
217
+ % --------------------------
218
+ %
219
+ \spx@DeclareColorOption{TitleColor}{{rgb}{0.126,0.263,0.361}}
220
+ \spx@DeclareColorOption{InnerLinkColor}{{rgb}{0.208,0.374,0.486}}
221
+ \spx@DeclareColorOption{OuterLinkColor}{{rgb}{0.216,0.439,0.388}}
222
+ % The Verbatim ones are "legacy" only since 5.1.0... call it "new-legacy" ;-)
223
+ \spx@DeclareColorOption{VerbatimColor}{{RGB}{242,242,242}}% same as {gray}{0.95}
224
+ \spx@DeclareColorOption{VerbatimBorderColor}{{RGB}{32,32,32}}
225
+ % All other colours will be internally assigned a "sphinx" prefix
226
+
227
+ % Table row colors (since 6.0.0)
228
+ % ----------------
229
+ \spx@DeclareColorOption[sphinx]{TableRowColorHeader}{{gray}{0.86}}
230
+ \spx@DeclareColorOption[sphinx]{TableRowColorOdd}{{gray}{0.92}}
231
+ \spx@DeclareColorOption[sphinx]{TableRowColorEven}{{gray}{0.98}}
247
232
  % if not set, the "Merge" colour will keep in sync with the "Row" colour
248
233
  \def\sphinxTableMergeColorHeader{sphinxTableRowColorHeader}
249
234
  \define@key{sphinx}{TableMergeColorHeader}{%
@@ -261,37 +246,67 @@ will be set to white}%
261
246
  \def\sphinxTableMergeColorEven{sphinxTableMergeColorEven}%
262
247
  }%
263
248
  % Default color chosen to be as in minted.sty LaTeX package!
264
- \sphinxDeclareSphinxColorOption{VerbatimHighlightColor}{{rgb}{0.878,1,1}}
265
- % admonition boxes, "light" style
266
- % border color defaults to black
267
- % at 6.2.0 also background color is possible, but it then triggers
268
- % usage of the "sphinxheavybox" from sphinxlatexadmonitions.sty.
269
- \sphinxDeclareSphinxColorOption{noteBorderColor}{{rgb}{0,0,0}}
270
- \sphinxDeclareSphinxColorOption{hintBorderColor}{{rgb}{0,0,0}}
271
- \sphinxDeclareSphinxColorOption{importantBorderColor}{{rgb}{0,0,0}}
272
- \sphinxDeclareSphinxColorOption{tipBorderColor}{{rgb}{0,0,0}}
273
- \sphinxDeclareSphinxColorOption{noteBgColor}{{rgb}{1,1,1}}
274
- \sphinxDeclareSphinxColorOption{hintBgColor}{{rgb}{1,1,1}}
275
- \sphinxDeclareSphinxColorOption{importantBgColor}{{rgb}{1,1,1}}
276
- \sphinxDeclareSphinxColorOption{tipBgColor}{{rgb}{1,1,1}}
277
- % admonition boxes, "heavy" style
278
- % border color defaults to black and background color to white
279
- % As long as the color are not explicitly set via user options,
280
- % the sphinxpackageboxes.sty code will actually not use them anyhow.
281
- \sphinxDeclareSphinxColorOption{warningBorderColor}{{rgb}{0,0,0}}
282
- \sphinxDeclareSphinxColorOption{cautionBorderColor}{{rgb}{0,0,0}}
283
- \sphinxDeclareSphinxColorOption{attentionBorderColor}{{rgb}{0,0,0}}
284
- \sphinxDeclareSphinxColorOption{dangerBorderColor}{{rgb}{0,0,0}}
285
- \sphinxDeclareSphinxColorOption{errorBorderColor}{{rgb}{0,0,0}}
286
- % BgColor should have been from the start BackgroundColor for better
287
- % match with CSS property names, but this is legacy interface
288
- % which is too late to change because the internal color names
289
- % and not only the option names have been documented at user level.
290
- \sphinxDeclareSphinxColorOption{warningBgColor}{{rgb}{1,1,1}}
291
- \sphinxDeclareSphinxColorOption{cautionBgColor}{{rgb}{1,1,1}}
292
- \sphinxDeclareSphinxColorOption{attentionBgColor}{{rgb}{1,1,1}}
293
- \sphinxDeclareSphinxColorOption{dangerBgColor}{{rgb}{1,1,1}}
294
- \sphinxDeclareSphinxColorOption{errorBgColor}{{rgb}{1,1,1}}
249
+ \spx@DeclareColorOption[sphinx]{VerbatimHighlightColor}{{rgb}{0.878,1,1}}
250
+
251
+ % Notices/admonitions
252
+ % -------------------
253
+ %
254
+ % 5.1.0 added much customizability to warning, caution, attention, danger and
255
+ % error types of notices via an enhanced sphinxheavybox environment.
256
+ %
257
+ % 6.2.0 added the possibility to use the same kind of rendering also for
258
+ % note, hint, important, and tip.
259
+ %
260
+ % Legacy user interface for options was kept working. All of it is handled in
261
+ % the "CSS" section below.
262
+ %
263
+ % 6.2.0 added booleans to serve internally as a record of whether the
264
+ % note, hint, important and tip admonitions used the legacy "lightbox" or
265
+ % the then enhanced "heavybox" environment.
266
+ %
267
+ % 7.4.0 uses "heavybox" environment from sphinxlatexadmonitions in all cases,
268
+ % hence the booleans mentioned above have been removed as well as the rather
269
+ % complex TeX code which was done so that these booleans were made true if
270
+ % and only if the CSS-named keys had been made usage of via 'sphinxsetup'.
271
+ %
272
+ % The "light style" implemented in sphinxlatexadmonitions.sty as
273
+ % "sphinxlightbox" is not used. Also, admonitions by default have a "title
274
+ % row", and the corresponding options are only named in the CSS style which is
275
+ % implemented further below. Here we define options having a legacy name.
276
+ %
277
+ % seealso directive is also using "heavybox" at 7.4.0 acquiring the same
278
+ % customizability as admonitions.
279
+ % todo directive also.
280
+ \definecolor{sphinx-admonition-bgcolor} {RGB}{247, 247, 247}% #F7F7F7
281
+ \definecolor{sphinx-admonition-bordercolor} {RGB}{134, 152, 155}% #86989B
282
+ \definecolor{sphinx-warning-bordercolor} {RGB}{148, 0, 0}% #940000
283
+ \definecolor{sphinx-error-bordercolor} {RGB}{180, 0, 0}% #B40000
284
+ \spx@DeclareColorOption[sphinx]{noteBorderColor} {sphinx-admonition-bordercolor}
285
+ \spx@DeclareColorOption[sphinx]{hintBorderColor} {sphinx-admonition-bordercolor}
286
+ \spx@DeclareColorOption[sphinx]{importantBorderColor}{sphinx-admonition-bordercolor}
287
+ \spx@DeclareColorOption[sphinx]{tipBorderColor} {sphinx-admonition-bordercolor}
288
+ \spx@DeclareColorOption[sphinx]{seealsoBorderColor} {sphinx-admonition-bordercolor}% 7.4.0
289
+ \spx@DeclareColorOption[sphinx]{todoBorderColor} {sphinx-admonition-bordercolor}% 7.4.0
290
+ %
291
+ \spx@DeclareColorOption[sphinx]{noteBgColor} {sphinx-admonition-bgcolor}
292
+ \spx@DeclareColorOption[sphinx]{hintBgColor} {sphinx-admonition-bgcolor}
293
+ \spx@DeclareColorOption[sphinx]{importantBgColor}{sphinx-admonition-bgcolor}
294
+ \spx@DeclareColorOption[sphinx]{tipBgColor} {sphinx-admonition-bgcolor}
295
+ \spx@DeclareColorOption[sphinx]{seealsoBgColor} {sphinx-admonition-bgcolor}% 7.4.0
296
+ \spx@DeclareColorOption[sphinx]{todoBgColor} {sphinx-admonition-bgcolor}% 7.4.0
297
+ %
298
+ \spx@DeclareColorOption[sphinx]{warningBorderColor} {sphinx-warning-bordercolor}
299
+ \spx@DeclareColorOption[sphinx]{cautionBorderColor} {sphinx-warning-bordercolor}
300
+ \spx@DeclareColorOption[sphinx]{attentionBorderColor}{sphinx-warning-bordercolor}
301
+ \spx@DeclareColorOption[sphinx]{dangerBorderColor} {sphinx-warning-bordercolor}
302
+ \spx@DeclareColorOption[sphinx]{errorBorderColor} {sphinx-error-bordercolor}
303
+ %
304
+ \spx@DeclareColorOption[sphinx]{warningBgColor} {sphinx-admonition-bgcolor}
305
+ \spx@DeclareColorOption[sphinx]{cautionBgColor} {sphinx-admonition-bgcolor}
306
+ \spx@DeclareColorOption[sphinx]{attentionBgColor}{sphinx-admonition-bgcolor}
307
+ \spx@DeclareColorOption[sphinx]{dangerBgColor} {sphinx-admonition-bgcolor}
308
+ \spx@DeclareColorOption[sphinx]{errorBgColor} {sphinx-admonition-bgcolor}
309
+ %
295
310
  %%%%%%%%
296
311
  %
297
312
  % Additions of CSS-like keys at 5.1.0 (and possibility of rounded boxes)
@@ -324,14 +339,25 @@ will be set to white}%
324
339
  % finally been removed entirely. No more \dimen register is used here only
325
340
  % storage in macros.
326
341
  %
342
+ % Restyling at 7.4.0 with new defaults for all admonition types
343
+ % -------------------------------------------------------------
344
+ %
345
+ % So far the 5.1.0 added possibilities for fancier boxes had been used by
346
+ % default only for code-blocks, and admonitions kept their old-fashioned
347
+ % legacy styles. At 7.4.0, as a follow-up to the revamped styles of
348
+ % admonitions in the HTML sphinx13 theme (PR #12439), it is decided to
349
+ % apply similar styling for PDF output. Also the seealso directive
350
+ % is handled as an admonition with the same customizability. And the
351
+ % todo directive.
352
+ %
327
353
  \def\spxstring@none{none}
328
354
  \def\spxstring@clone{clone}
329
355
  %
330
356
  % Border keys
331
- %
357
+ % At 7.4.0 refactoring to avoid defining legacy \spx@<type>@border
358
+ % macros which are (now) used nowhere, only @top, @right, @bottom, @left.
332
359
  \def\spx@tempa#1{% #1 = macro prefix
333
360
  \expandafter\spx@tempb
334
- \csname #1border\expandafter\endcsname
335
361
  \csname #1border@top\expandafter\endcsname
336
362
  \csname #1border@right\expandafter\endcsname
337
363
  \csname #1border@bottom\expandafter\endcsname
@@ -340,99 +366,100 @@ will be set to white}%
340
366
  \csname #1border@opentrue\expandafter\endcsname
341
367
  \csname #1border@openfalse\endcsname
342
368
  }%
343
- \def\spx@tempb #1#2#3#4#5#6#7#8#9{% #9 = option prefix
344
- \define@key{sphinx}{#9border-top-width}{\def#2{##1}}%
345
- \define@key{sphinx}{#9border-right-width}{\def#3{##1}}%
346
- \define@key{sphinx}{#9border-bottom-width}{\def#4{##1}}%
347
- \define@key{sphinx}{#9border-left-width}{\def#5{##1}}%
348
- \define@key{sphinx}{#9border-width}{%
349
- \def#1{##1}% MEMO: not immediately expanded, should this be changed?
350
- \def#2{#1}\let#3#2\let#4#2\let#5#2%
369
+ \def\spx@tempb #1#2#3#4#5#6#7#8#9{% #8 = option prefix
370
+ \define@key{sphinx}{#8border-top-width}{\def#1{##1}}%
371
+ \define@key{sphinx}{#8border-right-width}{\def#2{##1}}%
372
+ \define@key{sphinx}{#8border-bottom-width}{\def#3{##1}}%
373
+ \define@key{sphinx}{#8border-left-width}{\def#4{##1}}%
374
+ \define@key{sphinx}{#8border-width}{%
375
+ % MEMO: not immediately expanded, should this be changed?
376
+ \def#1{##1}\let#2#1\let#3#1\let#4#1%
351
377
  }%
352
- \newif#6%
353
- \define@key{sphinx}{#9box-decoration-break}%
378
+ \newif#5%
379
+ % 6.2.0 has added support for box-decoration-break also to admonition
380
+ % directives, formerly the option setting was ignored for them.
381
+ \define@key{sphinx}{#8box-decoration-break}%
354
382
  {\begingroup\edef\spx@tempa{##1}\expandafter\endgroup
355
- \ifx\spx@tempa\spxstring@clone#8\else#7\fi}%
356
- \spx@tempc{#9}% option prefix
357
- }
358
- \def\spx@tempc #1#2{% #1 = option prefix, #2 = legacy option name
383
+ \ifx\spx@tempa\spxstring@clone#7\else#6\fi}%
384
+ % 7.4.0 sets the default behaviour to "slice" not only for code-blocks but
385
+ % also for admonitions, as the latter now have a background colour each.
386
+ #6%
387
+ % #8 = option prefix (with underscore), #9 = legacy option name
359
388
  % keep legacy option names as aliases to new-named options
360
- \expandafter\let\csname KV@sphinx@#2\expandafter\endcsname
361
- \csname KV@sphinx@#1border-width\endcsname
389
+ \expandafter\let\csname KV@sphinx@#9\expandafter\endcsname
390
+ \csname KV@sphinx@#8border-width\endcsname
362
391
  % init border-width (fetches next argument)
363
- \csname KV@sphinx@#1border-width\endcsname
392
+ \csname KV@sphinx@#8border-width\endcsname
364
393
  }
365
- % MEMO: prior to 6.2.0 the \fboxrule value (0.4pt, a priori) was frozen here via
366
- % a \dimen assignment done immediately. Now it remains \fboxrule until being used.
394
+ % MEMO: from 6.2.0 to 7.4.0 (excluive) \fboxrule was used in the first
395
+ % two, and was resolved only at location of use. At 7.4.0, we again
396
+ % use 0.4pt rather and not \fboxrule dimen register.
367
397
  % macro prefix option prefix legacy option init value
368
- \spx@tempa{spx@pre@} {pre_} {verbatimborder} \fboxrule
369
- \spx@tempa{spx@topic@} {div.topic_} {shadowrule} \fboxrule
398
+ \spx@tempa{spx@pre@} {pre_} {verbatimborder} {0.4pt}
399
+ \spx@tempa{spx@topic@} {div.topic_} {shadowrule} {0.5pt}% mod. at 7.4.0
370
400
  \spx@tempa{spx@note@} {div.note_} {noteborder} {0.5pt}
371
401
  \spx@tempa{spx@hint@} {div.hint_} {hintborder} {0.5pt}
372
402
  \spx@tempa{spx@important@}{div.important_}{importantborder}{0.5pt}
373
403
  \spx@tempa{spx@tip@} {div.tip_} {tipborder} {0.5pt}
404
+ \spx@tempa{spx@seealso@} {div.seealso_} {seealsoborder} {0.5pt}% new at 7.4.0
405
+ \spx@tempa{spx@todo@} {div.todo_} {todoborder} {0.5pt}% new at 7.4.0
374
406
  \spx@tempa{spx@warning@} {div.warning_} {warningborder} {1pt}
375
407
  \spx@tempa{spx@caution@} {div.caution_} {cautionborder} {1pt}
376
408
  \spx@tempa{spx@attention@}{div.attention_}{attentionborder}{1pt}
377
409
  \spx@tempa{spx@danger@} {div.danger_} {dangerborder} {1pt}
378
- \spx@tempa{spx@error@} {div.error_} {errorborder} {1pt}
410
+ \spx@tempa{spx@error@} {div.error_} {errorborder} {1.25pt}% mod. at 7.4.0
379
411
  % this one new at 6.2.0: (we do not create a "legacy name" for it)
380
- \spx@tempa{spx@box@} {box_} {box_border-width}\fboxrule
381
- % Set default box-decoration-break style for codeblocks to slice
382
- \spx@pre@border@opentrue % new default at 6.0.0: slice, not clone
383
- % 6.2.0 has added support for box-decoration-break=slice to all
384
- % other directives, formerly the option setting was ignored for them.
412
+ \spx@tempa{spx@box@} {box_} {box_border-width}{0.4pt}
413
+ % Reset default box-decoration-break style to "clone" for \sphinxbox,
414
+ % but anyhow this is ignored as \sphinxbox produces unbreakable boxes.
415
+ \spx@box@border@openfalse
385
416
 
386
417
  % Padding keys
387
- %
418
+ % At 7.4.0, \spx@<type>@padding internal macros removed, only @top, @right,
419
+ % @bottom, @left are actually needed by sphinxpackageboxes.sty.
388
420
  \def\spx@tempa#1{%
389
421
  \expandafter\spx@tempb
390
- \csname #1padding\expandafter\endcsname
391
422
  \csname #1padding@top\expandafter\endcsname
392
423
  \csname #1padding@right\expandafter\endcsname
393
424
  \csname #1padding@bottom\expandafter\endcsname
394
425
  \csname #1padding@left\endcsname
395
426
  }%
396
- \def\spx@tempb #1#2#3#4#5#6{% #6 = option prefix
397
- \define@key{sphinx}{#6padding-top}{\def#2{##1}}%
398
- \define@key{sphinx}{#6padding-right}{\def#3{##1}}%
399
- \define@key{sphinx}{#6padding-bottom}{\def#4{##1}}%
400
- \define@key{sphinx}{#6padding-left}{\def#5{##1}}%
401
- \define@key{sphinx}{#6padding}{%
402
- \def#1{##1}%
403
- \def#2{#1}\let#3#2\let#4#2\let#5#2%
427
+ \def\spx@tempb #1#2#3#4#5#6#7#8#9{% #5 = option prefix
428
+ \define@key{sphinx}{#5padding-top}{\def#1{##1}}%
429
+ \define@key{sphinx}{#5padding-right}{\def#2{##1}}%
430
+ \define@key{sphinx}{#5padding-bottom}{\def#3{##1}}%
431
+ \define@key{sphinx}{#5padding-left}{\def#4{##1}}%
432
+ \define@key{sphinx}{#5padding}{%
433
+ \def#1{##1}\let#2#1\let#3#1\let#4#1%
404
434
  }%
405
- % initialization (will fetch "init" argument next):
406
- \csname KV@sphinx@#6padding\endcsname
435
+ % initial defaults
436
+ \def#1{#6}\def#2{#7}\def#3{#8}\def#4{#9}%
407
437
  }
408
438
  % MEMO: prior to 6.2.0 the \fboxsep value (3pt, a priori) was frozen here via
409
- % a \dimen assignment done immediately. Now it remains \fboxsep until being used.
410
- % #1 macro prefix #6 option prefix init value
411
- \spx@tempa{spx@pre@} {pre_} \fboxsep
412
- \spx@tempa{spx@topic@} {div.topic_} {5pt}
413
- % MEMO: prior to 6.2.0, "note" type admonitions used sphinxlightbox automatically
414
- % and had no interface to set the padding parameters needed by sphinxheavybox.
415
- % At 6.2.0 they acquired such interface and the default is set as for legacy
416
- % default of "warning" type. I hesitated using \fboxsep, but if I did I would
417
- % then need to explain how to change "note etc..." into behaving exactly
418
- % as "warning etc...", which goes via the \dimexpr here which is too scary to
419
- % put sanely into documentation.
420
- \spx@tempa{spx@note@} {div.note_} {\dimexpr.6\baselineskip-\spx@note@border\relax}
421
- \spx@tempa{spx@hint@} {div.hint_} {\dimexpr.6\baselineskip-\spx@hint@border\relax}
422
- \spx@tempa{spx@important@}{div.important_} {\dimexpr.6\baselineskip-\spx@important@border\relax}
423
- \spx@tempa{spx@tip@} {div.tip_} {\dimexpr.6\baselineskip-\spx@tip@border\relax}
424
- % MEMO: prior to 5.1.0 padding was not separately customizable from border
425
- % width for warning type admonitions. The below keeps the legacy behavior of a
426
- % constant borderwidth+padding. The dim expression is not evaluated yet, only
427
- % at time of use (so that it dynamically adapts to the border width setting).
428
- % MEMO: I could use everywhere \spx@notice@border, as sphinxadmonition environment
429
- % configures it to hold the \spx@<type>@border value.
430
- \spx@tempa{spx@warning@} {div.warning_} {\dimexpr.6\baselineskip-\spx@warning@border\relax}
431
- \spx@tempa{spx@caution@} {div.caution_} {\dimexpr.6\baselineskip-\spx@caution@border\relax}
432
- \spx@tempa{spx@attention@}{div.attention_} {\dimexpr.6\baselineskip-\spx@attention@border\relax}
433
- \spx@tempa{spx@danger@} {div.danger_} {\dimexpr.6\baselineskip-\spx@danger@border\relax}
434
- \spx@tempa{spx@error@} {div.error_} {\dimexpr.6\baselineskip-\spx@error@border\relax}
435
- \spx@tempa{spx@box@} {box_} \fboxsep
439
+ % a \dimen assignment done immediately. From 6.2.0 to 7.4.0 an unfrozen
440
+ % \fboxsep was used, and at 7.4.0 it is again explicit 3pt.
441
+ % The defaults for admonitions were all modified at 7.4.0.
442
+ % For topic/contents and all admonitions the horizontal padding plus borders
443
+ % are put inside the text area (i.e. do not go into the margins).
444
+ % In order for perfect exact same vertical alignment of contents from all such
445
+ % directives, the value of horizontal border-width+padding is kept constant
446
+ % (equal to 7.5pt since 7.4.0).
447
+ % #1 macro prefix #6 option prefix top right bottom left
448
+ \spx@tempa{spx@pre@} {pre_} {3pt}{3pt}{3pt}{3pt}
449
+ \spx@tempa{spx@topic@} {div.topic_} {10pt}{7pt}{12pt}{7pt}
450
+ % 7.4.0 drops legacy settings which linked strangely padding with border width
451
+ \spx@tempa{spx@note@} {div.note_} {6pt}{7pt}{6pt}{7pt}
452
+ \spx@tempa{spx@hint@} {div.hint_} {6pt}{7pt}{6pt}{7pt}
453
+ \spx@tempa{spx@important@}{div.important_} {6pt}{7pt}{6pt}{7pt}
454
+ \spx@tempa{spx@tip@} {div.tip_} {6pt}{7pt}{6pt}{7pt}
455
+ \spx@tempa{spx@seealso@} {div.seealso_} {6pt}{7pt}{6pt}{7pt}
456
+ \spx@tempa{spx@todo@} {div.todo_} {6pt}{7pt}{6pt}{7pt}
457
+ \spx@tempa{spx@warning@} {div.warning_} {6pt}{6.5pt}{6pt}{6.5pt}
458
+ \spx@tempa{spx@caution@} {div.caution_} {6pt}{6.5pt}{6pt}{6.5pt}
459
+ \spx@tempa{spx@attention@}{div.attention_} {6pt}{6.5pt}{6pt}{6.5pt}
460
+ \spx@tempa{spx@danger@} {div.danger_} {6pt}{6.5pt}{6pt}{6.5pt}
461
+ \spx@tempa{spx@error@} {div.error_} {6pt}{6.25pt}{6pt}{6.25pt}
462
+ \spx@tempa{spx@box@} {box_} {3pt}{3pt}{3pt}{3pt}
436
463
  % define legacy verbatimsep key as alias of pre_padding key
437
464
  \expandafter\let\expandafter\KV@sphinx@verbatimsep\csname KV@sphinx@pre_padding\endcsname
438
465
  % define legacy shadowsep key as alias of div.topic_padding key
@@ -450,30 +477,35 @@ will be set to white}%
450
477
  \csname #1radius@bottomright\expandafter\endcsname
451
478
  \csname #1radius@bottomleft\endcsname
452
479
  }%
453
- \def\spx@tempb #1#2#3#4#5{% #5 = option prefix
480
+ \def\spx@tempb #1#2#3#4#5#6#7#8#9{% #5 = option prefix
454
481
  \define@key{sphinx}{#5border-top-left-radius}{\def#1{##1}}%
455
482
  \define@key{sphinx}{#5border-top-right-radius}{\def#2{##1}}%
456
483
  \define@key{sphinx}{#5border-bottom-right-radius}{\def#3{##1}}%
457
484
  \define@key{sphinx}{#5border-bottom-left-radius}{\def#4{##1}}%
458
485
  \define@key{sphinx}{#5border-radius}{\def#1{##1}\let#2#1\let#3#1\let#4#1}%
459
- \csname KV@sphinx@#5border-radius\endcsname % fetches next argument
486
+ \def#1{#6}\def#2{#7}\def#3{#8}\def#4{#9}%
460
487
  }
461
488
  % The init value for corner radius in code-blocks was \z@ (i.e. 0pt) prior
462
- % to 6.0.0., then 3pt, then \fboxsep at 6.2.0 as padding is \fboxsep,
463
- % and \fboxsep=3pt per default (also with platex).
464
- % macro prefix option prefix init value
465
- \spx@tempa{spx@pre@} {pre_} \fboxsep
466
- \spx@tempa{spx@topic@} {div.topic_} \z@
467
- \spx@tempa{spx@note@} {div.note_} \z@
468
- \spx@tempa{spx@hint@} {div.hint_} \z@
469
- \spx@tempa{spx@important@}{div.important_} \z@
470
- \spx@tempa{spx@tip@} {div.tip_} \z@
471
- \spx@tempa{spx@warning@} {div.warning_} \z@
472
- \spx@tempa{spx@caution@} {div.caution_} \z@
473
- \spx@tempa{spx@attention@}{div.attention_} \z@
474
- \spx@tempa{spx@danger@} {div.danger_} \z@
475
- \spx@tempa{spx@error@} {div.error_} \z@
476
- \spx@tempa{spx@box@} {box_} \fboxsep
489
+ % to 6.0.0., then 3pt, then \fboxsep at 6.2.0 as padding was also \fboxsep.
490
+ % At 7.4.0:
491
+ % - the 3pt is used (which is normal value of \fboxsep).
492
+ % - some admonitions use rounded corners as well.
493
+ % - topic boxed have only their bottom right corner rounded.
494
+ % macro prefix option prefix tl tr br bl
495
+ \spx@tempa{spx@pre@} {pre_} {3pt}{3pt}{3pt}{3pt}
496
+ \spx@tempa{spx@topic@} {div.topic_} \z@ \z@ {12pt} \z@
497
+ \spx@tempa{spx@note@} {div.note_} {5pt}{5pt}{5pt}{5pt}
498
+ \spx@tempa{spx@hint@} {div.hint_} {5pt}{5pt}{5pt}{5pt}
499
+ \spx@tempa{spx@important@}{div.important_} \z@\z@\z@\z@
500
+ \spx@tempa{spx@tip@} {div.tip_} {5pt}{5pt}{5pt}{5pt}
501
+ \spx@tempa{spx@seealso@} {div.seealso_} \z@\z@\z@\z@
502
+ \spx@tempa{spx@todo@} {div.todo_} \z@\z@\z@\z@
503
+ \spx@tempa{spx@warning@} {div.warning_} \z@\z@\z@\z@
504
+ \spx@tempa{spx@caution@} {div.caution_} \z@\z@\z@\z@
505
+ \spx@tempa{spx@attention@}{div.attention_} \z@\z@\z@\z@
506
+ \spx@tempa{spx@danger@} {div.danger_} \z@\z@\z@\z@
507
+ \spx@tempa{spx@error@} {div.error_} \z@\z@\z@\z@
508
+ \spx@tempa{spx@box@} {box_} {3pt}{3pt}{3pt}{3pt}
477
509
 
478
510
  % Shadow keys
479
511
  %
@@ -494,6 +526,8 @@ will be set to white}%
494
526
  \spx@tempa{spx@hint@}
495
527
  \spx@tempa{spx@important@}
496
528
  \spx@tempa{spx@tip@}
529
+ \spx@tempa{spx@seealso@}% 7.4.0
530
+ \spx@tempa{spx@todo@}% 7.4.0
497
531
  \spx@tempa{spx@warning@}
498
532
  \spx@tempa{spx@caution@}
499
533
  \spx@tempa{spx@attention@}
@@ -541,6 +575,8 @@ will be set to white}%
541
575
  \spx@tempa{spx@hint@} {div.hint_}
542
576
  \spx@tempa{spx@important@}{div.important_}
543
577
  \spx@tempa{spx@tip@} {div.tip_}
578
+ \spx@tempa{spx@seealso@} {div.seealso_}
579
+ \spx@tempa{spx@todo@} {div.todo_}
544
580
  \spx@tempa{spx@warning@} {div.warning_}
545
581
  \spx@tempa{spx@caution@} {div.caution_}
546
582
  \spx@tempa{spx@attention@}{div.attention_}
@@ -552,7 +588,6 @@ will be set to white}%
552
588
  % This definition was broken due to a typo at 5.1.0 and got fixed at 6.1.2
553
589
  % MEMO: at 6.2.0 this no longer does \number\dimexpr in an \edef. Reason is to
554
590
  % keep in sync with div.topic_box-shadow handling of xoffset and yoffset.
555
- % Attention in particular to \ifdim context, we add a \dimexpr to the one here.
556
591
  \define@key{sphinx}{shadowsize}{%
557
592
  \def\spx@topic@shadow@xoffset{#1}%
558
593
  \let\spx@topic@shadow@yoffset\spx@topic@shadow@xoffset
@@ -564,8 +599,9 @@ will be set to white}%
564
599
  \fi
565
600
  }%
566
601
 
567
- % Color keys
568
- % (four of them: border, background, shadow and the text color)
602
+ % Color keys, TeXextras key, keys for admonition titles with icon
603
+ %
604
+ % Historical remarks to be removed at some point:
569
605
  %
570
606
  % Some problems due to legacy naming scheme which had diverging conventions
571
607
  % for code-blocks (VerbatimBorderColor, VerbatimColor) and admonitions
@@ -574,27 +610,31 @@ will be set to white}%
574
610
  % example sphinxwarningBgColor are also documented at user level, they are not
575
611
  % only internally used.
576
612
  %
577
- % For topic directive, "legacy" (by this I mean Sphinx around 2016-2017 after
578
- % my first additions to LaTeX) had no interface for colors, so I could change
579
- % some internals with no breakage during 5.x up to 6.2.0. So topic
580
- % (shadowbox) could be unified with admonitions (sphinxheavybox), and the
581
- % "set-up" macros could all be moved into a single one in the
582
- % sphinxpackageboxes.sty file, with only one argument holding the directive
583
- % type.
613
+ % For topic directive, "legacy" (around 2016-2017) had no interface for
614
+ % colours, so some internals could be changed with no breakage during 5.x up
615
+ % to 6.2.0. For example topic (shadowbox) could be unified with admonitions
616
+ % (sphinxheavybox), and the "setup" macros could all be moved into a single
617
+ % one in the sphinxpackageboxes.sty file, with only one argument holding the
618
+ % directive type.
584
619
  %
585
- % It was then needed only for sphinxlatexliterals.sty to let its
620
+ % It was then needed only by sphinxlatexliterals.sty to let its emitted
586
621
  % \spx@verb@boxes@fcolorbox@setup incorporate some extra adjustment.
587
622
  %
588
- % We associate a boolean to each color, so that the box code can
589
- % decide to insert a \color command or consider it is not needed.
623
+ % 7.4.0 removes usages of booleans relative to usage of a colour for
624
+ % background or border which were there to optimize the boxing code from
625
+ % sphinxpackageboxes.sty when colours where not needed. These were internal
626
+ % macros so their removal should not be considered breaking.
627
+ % We keep the infrastructure for "shadowcolor" and "textcolor" because the
628
+ % defaults for them remain not to have specific colour.
629
+ %
630
+ % 7.4.0 adds keys for admonition titles: for background and foreground colors,
631
+ % and for icons (whose defaults are picked from Free Fontawesome 5).
590
632
  \def\spx@tempa#1{%
591
633
  \expandafter\spx@tempb
592
634
  \csname if#1withshadowcolor\expandafter\endcsname
593
- \csname if#1withbordercolor\expandafter\endcsname
594
- \csname if#1withbackgroundcolor\expandafter\endcsname
595
635
  \csname if#1withtextcolor\endcsname
596
636
  }%
597
- \def\spx@tempb#1#2#3#4{\newif#1\newif#2\newif#3\newif#4}%
637
+ \def\spx@tempb#1#2{\newif#1\newif#2}%
598
638
  % macro prefix
599
639
  \spx@tempa{spx@pre@}
600
640
  \spx@tempa{spx@topic@}
@@ -602,6 +642,8 @@ will be set to white}%
602
642
  \spx@tempa{spx@hint@}
603
643
  \spx@tempa{spx@important@}
604
644
  \spx@tempa{spx@tip@}
645
+ \spx@tempa{spx@seealso@}
646
+ \spx@tempa{spx@todo@}
605
647
  \spx@tempa{spx@warning@}
606
648
  \spx@tempa{spx@caution@}
607
649
  \spx@tempa{spx@attention@}
@@ -611,29 +653,36 @@ will be set to white}%
611
653
  %
612
654
  \def\spx@tempa#1{% #1 = macro prefix
613
655
  \expandafter\spx@tempb
614
- \csname #1withbordercolortrue\expandafter\endcsname
615
- \csname #1withbackgroundcolortrue\expandafter\endcsname
616
656
  \csname #1withshadowcolortrue\expandafter\endcsname
617
- \csname #1withtextcolortrue\endcsname
657
+ \csname #1withtextcolortrue\expandafter\endcsname
658
+ \csname #1TeXextras\endcsname
618
659
  }
619
- \def\spx@tempb#1#2#3#4#5#6{% #5 = option prefix, #6 = color name prefix
620
- \define@key{sphinx}{#5border-TeXcolor}%
621
- {#1\spx@defineorletcolor{#6BorderColor}##1\relax}%
622
- \define@key{sphinx}{#5background-TeXcolor}%
623
- {#2\spx@defineorletcolor{#6BgColor}##1\relax}%
624
- \define@key{sphinx}{#5box-shadow-TeXcolor}%
625
- {#3\spx@defineorletcolor{#6ShadowColor}##1\relax}%
626
- \define@key{sphinx}{#5TeXcolor}%
627
- {#4\spx@defineorletcolor{#6TextColor}##1\relax}%
660
+ % 7.4.0 adds options for a title. They have an action only for admonitions,
661
+ % seealso and todo directives.
662
+ \def\spx@tempb#1#2#3#4#5{% #4 = option prefix, #5 = color name prefix
663
+ \define@key{sphinx}{#4border-TeXcolor}%
664
+ {\spx@defineorletcolor{#5BorderColor}##1\relax}%
665
+ \define@key{sphinx}{#4background-TeXcolor}%
666
+ {\spx@defineorletcolor{#5BgColor}##1\relax}%
667
+ \define@key{sphinx}{#4title-background-TeXcolor}%
668
+ {\spx@defineorletcolor{#5TtlBgColor}##1\relax}%
669
+ \define@key{sphinx}{#4title-foreground-TeXcolor}%
670
+ {\spx@defineorletcolor{#5TtlFgColor}##1\relax}%
671
+ \define@key{sphinx}{#4title-icon}%
672
+ {\@namedef{#5TtlIcon}{##1}}%
673
+ \define@key{sphinx}{#4box-shadow-TeXcolor}%
674
+ {#1\spx@defineorletcolor{#5ShadowColor}##1\relax}%
675
+ \define@key{sphinx}{#4TeXcolor}%
676
+ {#2\spx@defineorletcolor{#5TextColor}##1\relax}%
677
+ \define@key{sphinx}{#4TeXextras}%
678
+ {\def#3{##1}}%
628
679
  }
629
680
  % macro prefix option prefix color name prefix
630
681
  \spx@tempa{spx@pre@} {pre_} {Verbatim}
631
682
  % (memo: internal VerbatimShadowColor was formerly sphinxVerbatimShadowColor)
632
683
  % internal legacy color name is VerbatimColor not VerbatimBgColor, so redefine:
633
684
  \define@key{sphinx}{pre_background-TeXcolor}%
634
- {\spx@pre@withbackgroundcolortrue\spx@defineorletcolor{VerbatimColor}#1\relax}%
635
- \spx@pre@withbordercolortrue % 6.0.0 VerbatimBorderColor {RGB}{32,32,32}
636
- \spx@pre@withbackgroundcolortrue % 6.0.0 VerbatimColor {gray}{0.95}
685
+ {\spx@defineorletcolor{VerbatimColor}#1\relax}%
637
686
  % Keep legacy option names working
638
687
  \expandafter\let\expandafter\KV@sphinx@VerbatimBorderColor
639
688
  \csname KV@sphinx@pre_border-TeXcolor\endcsname
@@ -646,6 +695,8 @@ will be set to white}%
646
695
  \spx@tempa{spx@hint@} {div.hint_} {sphinxhint}
647
696
  \spx@tempa{spx@important@}{div.important_} {sphinximportant}
648
697
  \spx@tempa{spx@tip@} {div.tip_} {sphinxtip}
698
+ \spx@tempa{spx@seealso@} {div.seealso_} {sphinxseealso}
699
+ \spx@tempa{spx@todo@} {div.todo_} {sphinxtodo}
649
700
  \spx@tempa{spx@warning@} {div.warning_} {sphinxwarning}
650
701
  \spx@tempa{spx@caution@} {div.caution_} {sphinxcaution}
651
702
  \spx@tempa{spx@attention@}{div.attention_} {sphinxattention}
@@ -666,11 +717,12 @@ will be set to white}%
666
717
  \spx@tempa{div.error_} {error}
667
718
 
668
719
  % Keep legacy sphinxsetup <type>BorderColor for <type>=note, hint, ...
669
- % which will not trigger sphinxheavybox
670
- % Add "legacy" hintTextColor etc... that will not trigger sphinxheavybox
720
+ % Add "legacy" names <type>BgColor (added at 7.4.0) and <type>TextColor
671
721
  \def\spx@tempa#1#2{% #1 = CSS like option prefix, #2 = legacy option prefix
672
722
  \expandafter\let\csname KV@sphinx@#2BorderColor\expandafter\endcsname
673
723
  \csname KV@sphinx@#1border-TeXcolor\endcsname
724
+ \expandafter\let\csname KV@sphinx@#2BgColor\expandafter\endcsname
725
+ \csname KV@sphinx@#1background-TeXcolor\endcsname
674
726
  \expandafter\let\csname KV@sphinx@#2TextColor\expandafter\endcsname
675
727
  \csname KV@sphinx@#1TeXcolor\endcsname
676
728
  }
@@ -679,28 +731,7 @@ will be set to white}%
679
731
  \spx@tempa{div.important_} {important}
680
732
  \spx@tempa{div.tip_} {tip}
681
733
 
682
- % The TeXextras key
683
- %
684
- \def\spx@tempa#1{% #1 = macro prefix
685
- \expandafter\spx@tempb\csname #1TeXextras\endcsname
686
- }
687
- \def\spx@tempb#1#2{% #2 = option prefix
688
- \define@key{sphinx}{#2TeXextras}{\def#1{##1}}%
689
- }
690
- % macro prefix option prefix
691
- \spx@tempa{spx@pre@} {pre_}
692
- \spx@tempa{spx@topic@} {div.topic_}
693
- \spx@tempa{spx@note@} {div.note_}
694
- \spx@tempa{spx@hint@} {div.hint_}
695
- \spx@tempa{spx@important@}{div.important_}
696
- \spx@tempa{spx@tip@} {div.tip_}
697
- \spx@tempa{spx@warning@} {div.warning_}
698
- \spx@tempa{spx@caution@} {div.caution_}
699
- \spx@tempa{spx@attention@}{div.attention_}
700
- \spx@tempa{spx@danger@} {div.danger_}
701
- \spx@tempa{spx@error@} {div.error_}
702
- \spx@tempa{spx@box@} {box_}
703
- % Add "legacy" hintTeXextras etc... that will not trigger sphinxheavybox
734
+ % Add "legacy" hintTeXextras etc...
704
735
  \def\spx@tempa#1#2{% #1 = CSS like option prefix, #2 = legacy option prefix
705
736
  \expandafter\let\csname KV@sphinx@#2TeXextras\expandafter\endcsname
706
737
  \csname KV@sphinx@#1TeXextras\endcsname
@@ -710,64 +741,147 @@ will be set to white}%
710
741
  \spx@tempa{div.important_} {important}
711
742
  \spx@tempa{div.tip_} {tip}
712
743
 
713
- % For note type admonitions, redefine all CSS-like named options to trigger
714
- % the "heavybox" path.
744
+ % At 7.4.0, let topic/contents boxes acquire background and border colours
745
+ % 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
+ }
750
+
751
+
752
+ % 7.4.0 lets all types of admonitions style especially their titlss.
753
+ % The Sphinx default colours for admonition titles are copied from PR #12486
754
+ % which modified sphinx13.css (see also earlier #12439)
755
+ % The actual code using the colours and icons whose defaults are set here
756
+ % is to be found in sphinxlatexadmonitions.sty.
757
+ %
758
+ % MEMO: unfortunately xcolor does NOT implement HSL but only HSB!
759
+ % So the sphinx13.css colours specified via hsl() got converted to RGB here
760
+ \definecolor{sphinx-admonition-title-bgcolor}{RGB}{229,229,229} % hsl(0, 0%, 90%);
761
+ \definecolor{sphinx-admonition-title-fgcolor}{RGB}{127,127,127} % hsl(0, 0%, 50%);
762
+ \definecolor{sphinx-warning-title-bgcolor} {RGB}{248,228,210} % hsl(28.5, 74%, 90%);
763
+ \definecolor{sphinx-warning-title-fgcolor} {RGB}{221,122,33} % hsl(28.5, 74%, 50%);
764
+ \definecolor{sphinx-note-title-bgcolor} {RGB}{208,222,250} % hsl(219.5, 84%, 90%);
765
+ \definecolor{sphinx-note-title-fgcolor} {RGB}{20,93,234} % hsl(219.5, 84%, 50%);
766
+ \definecolor{sphinx-success-title-bgcolor} {RGB}{220,239,230} % hsl(150, 36.7%, 90%);
767
+ \definecolor{sphinx-success-title-fgcolor} {RGB}{81,174,128} % hsl(150, 36.7%, 50%);
768
+ \definecolor{sphinx-error-title-bgcolor} {RGB}{238,220,220} % hsl(0, 37%, 90%);
769
+ \definecolor{sphinx-error-title-fgcolor} {RGB}{174,80,80} % hsl(0, 37%, 50%);
770
+ \definecolor{sphinx-todo-title-bgcolor} {RGB}{226,204,254} % hsl(266.8, 100%, 90%);
771
+ \definecolor{sphinx-todo-title-fgcolor} {RGB}{113,0,255} % hsl(266.8, 100%, 50%);
772
+
773
+ % Now use the above colours as default settings, following the choices
774
+ % done in sphinx13.css
775
+ \setkeys{sphinx}{
776
+ div.note_title-background-TeXcolor=sphinx-note-title-bgcolor,
777
+ div.note_title-foreground-TeXcolor=sphinx-note-title-fgcolor,
778
+ %
779
+ div.hint_title-background-TeXcolor=sphinx-success-title-bgcolor,
780
+ div.hint_title-foreground-TeXcolor=sphinx-success-title-fgcolor,
781
+ div.tip_title-background-TeXcolor=sphinx-success-title-bgcolor,
782
+ div.tip_title-foreground-TeXcolor=sphinx-success-title-fgcolor,
783
+ div.seealso_title-background-TeXcolor=sphinx-success-title-bgcolor,
784
+ div.seealso_title-foreground-TeXcolor=sphinx-success-title-fgcolor,
785
+ div.todo_title-background-TeXcolor=sphinx-todo-title-bgcolor,
786
+ div.todo_title-foreground-TeXcolor=sphinx-todo-title-fgcolor,
787
+ %
788
+ div.important_title-background-TeXcolor=sphinx-warning-title-bgcolor,
789
+ div.important_title-foreground-TeXcolor=sphinx-warning-title-fgcolor,
790
+ div.caution_title-background-TeXcolor=sphinx-warning-title-bgcolor,
791
+ div.caution_title-foreground-TeXcolor=sphinx-warning-title-fgcolor,
792
+ div.warning_title-background-TeXcolor=sphinx-warning-title-bgcolor,
793
+ div.warning_title-foreground-TeXcolor=sphinx-warning-title-fgcolor,
715
794
  %
716
- % MEMO: the noteBorderColor and noteborder legacy options have already been
717
- % re-created and they do not trigger the "heavybox" as their meaning will not
718
- % be modified in the loop below contrarily to their CSS counterparts
719
- % div.note_border-TeXcolor and div.note_border-width, and to the noteBgColor
720
- % etc... which are handled below.
795
+ div.attention_title-background-TeXcolor=sphinx-error-title-bgcolor,
796
+ div.attention_title-foreground-TeXcolor=sphinx-error-title-fgcolor,
797
+ div.danger_title-background-TeXcolor=sphinx-error-title-bgcolor,
798
+ div.danger_title-foreground-TeXcolor=sphinx-error-title-fgcolor,
799
+ div.error_title-background-TeXcolor=sphinx-error-title-bgcolor,
800
+ div.error_title-foreground-TeXcolor=sphinx-error-title-fgcolor,
721
801
  %
722
- % This goes via rather hardcore TeX here.
723
- \def\spx@tempa#1{\if\relax#1\expandafter\@gobble
802
+ % TODO: implement todo (sic)
803
+ %
804
+ }
805
+
806
+ % 7.4.0 Support for icons in admonition titles
807
+ % We try to
808
+ % - get Sphinx PDF builds to process fine in absence of fontawesome5
809
+ % - use fontawesome5 if present, but not if user prefers another package
810
+ % - provide an interface for using other LaTeX code for icons
811
+ % - provide an interface for using some other package than fontawesome5
812
+ % Indeed we can't load fontawesome5 unconditionally even if available,
813
+ % as it proves incompatible with fontawesome package.
814
+ % We thus must delay its loading.
815
+ \IfFileExists{fontawesome5.sty}{%
816
+ \DeclareStringOption[fontawesome5]{iconpackage}%
817
+ }%
818
+ {%
819
+ \IfFileExists{fontawesome.sty}
820
+ {\DeclareStringOption[fontawesome]{iconpackage}}
821
+ {\DeclareStringOption[none]{iconpackage}}%
822
+ }%
823
+ \newcommand\spx@faIcon[3][]{}%
824
+ % The hacky definition of \spx@faIcon above is to let it by default swallow
825
+ % the icon macro and the \sphinxtitlerowaftericonspacecmd (see
826
+ % \sphinxdotitlerowwithicon in sphinxlatexadmonitions.sty) which inserts
827
+ % a space between it and title. See how \spx@faIcon is used below.
828
+ %
829
+ % If user sets a title-icon key to some LaTeX code of their own, of course
830
+ % \spx@faIcon is not executed and the inserted space will thus be there, as
831
+ % expected.
832
+ %
833
+ \def\spxstring@fontawesome{fontawesome}
834
+ \def\spxstring@fontawesomev{fontawesome5}
835
+ \AtBeginDocument{%
836
+ \ifx\spx@opt@iconpackage\spxstring@none
724
837
  \else
725
- \toks@{##1}%
726
- \expandafter\def\csname KV@sphinx@div.note_#1\expandafter\endcsname
727
- \the\toks0\expandafter{%
728
- \csname spx@opt@heavynotetrue\expandafter\expandafter\expandafter\endcsname
729
- \csname KV@sphinx@div.note_#1\endcsname{##1}}%
730
- \expandafter\def\csname KV@sphinx@div.hint_#1\expandafter\endcsname
731
- \the\toks0\expandafter{%
732
- \csname spx@opt@heavyhinttrue\expandafter\expandafter\expandafter\endcsname
733
- \csname KV@sphinx@div.hint_#1\endcsname{##1}}%
734
- \expandafter\def\csname KV@sphinx@div.important_#1\expandafter\endcsname
735
- \the\toks0\expandafter{%
736
- \csname spx@opt@heavyimportanttrue\expandafter\expandafter\expandafter\endcsname
737
- \csname KV@sphinx@div.important_#1\endcsname{##1}}%
738
- \expandafter\def\csname KV@sphinx@div.tip_#1\expandafter\endcsname
739
- \the\toks0\expandafter{%
740
- \csname spx@opt@heavytiptrue\expandafter\expandafter\expandafter\endcsname
741
- \csname KV@sphinx@div.tip_#1\endcsname{##1}}%
838
+ \IfFileExists{\spx@opt@iconpackage.sty}
839
+ {\RequirePackage{\spx@opt@iconpackage}%
840
+ \ifx\spx@opt@iconpackage\spxstring@fontawesomev
841
+ \renewcommand\spx@faIcon{\faIcon}%
842
+ \else
843
+ \ifx\spx@opt@iconpackage\spxstring@fontawesome
844
+ \renewcommand\spx@faIcon[2][]{\faicon{##2}}%
845
+ % The \ifdefined's are a bit silly because we know that
846
+ % fontawesome.sty does not provide it, but perhaps
847
+ % there can be some new release of that package?
848
+ \ifdefined\faicon@lightbulb\else
849
+ \let\faicon@lightbulb\faLightbulbO
850
+ \fi
851
+ \ifdefined\faicon@radiation\else
852
+ \let\faicon@radiation\faBolt
853
+ \fi
854
+ \ifdefined\faicon@pen\else
855
+ \let\faicon@pen\faPencil
856
+ \fi
857
+ % if neither has been required, \spx@faIcon will simply swallow
858
+ % its argument (and follwing space macro) and it is up to user
859
+ % to set the keys appropriately.
860
+ \fi\fi %
861
+ }%
862
+ {%
863
+ \sphinxbuildwarning{badiconpackage}%
864
+ \PackageWarningNoLine{sphinx}{%
865
+ You have set iconpackage=\spx@opt@iconpackage\MessageBreak
866
+ But \spx@opt@iconpackage.sty is not found by LaTeX}
867
+ }%
742
868
  \fi
743
- \spx@tempa
744
869
  }
745
- \spx@tempa{border-width}%
746
- {border-top-width}{border-right-width}{border-bottom-width}{border-left-width}%
747
- {box-decoration-break}%
748
- {padding}%
749
- {padding-top}{padding-right}{padding-bottom}{padding-left}%
750
- {border-radius}%
751
- {border-top-left-radius}{border-top-right-radius}%
752
- {border-bottom-right-radius}{border-bottom-left-radius}%
753
- {box-shadow}%
754
- {border-TeXcolor}{background-TeXcolor}{box-shadow-TeXcolor}{TeXcolor}%
755
- {TeXextras}%
756
- \relax
757
-
758
- % Now we add at 6.2.0 <type>BgColor et al. options which will trigger the
759
- % "heavybox" as they are \let to the div.<type>_background-TeXColor option
760
- % which has already been enhanced to set the boolean for rendering via
761
- % "heavybox". This is in contrast with legacy <type>BorderColor,
762
- % and with the new <type>TeXcolor and <type>TeXextras.
763
- \def\spx@tempa#1#2{% #1 = CSS like option prefix, #2 = legacy style option prefix
764
- \expandafter\let\csname KV@sphinx@#2BgColor\expandafter\endcsname
765
- \csname KV@sphinx@#1background-TeXcolor\endcsname
766
- }
767
- \spx@tempa{div.note_} {note}
768
- \spx@tempa{div.hint_} {hint}
769
- \spx@tempa{div.important_} {important}
770
- \spx@tempa{div.tip_} {tip}
870
+
871
+ \setkeys{sphinx}{
872
+ % Icon defaults.
873
+ div.note_title-icon = \spx@faIcon{info-circle},
874
+ div.hint_title-icon = \spx@faIcon[regular]{lightbulb},
875
+ div.tip_title-icon = \spx@faIcon[regular]{lightbulb},
876
+ div.seealso_title-icon = \spx@faIcon{share},
877
+ div.todo_title-icon = \spx@faIcon{pen},
878
+ div.important_title-icon = \spx@faIcon{pause-circle},
879
+ div.caution_title-icon = \spx@faIcon{radiation},
880
+ div.warning_title-icon = \spx@faIcon{exclamation-triangle},
881
+ div.attention_title-icon = \spx@faIcon{exclamation-triangle},
882
+ div.danger_title-icon = \spx@faIcon{radiation},
883
+ div.error_title-icon = \spx@faIcon{times-circle},
884
+ }
771
885
 
772
886
  \newif\ifspx@opt@box@addstrut
773
887
  \expandafter\def\csname KV@sphinx@box_addstrut\endcsname#1{%
@@ -918,20 +1032,23 @@ will be set to white}%
918
1032
  }
919
1033
  % Some of these defaults got already set. But we now list them all explicitly
920
1034
  % for a complete initial configuration of reset storage.
921
- %
1035
+ % At 7.4.0, \fboxrule and \fboxsep replaced by 0.4pt and 3pt which are anyhow
1036
+ % the defaults for these LaTeX dimensions.
922
1037
  \let\spx@boxes@sphinxbox@defaults\@gobble
923
1038
  \sphinxboxsetup{%
924
- border-width=\fboxrule,% <-not really needed to avoid EOL space
925
- padding=\fboxsep,% but done here out of habit
926
- border-radius=\fboxsep,%
927
- box-shadow=none,%
928
- % As xcolor is perhaps not loaded we can not use background-TeXcolor=VerbatimColor
929
- % which would not be compatible with \definecolor syntax.
930
- border-TeXcolor={RGB}{32,32,32},% the default VerbatimBorderColor
931
- background-TeXcolor={gray}{0.95},% the default VerbatimColor
932
- box-shadow-TeXcolor={rgb}{0,0,0},%
933
- TeXextras={},%
934
- addstrut=false% (a final comma here would not hurt)
1039
+ border-width=0.4pt,
1040
+ padding=3pt,
1041
+ border-radius=0.4pt,
1042
+ box-shadow=none,
1043
+ % MEMO: as xcolor is loaded, \spx@defineorletcolor has a "\colorlet" branch
1044
+ % which makes this syntax acceptable and avoids duplicating here the values.
1045
+ border-TeXcolor=VerbatimBorderColor,
1046
+ background-TeXcolor=VerbatimColor,
1047
+ % 7.4.0 modified the color of the shadow (anyhow box-shadow is set above to none
1048
+ % so no shadow is drawn), to be as the new shadow colour of topic boxes.
1049
+ box-shadow-TeXcolor={RGB}{108,108,108},
1050
+ TeXextras={},
1051
+ addstrut=false,
935
1052
  }%
936
1053
  \RequirePackage{sphinxpackageboxes}
937
1054
  \input{sphinxlatexadmonitions.sty}