sphinx-rerediraffe 0.0.1__tar.gz

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.
Files changed (234) hide show
  1. sphinx_rerediraffe-0.0.1/LICENCE.rst +20 -0
  2. sphinx_rerediraffe-0.0.1/PKG-INFO +88 -0
  3. sphinx_rerediraffe-0.0.1/README.rst +53 -0
  4. sphinx_rerediraffe-0.0.1/docs/Makefile +20 -0
  5. sphinx_rerediraffe-0.0.1/docs/conf.py +34 -0
  6. sphinx_rerediraffe-0.0.1/docs/index.rst +214 -0
  7. sphinx_rerediraffe-0.0.1/docs/make.bat +35 -0
  8. sphinx_rerediraffe-0.0.1/pyproject.toml +86 -0
  9. sphinx_rerediraffe-0.0.1/sphinx_rerediraffe/__init__.py +25 -0
  10. sphinx_rerediraffe-0.0.1/sphinx_rerediraffe/callback.py +528 -0
  11. sphinx_rerediraffe-0.0.1/tests/conftest.py +192 -0
  12. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD/docs/folder1/f1.rst +1 -0
  13. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD/docs/folder2/f2.rst +1 -0
  14. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD/index.rst +1 -0
  15. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD/redirects.txt +5 -0
  16. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/docs/folder1/f1.rst +1 -0
  17. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/docs/folder1/tof1.rst +1 -0
  18. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/docs/folder1/tof2.rst +1 -0
  19. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/docs/folder2/f2.rst +1 -0
  20. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/docs/folder2/toindex.rst +1 -0
  21. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/index.rst +1 -0
  22. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/redirects.txt +0 -0
  23. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/tof1.rst +1 -0
  24. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/HEAD~1/totoindex.rst +1 -0
  25. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-backslashes/conf.py +10 -0
  26. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-bad_rediraffe_file/HEAD/another2.rst +1 -0
  27. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-bad_rediraffe_file/HEAD/index.rst +1 -0
  28. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-bad_rediraffe_file/HEAD/redirects.txt +1 -0
  29. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-bad_rediraffe_file/HEAD~1/another.rst +1 -0
  30. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-bad_rediraffe_file/HEAD~1/index.rst +1 -0
  31. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-bad_rediraffe_file/HEAD~1/redirects.txt +0 -0
  32. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-bad_rediraffe_file/conf.py +11 -0
  33. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected/HEAD/index.rst +1 -0
  34. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected/HEAD/redirects.txt +0 -0
  35. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected/HEAD~1/another.rst +1 -0
  36. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected/HEAD~1/index.rst +1 -0
  37. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected/HEAD~1/redirects.txt +0 -0
  38. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected/conf.py +11 -0
  39. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected_commit/HEAD/index.rst +1 -0
  40. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected_commit/HEAD/redirects.txt +0 -0
  41. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected_commit/HEAD~1/another.rst +1 -0
  42. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected_commit/HEAD~1/index.rst +1 -0
  43. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected_commit/HEAD~1/redirects.txt +0 -0
  44. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_not_redirected_commit/conf.py +17 -0
  45. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected/HEAD/index.rst +1 -0
  46. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected/HEAD/redirects.txt +1 -0
  47. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected/HEAD~1/another.rst +1 -0
  48. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected/HEAD~1/index.rst +1 -0
  49. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected/HEAD~1/redirects.txt +0 -0
  50. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected/conf.py +11 -0
  51. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_commit/HEAD/index.rst +1 -0
  52. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_commit/HEAD/redirects.txt +1 -0
  53. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_commit/HEAD~1/another.rst +1 -0
  54. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_commit/HEAD~1/index.rst +1 -0
  55. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_commit/HEAD~1/redirects.txt +0 -0
  56. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_commit/conf.py +17 -0
  57. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_dict/HEAD/conf.py +13 -0
  58. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_dict/HEAD/index.rst +1 -0
  59. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_dict/HEAD~1/another.rst +1 -0
  60. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_dict/HEAD~1/conf.py +11 -0
  61. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-deleted_file_redirected_dict/HEAD~1/index.rst +1 -0
  62. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-file_changed/HEAD/index.rst +1 -0
  63. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-file_changed/HEAD/redirects.txt +0 -0
  64. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-file_changed/HEAD~1/index.rst +1 -0
  65. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-file_changed/HEAD~1/redirects.txt +0 -0
  66. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-file_changed/conf.py +11 -0
  67. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_to_chain/HEAD/index.rst +1 -0
  68. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_to_chain/HEAD/redirects.txt +2 -0
  69. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_to_chain/HEAD~1/another.rst +1 -0
  70. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_to_chain/HEAD~1/another2.rst +1 -0
  71. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_to_chain/HEAD~1/index.rst +1 -0
  72. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_to_chain/HEAD~1/redirects.txt +0 -0
  73. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_to_chain/conf.py +11 -0
  74. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_twice/HEAD/another2.rst +1 -0
  75. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_twice/HEAD/index.rst +1 -0
  76. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_twice/HEAD/redirects.txt +2 -0
  77. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_twice/HEAD~1/another2.rst +1 -0
  78. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_twice/HEAD~1/index.rst +1 -0
  79. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_twice/HEAD~1/redirects.txt +1 -0
  80. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-link_redirected_twice/conf.py +11 -0
  81. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD/docs/folder1/f1.rst +1 -0
  82. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD/docs/folder2/f2.rst +1 -0
  83. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD/index.rst +1 -0
  84. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD/redirects.txt +5 -0
  85. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/docs/folder1/f1.rst +1 -0
  86. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/docs/folder1/tof1.rst +1 -0
  87. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/docs/folder1/tof2.rst +1 -0
  88. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/docs/folder2/f2.rst +1 -0
  89. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/docs/folder2/toindex.rst +1 -0
  90. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/index.rst +1 -0
  91. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/redirects.txt +0 -0
  92. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/tof1.rst +1 -0
  93. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/HEAD~1/totoindex.rst +1 -0
  94. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-mixed_slashes/conf.py +10 -0
  95. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD/docs/folder1/f1.rst +1 -0
  96. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD/docs/folder2/f2.rst +1 -0
  97. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD/index.rst +1 -0
  98. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD/redirects.txt +5 -0
  99. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/docs/folder1/f1.rst +1 -0
  100. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/docs/folder1/tof1.rst +1 -0
  101. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/docs/folder1/tof2.rst +1 -0
  102. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/docs/folder2/f2.rst +1 -0
  103. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/docs/folder2/toindex.rst +1 -0
  104. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/index.rst +1 -0
  105. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/redirects.txt +0 -0
  106. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/tof1.rst +1 -0
  107. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/HEAD~1/totoindex.rst +1 -0
  108. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-nested/conf.py +10 -0
  109. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_not_redirected/HEAD/another2.rst +1 -0
  110. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_not_redirected/HEAD/index.rst +1 -0
  111. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_not_redirected/HEAD/redirects.txt +0 -0
  112. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_not_redirected/HEAD~1/another.rst +1 -0
  113. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_not_redirected/HEAD~1/index.rst +1 -0
  114. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_not_redirected/HEAD~1/redirects.txt +0 -0
  115. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_not_redirected/conf.py +11 -0
  116. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_redirected/HEAD/another2.rst +1 -0
  117. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_redirected/HEAD/index.rst +1 -0
  118. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_redirected/HEAD/redirects.txt +1 -0
  119. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_redirected/HEAD~1/another.rst +1 -0
  120. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_redirected/HEAD~1/index.rst +1 -0
  121. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_redirected/HEAD~1/redirects.txt +0 -0
  122. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_file_redirected/conf.py +11 -0
  123. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_not_redirected/HEAD/another2.rst +1 -0
  124. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_not_redirected/HEAD/index.rst +1 -0
  125. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_not_redirected/HEAD/redirects.txt +0 -0
  126. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_not_redirected/HEAD~1/another.rst +1 -0
  127. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_not_redirected/HEAD~1/index.rst +1 -0
  128. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_not_redirected/HEAD~1/redirects.txt +0 -0
  129. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_not_redirected/conf.py +11 -0
  130. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_fail/HEAD/another2.rst +3 -0
  131. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_fail/HEAD/index.rst +1 -0
  132. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_fail/HEAD/redirects.txt +0 -0
  133. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_fail/HEAD~1/another.rst +1 -0
  134. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_fail/HEAD~1/index.rst +1 -0
  135. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_fail/HEAD~1/redirects.txt +0 -0
  136. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_fail/conf.py +11 -0
  137. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_pass/HEAD/another2.rst +8 -0
  138. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_pass/HEAD/index.rst +1 -0
  139. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_pass/HEAD/redirects.txt +0 -0
  140. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_pass/HEAD~1/another.rst +7 -0
  141. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_pass/HEAD~1/index.rst +1 -0
  142. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_pass/HEAD~1/redirects.txt +0 -0
  143. sphinx_rerediraffe-0.0.1/tests/roots/builder/test-renamed_write_file_perc_low_pass/conf.py +12 -0
  144. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-backslashes/conf.py +10 -0
  145. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-backslashes/docs/folder1/f1.rst +1 -0
  146. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-backslashes/docs/folder2/f2.rst +1 -0
  147. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-backslashes/index.rst +1 -0
  148. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-backslashes/redirects.txt +5 -0
  149. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-bad_rediraffe_file/conf.py +10 -0
  150. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-bad_rediraffe_file/index.rst +1 -0
  151. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex/conf.py +10 -0
  152. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex/e.rst +1 -0
  153. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex/index.rst +1 -0
  154. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex/j.rst +1 -0
  155. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex/l.rst +1 -0
  156. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex/o.rst +1 -0
  157. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex/redirects.txt +36 -0
  158. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex/z.rst +1 -0
  159. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex_dict/conf.py +36 -0
  160. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex_dict/e.rst +1 -0
  161. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex_dict/index.rst +1 -0
  162. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex_dict/j.rst +1 -0
  163. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex_dict/l.rst +1 -0
  164. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex_dict/o.rst +1 -0
  165. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex_dict/redirects.txt +36 -0
  166. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-complex_dict/z.rst +1 -0
  167. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-cycle/conf.py +10 -0
  168. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-cycle/index.rst +1 -0
  169. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-cycle/redirects.txt +2 -0
  170. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-dirhtml_user_index_files/conf.py +10 -0
  171. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-dirhtml_user_index_files/index.rst +1 -0
  172. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-dirhtml_user_index_files/mydir/index.rst +1 -0
  173. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-dirhtml_user_index_files/redirects.txt +1 -0
  174. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-dot_in_filename/conf.py +10 -0
  175. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-dot_in_filename/docs/a.b.c.rst +1 -0
  176. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-dot_in_filename/index.rst +1 -0
  177. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-dot_in_filename/redirects.txt +1 -0
  178. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-existing_link_redirected/another.rst +1 -0
  179. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-existing_link_redirected/conf.py +10 -0
  180. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-existing_link_redirected/index.rst +1 -0
  181. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-existing_link_redirected/redirects.txt +1 -0
  182. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-external/conf.py +10 -0
  183. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-external/index.rst +1 -0
  184. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-external/redirects.txt +3 -0
  185. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-jinja/conf.py +11 -0
  186. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-jinja/index.rst +1 -0
  187. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-jinja/rediraffe_template.html +9 -0
  188. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-jinja/redirects.txt +1 -0
  189. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-jinja_bad_path/conf.py +11 -0
  190. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-jinja_bad_path/index.rst +1 -0
  191. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-jinja_bad_path/redirects.txt +1 -0
  192. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-link_redirected_to_nonexistant_file/conf.py +10 -0
  193. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-link_redirected_to_nonexistant_file/index.rst +1 -0
  194. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-link_redirected_to_nonexistant_file/redirects.txt +1 -0
  195. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-link_redirected_twice/conf.py +10 -0
  196. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-link_redirected_twice/index.rst +1 -0
  197. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-link_redirected_twice/index2.rst +1 -0
  198. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-link_redirected_twice/redirects.txt +2 -0
  199. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-mixed_slashes/conf.py +10 -0
  200. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-mixed_slashes/docs/folder1/f1.rst +1 -0
  201. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-mixed_slashes/docs/folder2/f2.rst +1 -0
  202. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-mixed_slashes/index.rst +1 -0
  203. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-mixed_slashes/redirects.txt +5 -0
  204. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-nested/conf.py +10 -0
  205. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-nested/docs/folder1/f1.rst +1 -0
  206. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-nested/docs/folder2/f2.rst +1 -0
  207. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-nested/index.rst +1 -0
  208. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-nested/redirects.txt +5 -0
  209. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-no_cycle/conf.py +10 -0
  210. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-no_cycle/index.rst +1 -0
  211. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-no_cycle/redirects.txt +2 -0
  212. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-no_rediraffe_file/conf.py +8 -0
  213. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-no_rediraffe_file/index.rst +1 -0
  214. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-no_redirects/conf.py +10 -0
  215. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-no_redirects/index.rst +1 -0
  216. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-no_redirects/redirects.txt +1 -0
  217. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-pass_url_fragments_queries/conf.py +10 -0
  218. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-pass_url_fragments_queries/index.rst +1 -0
  219. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-pass_url_fragments_queries/redirects.txt +1 -0
  220. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-rediraffe_dir_only/conf.py +11 -0
  221. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-rediraffe_dir_only/index.rst +1 -0
  222. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-rediraffe_dir_only/mypage.rst +1 -0
  223. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-rediraffe_dir_only/redirects.txt +1 -0
  224. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-redirect_from_deleted_folder/conf.py +10 -0
  225. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-redirect_from_deleted_folder/index.rst +1 -0
  226. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-redirect_from_deleted_folder/redirects.txt +2 -0
  227. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-simple/conf.py +10 -0
  228. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-simple/index.rst +1 -0
  229. sphinx_rerediraffe-0.0.1/tests/roots/ext/test-simple/redirects.txt +1 -0
  230. sphinx_rerediraffe-0.0.1/tests/test_builder.py +93 -0
  231. sphinx_rerediraffe-0.0.1/tests/test_create_graph.py +217 -0
  232. sphinx_rerediraffe-0.0.1/tests/test_create_simple_redirects.py +102 -0
  233. sphinx_rerediraffe-0.0.1/tests/test_ext.py +546 -0
  234. sphinx_rerediraffe-0.0.1/tests/test_write_builder.py +39 -0
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2020, Vasista Vovveti
2
+ Copyright (c) 2025, the Sphinx developers
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
@@ -0,0 +1,88 @@
1
+ Metadata-Version: 2.4
2
+ Name: sphinx-rerediraffe
3
+ Version: 0.0.1
4
+ Summary: Sphinx Extension that redirects non-existent pages to working pages
5
+ Author-email: Vasista Vovveti <vasistavovveti@gmail.com>, JJ Coldiron <jj.coldiron@canonical.com>
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/x-rst
8
+ License-Expression: MIT
9
+ Classifier: Development Status :: 5 - Production/Stable
10
+ Classifier: Environment :: Plugins
11
+ Classifier: Environment :: Web Environment
12
+ Classifier: Framework :: Sphinx :: Extension
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Natural Language :: English
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python
22
+ Classifier: Topic :: Documentation :: Sphinx
23
+ Classifier: Topic :: Documentation
24
+ Classifier: Topic :: Software Development :: Documentation
25
+ Classifier: Topic :: Text Processing
26
+ Classifier: Topic :: Utilities
27
+ License-File: LICENCE.rst
28
+ Requires-Dist: Sphinx>=6.0
29
+ Project-URL: Code, https://github.com/jahn-junior/sphinx-rerediraffe/
30
+ Project-URL: Documentation, https://sphinxext-rediraffe.readthedocs.io/
31
+ Project-URL: Download, https://pypi.org/project/sphinx-rerediraffe/
32
+ Project-URL: Homepage, https://github.com/sphinx-doc/sphinx-rerediraffe/
33
+ Project-URL: Issue tracker, https://github.com/sphinx-doc/sphinxext-rediraffe/issues
34
+
35
+ The sphinx-rerediraffe fork was published as a **temporary solution**. The changes
36
+ it introduces have already been proposed upstream
37
+ (`sphinx-doc/sphinxext-rediraffe#67
38
+ <https://github.com/sphinx-doc/sphinxext-rediraffe/pull/67>`__,
39
+ `sphinx-doc/sphinxext-rediraffe#68
40
+ <https://github.com/sphinx-doc/sphinxext-rediraffe/pull/68>`__).
41
+
42
+ sphinx-rerediraffe
43
+ ==================
44
+
45
+ .. image:: https://img.shields.io/pypi/v/sphinx-rerediraffe.svg
46
+ :target: https://pypi.org/project/sphinx-rerediraffe/
47
+ :alt: Package on PyPI
48
+
49
+ .. image:: https://github.com/sphinx-doc/sphinx-rerediraffe/actions/workflows/test.yml/badge.svg
50
+ :target: https://github.com/sphinx-doc/sphinx-rerediraffe/actions
51
+ :alt: Build Status
52
+
53
+ .. image:: https://img.shields.io/badge/License-MIT-blue.svg
54
+ :target: https://opensource.org/licenses/MIT
55
+ :alt: MIT
56
+
57
+ Sphinx extension to redirect files
58
+
59
+ .. image:: ./assets/rediraffe_logo.svg
60
+ :align: center
61
+
62
+ This Sphinx extension redirects non-existent pages to working pages.
63
+ Rediraffe can also check that deleted or renamed files in your git repo
64
+ are redirected.
65
+
66
+ Rediraffe creates a graph of all specified redirects and traverses it
67
+ to point all internal urls to leaf urls.
68
+ This means that chained redirects will be resolved.
69
+ For example, if a config has 6 chained redirects, all 6 links will redirect
70
+ directly to the final link.
71
+ The end user will never experience more than 1 redirection.
72
+
73
+ Note: Rediraffe supports the html and dirhtml builders.
74
+
75
+ Installation
76
+ ============
77
+
78
+ .. code-block:: sh
79
+
80
+ pip install sphinx-rerediraffe
81
+
82
+ Usage
83
+ =====
84
+
85
+ See the `documentation`_.
86
+
87
+ .. _documentation: https://sphinxext-rediraffe.readthedocs.io/en/latest/
88
+
@@ -0,0 +1,53 @@
1
+ The sphinx-rerediraffe fork was published as a **temporary solution**. The changes
2
+ it introduces have already been proposed upstream
3
+ (`sphinx-doc/sphinxext-rediraffe#67
4
+ <https://github.com/sphinx-doc/sphinxext-rediraffe/pull/67>`__,
5
+ `sphinx-doc/sphinxext-rediraffe#68
6
+ <https://github.com/sphinx-doc/sphinxext-rediraffe/pull/68>`__).
7
+
8
+ sphinx-rerediraffe
9
+ ==================
10
+
11
+ .. image:: https://img.shields.io/pypi/v/sphinx-rerediraffe.svg
12
+ :target: https://pypi.org/project/sphinx-rerediraffe/
13
+ :alt: Package on PyPI
14
+
15
+ .. image:: https://github.com/sphinx-doc/sphinx-rerediraffe/actions/workflows/test.yml/badge.svg
16
+ :target: https://github.com/sphinx-doc/sphinx-rerediraffe/actions
17
+ :alt: Build Status
18
+
19
+ .. image:: https://img.shields.io/badge/License-MIT-blue.svg
20
+ :target: https://opensource.org/licenses/MIT
21
+ :alt: MIT
22
+
23
+ Sphinx extension to redirect files
24
+
25
+ .. image:: ./assets/rediraffe_logo.svg
26
+ :align: center
27
+
28
+ This Sphinx extension redirects non-existent pages to working pages.
29
+ Rediraffe can also check that deleted or renamed files in your git repo
30
+ are redirected.
31
+
32
+ Rediraffe creates a graph of all specified redirects and traverses it
33
+ to point all internal urls to leaf urls.
34
+ This means that chained redirects will be resolved.
35
+ For example, if a config has 6 chained redirects, all 6 links will redirect
36
+ directly to the final link.
37
+ The end user will never experience more than 1 redirection.
38
+
39
+ Note: Rediraffe supports the html and dirhtml builders.
40
+
41
+ Installation
42
+ ============
43
+
44
+ .. code-block:: sh
45
+
46
+ pip install sphinx-rerediraffe
47
+
48
+ Usage
49
+ =====
50
+
51
+ See the `documentation`_.
52
+
53
+ .. _documentation: https://sphinxext-rediraffe.readthedocs.io/en/latest/
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,34 @@
1
+ from __future__ import annotations
2
+
3
+ import sphinx_rerediraffe
4
+
5
+ copyright = (
6
+ '2020, FIRST',
7
+ '2025-%Y, the Sphinx developers',
8
+ )
9
+
10
+ version = release = sphinx_rerediraffe.__version__
11
+
12
+ master_doc = 'index'
13
+ project = 'sphinxext-rediraffe'
14
+
15
+ exclude_patterns = ['_build']
16
+
17
+ nitpicky = True
18
+
19
+ html_theme = 'furo'
20
+ html_logo = '../assets/rediraffe_logo_128.png'
21
+
22
+ extensions = [
23
+ 'sphinx.ext.intersphinx',
24
+ 'sphinx_rerediraffe',
25
+ ]
26
+
27
+ intersphinx_mapping = {
28
+ 'sphinx': ('https://www.sphinx-doc.org/', None),
29
+ }
30
+
31
+ rediraffe_redirects = {
32
+ 'other.rst': 'index.rst',
33
+ 'other2.rst': 'other.rst',
34
+ }
@@ -0,0 +1,214 @@
1
+ ===================
2
+ sphinxext-rediraffe
3
+ ===================
4
+
5
+ .. role:: code-py(code)
6
+ :language: Python
7
+
8
+ This Sphinx extension redirects non-existent pages to working pages.
9
+ Rediraffe can also check that deleted or renamed files in your git repo
10
+ are redirected.
11
+
12
+ Rediraffe creates a graph of all specified redirects and traverses it
13
+ to point all internal urls to leaf urls.
14
+ This means that chained redirects will be resolved.
15
+ For example, if a config has 6 chained redirects, all 6 links will redirect
16
+ directly to the final link.
17
+ The end user will never experience more than 1 redirection.
18
+
19
+ Note: Rediraffe supports the html and dirhtml builders.
20
+
21
+ Installation
22
+ ============
23
+
24
+ .. code-block:: sh
25
+
26
+ python -m pip install sphinxext-rediraffe
27
+
28
+ Usage
29
+ =====
30
+
31
+ Just add ``sphinx_rerediraffe`` to the extensions list in :file:`conf.py`,
32
+
33
+ .. code-block:: python
34
+
35
+ extensions = [
36
+ 'sphinx_rerediraffe',
37
+ ]
38
+
39
+ and set :confval:`rediraffe_redirects` to a dict or file of redirects.
40
+
41
+ Diff Checker
42
+ ------------
43
+
44
+ The diff checker ensures that deleted or renamed files in your git repo
45
+ are in your redirects.
46
+
47
+ To run the diff checker:
48
+
49
+ 1. Set :confval:`rediraffe_branch` and :confval:`rediraffe_redirects`
50
+ in :file:`conf.py`.
51
+ 2. Run the ``rediraffecheckdiff`` builder.
52
+
53
+ Auto Redirect builder
54
+ ---------------------
55
+
56
+ The auto redirect builder can be used to automatically add renamed files
57
+ to your redirects file.
58
+ Simply run the ``rediraffewritediff`` builder.
59
+
60
+ To run the auto redirecter:
61
+
62
+ 1. Set :confval:`rediraffe_branch` and :confval:`rediraffe_redirects`
63
+ in :file:`conf.py`.
64
+ 2. Run the ``rediraffewritediff`` builder.
65
+
66
+ Note: The auto redirect builder only works with a configuration file.
67
+
68
+ Note: Deleted files cannot be added to your redirects file automatically.
69
+
70
+
71
+ Options
72
+ =======
73
+
74
+ These values are placed in the :file:`conf.py` of your Sphinx project.
75
+
76
+ .. confval:: rediraffe_branch
77
+ :type: :code-py:`str`
78
+ :default: :code-py:`''`
79
+
80
+ **Required** for the ``rediraffecheckdiff`` & ``rediraffewritediff`` builders.
81
+ The branch or commit to diff against.
82
+
83
+ .. confval:: rediraffe_redirects
84
+ :type: :code-py:`str | dict[str, str]`
85
+
86
+ A filename or dict containing redirects.
87
+
88
+ .. confval:: rediraffe_template
89
+ :type: :code-py:`str`
90
+ :default: :code-py:`None`
91
+
92
+ A jinja template to use to render the inserted redirecting files.
93
+ If not specified, a default template will be used.
94
+ This template will only be accessed after the html/htmldir builder is finished,
95
+ meaning that this file may be generated as part of your build.
96
+
97
+ Variables available to :confval:`!rediraffe_template`:
98
+
99
+ ``from_file``
100
+ the file being redirected as written in :confval:`rediraffe_redirects`.
101
+ ``to_file``
102
+ the destination file that from_file is redirected to as written in
103
+ :confval:`rediraffe_redirects`.
104
+ ``from_url``
105
+ the path to ``from_url``'s html file (built by rediraffe) relative to the
106
+ :confval:`!outdir`.
107
+ ``to_url``
108
+ the path to ``to_url``'s built html file relative to the :confval:`!outdir`.
109
+ ``rel_url``
110
+ the relative path from ``from_url`` to ``to_url``.
111
+
112
+ .. confval:: rediraffe_auto_redirect_perc
113
+ :type: :code-py:`int`
114
+ :default: :code-py:`100`
115
+
116
+ Only used by the ``rediraffewritediff`` builder.
117
+ The percentage as an integer representing the accuracy required before
118
+ auto redirecting with the ``rediraffewritediff`` builder.
119
+
120
+ .. confval:: rediraffe_dir_only
121
+ :type: :code-py:`bool`
122
+ :default: :code-py:`False`
123
+
124
+ Whether to include ``/index.html`` in destination URLs when using the ``dirhtml``
125
+ builder.
126
+
127
+ Example Config
128
+ ==============
129
+
130
+ redirects only (file)
131
+ ---------------------
132
+
133
+ :file:`conf.py`:
134
+
135
+ .. code-block:: python
136
+
137
+ rediraffe_redirects = 'redirects.txt'
138
+
139
+ :file:`redirects.txt`:
140
+
141
+ .. code-block:: text
142
+
143
+ # comments start with '#'
144
+ 'another file.rst' index.rst
145
+ another2.rst "another file.rst"
146
+
147
+ Note: Filepaths can be wrapped in quotes (single or double).
148
+ This is especially useful for filepaths containing spaces.
149
+
150
+ redirects only (dict)
151
+ ---------------------
152
+
153
+ :file:`conf.py`:
154
+
155
+ .. code-block:: python
156
+
157
+ rediraffe_redirects = {
158
+ 'another.rst': 'index.rst',
159
+ 'another2.rst': 'another.rst',
160
+ }
161
+
162
+ redirects + diff checker
163
+ ------------------------
164
+
165
+ :file:`conf.py`:
166
+
167
+ .. code-block:: python
168
+
169
+ rediraffe_redirects = 'redirects.txt'
170
+ rediraffe_branch = 'main~1'
171
+
172
+ redirects with jinja template
173
+ -----------------------------
174
+
175
+ :file:`conf.py`:
176
+
177
+ .. code-block:: python
178
+
179
+ rediraffe_redirects = 'redirects.txt'
180
+ rediraffe_template = 'template.html'
181
+
182
+ :file:`template.html`:
183
+
184
+ .. code-block:: html
185
+
186
+ <html>
187
+ <body>
188
+ <p>Your destination is {{to_url}}</p>
189
+ </body>
190
+ </html>
191
+
192
+ A complex example can be found at :file:`tests/roots/ext/`.
193
+
194
+ Testing
195
+ =======
196
+
197
+ Rediraffe uses pytest for testing.
198
+ To run tests:
199
+
200
+ 1. Install this package
201
+ 2. Install test dependencies
202
+
203
+ .. code-block:: sh
204
+
205
+ python -m pip install --group test
206
+
207
+ 3. Navigate to the tests directory and run
208
+
209
+ .. code-block:: sh
210
+
211
+ python -m pytest --headless
212
+
213
+ The ``--headless`` flag ensures that a browser window does not open
214
+ during browser backed selenium testing.
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=.
11
+ set BUILDDIR=_build
12
+
13
+ if "%1" == "" goto help
14
+
15
+ %SPHINXBUILD% >NUL 2>NUL
16
+ if errorlevel 9009 (
17
+ echo.
18
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19
+ echo.installed, then set the SPHINXBUILD environment variable to point
20
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
21
+ echo.may add the Sphinx directory to PATH.
22
+ echo.
23
+ echo.If you don't have Sphinx installed, grab it from
24
+ echo.http://sphinx-doc.org/
25
+ exit /b 1
26
+ )
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,86 @@
1
+ [build-system]
2
+ requires = ["flit_core>=3.12"]
3
+ build-backend = "flit_core.buildapi"
4
+
5
+ # project metadata
6
+ [project]
7
+ name = "sphinx-rerediraffe"
8
+ description = "Sphinx Extension that redirects non-existent pages to working pages"
9
+ readme = "README.rst"
10
+ urls.Code = "https://github.com/jahn-junior/sphinx-rerediraffe/"
11
+ urls.Documentation = "https://sphinxext-rediraffe.readthedocs.io/"
12
+ urls.Download = "https://pypi.org/project/sphinx-rerediraffe/"
13
+ urls.Homepage = "https://github.com/sphinx-doc/sphinx-rerediraffe/"
14
+ urls."Issue tracker" = "https://github.com/sphinx-doc/sphinxext-rediraffe/issues"
15
+ license = "MIT"
16
+ license-files = [
17
+ "LICENCE.rst",
18
+ ]
19
+ requires-python = ">=3.11"
20
+ authors = [
21
+ {name = "Vasista Vovveti", email = "vasistavovveti@gmail.com"},
22
+ {name = "JJ Coldiron", email = "jj.coldiron@canonical.com"},
23
+ ]
24
+
25
+ # Classifiers list: https://pypi.org/classifiers/
26
+ classifiers = [
27
+ "Development Status :: 5 - Production/Stable",
28
+ "Environment :: Plugins",
29
+ "Environment :: Web Environment",
30
+ "Framework :: Sphinx :: Extension",
31
+ "Intended Audience :: Developers",
32
+ "Natural Language :: English",
33
+ "Operating System :: OS Independent",
34
+ "Programming Language :: Python :: 3.9",
35
+ "Programming Language :: Python :: 3.10",
36
+ "Programming Language :: Python :: 3.11",
37
+ "Programming Language :: Python :: 3.12",
38
+ "Programming Language :: Python :: 3.13",
39
+ "Programming Language :: Python",
40
+ "Topic :: Documentation :: Sphinx",
41
+ "Topic :: Documentation",
42
+ "Topic :: Software Development :: Documentation",
43
+ "Topic :: Text Processing",
44
+ "Topic :: Utilities",
45
+ ]
46
+ dependencies = [
47
+ "Sphinx>=6.0",
48
+ ]
49
+ dynamic = ["version"]
50
+
51
+ [dependency-groups]
52
+ docs = [
53
+ "furo>=2024",
54
+ "sphinx~=8.2.0",
55
+ ]
56
+ lint = [
57
+ "ruff==0.13.2",
58
+ ]
59
+ package = [
60
+ "betterproto==2.0.0b6", # resolution fails without betterproto
61
+ "build",
62
+ "pypi-attestations==0.0.27",
63
+ "twine>=6.1",
64
+ ]
65
+ test = [
66
+ "pytest",
67
+ "seleniumbase",
68
+ ]
69
+
70
+ [tool.flit.module]
71
+ name = "sphinx_rerediraffe"
72
+
73
+ [tool.flit.sdist]
74
+ include = [
75
+ # Documentation
76
+ "docs/",
77
+ # Tests
78
+ "tests/",
79
+ "tox.ini",
80
+ ]
81
+ exclude = [
82
+ "docs/_build",
83
+ ]
84
+
85
+ [tool.uv]
86
+ default-groups = "all"
@@ -0,0 +1,25 @@
1
+ from sphinx.util.typing import ExtensionMetadata
2
+ from sphinx.application import Sphinx
3
+ from sphinx_rerediraffe.callback import CheckRedirectsDiffBuilder, WriteRedirectsDiffBuilder, build_redirects
4
+
5
+ __version__ = '0.0.1'
6
+
7
+ def setup(app: Sphinx) -> ExtensionMetadata:
8
+ app.add_config_value('rediraffe_redirects', None, None)
9
+ app.add_config_value('rediraffe_branch', '', None)
10
+ app.add_config_value('rediraffe_template', None, None)
11
+ app.add_config_value('rediraffe_auto_redirect_perc', 100, None)
12
+ app.add_config_value('rediraffe_dir_only', False, 'env')
13
+
14
+ app.add_builder(CheckRedirectsDiffBuilder)
15
+ app.add_builder(WriteRedirectsDiffBuilder)
16
+ app.connect('build-finished', build_redirects)
17
+
18
+ return {
19
+ 'version': __version__,
20
+ 'env_version': 1,
21
+ 'parallel_read_safe': True,
22
+ 'parallel_write_safe': True,
23
+ }
24
+
25
+ __all__ = ['__version__', 'setup']