##// END OF EJS Templates
Fix missing jQuery in documentation (#14346)...
Fix missing jQuery in documentation (#14346) It's been 8 years since I last updated my IPython fork... 😄 ![Screenshot 2024-02-19 at 17-29-31 astrojuanlu_ipython Official repository for IPython itself Other repos in the IPython organization contain things like the website documentation builds etc](https://github.com/ipython/ipython/assets/316517/a5143264-6188-4389-bc37-914019b2be2b) Fix #14213 by adding https://pypi.org/project/sphinxcontrib-jquery/ to the Sphinx extensions, see https://github.com/sphinx-doc/sphinx/issues/10070 and https://github.com/sphinx-doc/sphinx/issues/7405 for extra context. Also fix #14264.

File last commit:

r27495:1a9d9554
r28660:b479c4a0 merge
Show More
fixup_whats_new_pr.py
39 lines | 1.1 KiB | text/x-python | PythonLexer
/ tools / fixup_whats_new_pr.py
"""
This tool is used during CI testing to make sure sphinx raise no error.
During development, we like to have whatsnew/pr/*.rst documents to track
individual new features. Unfortunately they other either:
- have no title (sphinx complains)
- are not included in any toctree (sphinx complain)
This fix-them up by "inventing" a title, before building the docs. At release
time, these title and files will anyway be rewritten into the actual release
notes.
"""
from pathlib import Path
def main():
folder = Path("docs/source/whatsnew/pr/")
files = list(folder.glob("*.rst"))
print(files)
for filepath in files:
print("Adding pseudo-title to:", filepath.name)
title = filepath.name[:-4].split("/")[-1].replace("-", " ").capitalize()
data = filepath.read_text(encoding="utf-8")
try:
if data and data.splitlines()[1].startswith('='):
continue
except IndexError:
pass
with filepath.open("w", encoding="utf-8") as f:
f.write(title + "\n")
f.write("=" * len(title) + "\n\n")
f.write(data)
if __name__ == '__main__':
main()