This repository was archived by the owner on Apr 8, 2025. It is now read-only.
File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,8 @@ def dump_sphinx_data(app, exception):
195
195
196
196
This includes:
197
197
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
199
200
* `titles`: A mapping of HTML Filename -> Page Title
200
201
* `types`: A mapping of Sphinx Domain type slugs -> human-readable name for that type
201
202
@@ -206,6 +207,7 @@ def dump_sphinx_data(app, exception):
206
207
types = {}
207
208
titles = {}
208
209
paths = {}
210
+ pages = {}
209
211
210
212
for domain_name , domain_obj in app .env .domains .items ():
211
213
for type_name , type_obj in domain_obj .object_types .items ():
@@ -216,11 +218,13 @@ def dump_sphinx_data(app, exception):
216
218
page_uri = app .builder .get_target_uri (page )
217
219
titles [page_uri ] = title .astext ()
218
220
paths [page_uri ] = app .env .doc2path (page , base = None )
221
+ pages [page_uri ] = page
219
222
220
223
to_dump = {
221
224
'types' : types ,
222
225
'titles' : titles ,
223
226
'paths' : paths ,
227
+ 'pages' : pages ,
224
228
}
225
229
226
230
# We need to get the output directory where the docs are built
Original file line number Diff line number Diff line change @@ -77,7 +77,13 @@ def test_generate_json_domain_artifacts(self):
77
77
'pyexample-json' ,
78
78
'_build/json/readthedocs-sphinx-domain-names.json' ,
79
79
[
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
81
87
'"index.html": "Welcome to pyexample' ,
82
88
],
83
89
)
You can’t perform that action at this time.
0 commit comments