|
24 | 24 |
|
25 | 25 | import jinja2 |
26 | 26 |
|
| 27 | +# -- Copy files for docs -------------------------------------------------- |
| 28 | +# |
| 29 | +# We avoid duplicating the information, but we do not use symlinks to be |
| 30 | +# able to build the docs on Windows |
| 31 | +shutil.copyfile("../RELEASE_PROCESS.rst", "RELEASE_PROCESS.rst") |
| 32 | +shutil.copyfile("../CHANGES.rst", "CHANGES.rst") |
| 33 | +shutil.copyfile("../CONTRIBUTING.rst", "CONTRIBUTING.rst") |
| 34 | + |
| 35 | +# Allow skipping jupyterlite to speed up builds (e.g. html-noplot) |
| 36 | +_SKIP_JUPYTERLITE = os.environ.get("SKIP_JUPYTERLITE", "").strip() in ( |
| 37 | + "1", |
| 38 | + "true", |
| 39 | + "yes", |
| 40 | +) |
| 41 | + |
27 | 42 | # Generate the table report html file for the homepage |
28 | 43 | sys.path.append(os.path.relpath(".")) |
29 | 44 | from data_ops_report import create_data_ops_report |
|
43 | 58 | from github_link import make_linkcode_resolve |
44 | 59 | from sphinx_gallery.notebook import add_code_cell, add_markdown_cell |
45 | 60 |
|
46 | | -# -- Copy files for docs -------------------------------------------------- |
47 | | -# |
48 | | -# We avoid duplicating the information, but we do not use symlinks to be |
49 | | -# able to build the docs on Windows |
50 | | -shutil.copyfile("../RELEASE_PROCESS.rst", "RELEASE_PROCESS.rst") |
51 | | -shutil.copyfile("../CHANGES.rst", "CHANGES.rst") |
52 | | -shutil.copyfile("../CONTRIBUTING.rst", "CONTRIBUTING.rst") |
53 | | - |
54 | 61 | # -- General configuration ------------------------------------------------ |
55 | 62 |
|
56 | 63 | # If your documentation needs a minimal Sphinx version, state it here. |
|
76 | 83 | "sphinx_copybutton", |
77 | 84 | "sphinx_gallery.gen_gallery", |
78 | 85 | "autoshortsummary", |
| 86 | + "sphinx_llms_txt", |
| 87 | + "sphinx_markdown_builder", |
79 | 88 | ] |
80 | 89 |
|
| 90 | +# -- sphinx-llms-txt configuration ------------------------------------------- |
| 91 | +# Link to Markdown sources in _sources/ (generated by the markdown builder). |
| 92 | +llms_txt_uri_template = "{base_url}_sources/{docname}.md" |
| 93 | + |
81 | 94 | try: |
82 | 95 | import sphinxext.opengraph # noqa |
83 | 96 |
|
84 | 97 | extensions.append("sphinxext.opengraph") |
85 | 98 | except ImportError: |
86 | 99 | print("ERROR: sphinxext.opengraph import failed") |
87 | 100 |
|
88 | | -try: |
89 | | - import jupyterlite_sphinx # noqa: F401 |
90 | | - |
91 | | - extensions.append("jupyterlite_sphinx") |
92 | | - with_jupyterlite = True |
93 | | -except ImportError: |
94 | | - # In some cases we don't want to require jupyterlite_sphinx to be installed, |
95 | | - # e.g. the doc-min-dependencies build |
96 | | - warnings.warn( |
97 | | - "jupyterlite_sphinx is not installed, you need to install it " |
98 | | - "if you want JupyterLite links to appear in each example" |
99 | | - ) |
| 101 | +if not _SKIP_JUPYTERLITE: |
| 102 | + try: |
| 103 | + import jupyterlite_sphinx # noqa: F401 |
| 104 | + |
| 105 | + extensions.append("jupyterlite_sphinx") |
| 106 | + with_jupyterlite = True |
| 107 | + except ImportError: |
| 108 | + # In some cases we don't want to require jupyterlite_sphinx to be installed, |
| 109 | + # e.g. the doc-min-dependencies build |
| 110 | + warnings.warn( |
| 111 | + "jupyterlite_sphinx is not installed, you need to install it " |
| 112 | + "if you want JupyterLite links to appear in each example" |
| 113 | + ) |
| 114 | + with_jupyterlite = False |
| 115 | +else: |
100 | 116 | with_jupyterlite = False |
101 | 117 |
|
102 | 118 | import sphinx_autosummary_accessors |
|
0 commit comments