HyukjinKwon commented on a change in pull request #31770:
URL: https://github.com/apache/spark/pull/31770#discussion_r589113277
##########
File path: python/docs/source/conf.py
##########
@@ -177,7 +177,24 @@
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
-#html_extra_path = []
+redirects_dir = 'redirects'
+html_extra_path = [redirects_dir]
+
+os.makedirs(redirects_dir, exist_ok=True)
+for moved_page in ['', '.ml', '.mllib', '.sql', '.streaming']:
+ moved_file = f'pyspark{moved_page}.html'
Review comment:
I think simply mapping it wouldn't work. For example,
new URL:
```
reference/api/pyspark.sql.functions.from_json.html?highlight=from_json#pyspark.sql.functions.from_json
```
old URL:
```
pyspark.sql.html?highlight=from_json#pyspark.sql.functions.from_json
```
Can we leverage other extensions such as
https://gitlab.com/documatt/sphinx-reredirects &
https://pypi.org/project/sphinx-reredirects/, and just go back to the root page
by wildcards?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]