Skip to content

Commit

Permalink
Take into account Sphinx updates in docs and release script
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Jan 12, 2025
1 parent 8ed4430 commit 48ea123
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extensions = ["sphinx.ext.autodoc", "sphinx.ext.extlinks"]

exclude_patterns = ["_build"]
source_suffix = ".rst"
source_suffix = {".rst": "restructuredtext"}
master_doc = "index"

project = "beets"
Expand Down Expand Up @@ -66,7 +66,7 @@
"logo": {
"text": "beets",
},
"pygment_light_style": "bw",
"pygments_light_style": "bw",
}
html_title = "beets"
html_logo = "_static/beets_logo_nobg.png"
Expand Down
7 changes: 5 additions & 2 deletions extra/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def from_line(cls, line: str) -> Ref:
Each line has the following structure:
<id> [optional title : ] <relative-url-path>
See the output of
python -m sphinx.ext.intersphinx docs/_build/html/objects.inv
"""
if len(line_parts := line.split(" ", 1)) == 1:
return cls(line, None, None)
Expand Down Expand Up @@ -82,10 +84,11 @@ def get_refs() -> dict[str, Ref]:
with redirect_stdout(captured_output):
intersphinx.inspect_main([str(objects_filepath)])

lines = captured_output.getvalue().replace("\t", " ").splitlines()
return {
r.id: r
for ln in captured_output.getvalue().split("\n")
if ln.startswith("\t") and (r := Ref.from_line(ln.strip()))
for ln in lines
if ln.startswith(" ") and (r := Ref.from_line(ln.strip()))
}


Expand Down

0 comments on commit 48ea123

Please sign in to comment.