Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit c13a5aa

Browse files
committed
A bit more review feedback
1 parent 3733654 commit c13a5aa

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

readthedocs_ext/readthedocs.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ def dump_sphinx_data(app, exception):
195195
196196
This includes:
197197
198-
* `paths`: A mapping of rst file -> HTML filename
198+
* `paths`: A mapping of HTML Filename -> RST file
199+
* `pages`: A mapping of HTML Filename -> Sphinx Page name
199200
* `titles`: A mapping of HTML Filename -> Page Title
200201
* `types`: A mapping of Sphinx Domain type slugs -> human-readable name for that type
201202
@@ -206,6 +207,7 @@ def dump_sphinx_data(app, exception):
206207
types = {}
207208
titles = {}
208209
paths = {}
210+
pages = {}
209211

210212
for domain_name, domain_obj in app.env.domains.items():
211213
for type_name, type_obj in domain_obj.object_types.items():
@@ -216,11 +218,13 @@ def dump_sphinx_data(app, exception):
216218
page_uri = app.builder.get_target_uri(page)
217219
titles[page_uri] = title.astext()
218220
paths[page_uri] = app.env.doc2path(page, base=None)
221+
pages[page_uri] = page
219222

220223
to_dump = {
221224
'types': types,
222225
'titles': titles,
223226
'paths': paths,
227+
'pages': pages,
224228
}
225229

226230
# We need to get the output directory where the docs are built

tests/test_integration.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ def test_generate_json_domain_artifacts(self):
7777
'pyexample-json',
7878
'_build/json/readthedocs-sphinx-domain-names.json',
7979
[
80-
'py:exception', 'js:class',
80+
# types
81+
'"js:class": "class"',
82+
# pages
83+
'"index.html": "index"',
84+
# paths
85+
'"index.html": "index.rst"',
86+
# titles
8187
'"index.html": "Welcome to pyexample',
8288
],
8389
)

0 commit comments

Comments
 (0)