From ceb405067ac406eddcdf8c62bf22889481c2b3d5 Mon Sep 17 00:00:00 2001 From: Max Hilbrunner Date: Sun, 23 Jan 2022 04:46:02 +0100 Subject: [PATCH] Fix RTD redirects --- _tools/redirects/create_redirects.py | 24 +++---- _tools/redirects/redirects.csv | 98 +++++++--------------------- 2 files changed, 36 insertions(+), 86 deletions(-) diff --git a/_tools/redirects/create_redirects.py b/_tools/redirects/create_redirects.py index b1ce58484..e8ab400c5 100644 --- a/_tools/redirects/create_redirects.py +++ b/_tools/redirects/create_redirects.py @@ -247,9 +247,9 @@ def main(): "destination", }, "CSV file must have a header and two columns: source, destination." - for row in redirects_file: - to_add.append([row["source"], row["destination"]]) - print("Loaded", len(redirects_file), "redirects from", args.file + ".") + for row in redirects_file: + to_add.append([row["source"], row["destination"]]) + print("Loaded", len(redirects_file), "redirects from", args.file + ".") existing = [] if not args.dry_run: @@ -261,6 +261,8 @@ def main(): redirects = [] added = {} + sources = {} + for redirect in to_add: if len(redirect) != 2: print("Invalid redirect:", redirect, "- expected 2 elements, got:", len(redirect)) @@ -278,17 +280,19 @@ def main(): print("Invalid redirect:", redirect, "- invalid URL: should start with slash!") continue + if redirect[0] in sources: + print("Invalid redirect:", redirect, + "- collision, source", redirect[0], "already has redirect:", + sources[redirect[0]]) + continue + redirect_id = id(redirect[0], redirect[1]) if redirect_id in added: # Duplicate; skip. continue - reverse_id = id(redirect[1], redirect[0]) - if reverse_id in added: - # Duplicate; skip. - continue - added[redirect_id] = True + sources[redirect[0]] = redirect redirects.append(redirect) redirects.sort(key=redirect_to_str) @@ -308,14 +312,10 @@ def main(): if not id(redirect[0], redirect[1]) in existing_ids: make_redirect(redirect[0], redirect[1], args) - if not id(redirect[1], redirect[0]) in existing_ids: - make_redirect(redirect[1], redirect[0], args) - if not args.dry_run: sleep() print("Finished creating", len(redirects), "redirects.") - print("(" + str(2*len(redirects)) + " including reverse redirects.)") if args.dry_run: print("THIS WAS A DRY RUN, NOTHING WAS SUBMITTED TO READTHEDOCS!") diff --git a/_tools/redirects/redirects.csv b/_tools/redirects/redirects.csv index b6a89ed56..159e3ca20 100644 --- a/_tools/redirects/redirects.csv +++ b/_tools/redirects/redirects.csv @@ -1,6 +1,5 @@ source,destination /classes/_classes.html,/classes/ -/classes/class_bulletphysicsserver.html,/classes/class_gltfdocument.html /community/tutorials/3d/mesh_generation_with_heightmap_and_shaders.html,/tutorials/3d/mesh_generation_with_heightmap_and_shaders.html /community/tutorials/gdnative/gdnative-c-example.html,/tutorials/plugins/gdnative/gdnative-c-example.html /community/tutorials/gdnative/index.html,/tutorials/plugins/gdnative/index.html @@ -87,20 +86,26 @@ source,destination /learning/editor/command_line_tutorial.html,/getting_started/editor/command_line_tutorial.html /learning/editor/index.html,/getting_started/editor/index.html /learning/editor/unity_to_godot.html,/getting_started/editor/unity_to_godot.html +/learning/features/2d/,/tutorials/2d/_2d.html /learning/features/2d/2d_transforms.html,/tutorials/2d/2d_transforms.html /learning/features/2d/canvas_layers.html,/tutorials/2d/canvas_layers.html /learning/features/2d/custom_drawing_in_2d.html,/tutorials/2d/custom_drawing_in_2d.html /learning/features/2d/index.html,/tutorials/2d/index.html /learning/features/2d/particle_systems_2d.html,/tutorials/2d/particle_systems_2d.html /learning/features/2d/using_tilemaps.html,/tutorials/2d/using_tilemaps.html +/learning/features/3d/,/tutorials/3d/_3d.html /learning/features/3d/3d_performance_and_limitations.html,/tutorials/3d/3d_performance_and_limitations.html /learning/features/3d/baked_lightmaps.html,/tutorials/3d/baked_lightmaps.html /learning/features/3d/environment_and_post_processing.html,/tutorials/3d/environment_and_post_processing.html +/learning/features/3d/fixed_materials.html,/tutorials/3d/fixed_materials.html /learning/features/3d/gi_probes.html,/tutorials/3d/gi_probes.html /learning/features/3d/high_dynamic_range.html,/tutorials/3d/high_dynamic_range.html +/learning/features/3d/importing_3d_meshes.html,/tutorials/3d/importing_3d_meshes.html +/learning/features/3d/importing_3d_scenes.html,/tutorials/3d/importing_3d_scenes.html /learning/features/3d/index.html,/tutorials/3d/index.html /learning/features/3d/introduction_to_3d.html,/tutorials/3d/introduction_to_3d.html /learning/features/3d/lights_and_shadows.html,/tutorials/3d/lights_and_shadows.html +/learning/features/3d/materials.html,/tutorials/3d/materials.html /learning/features/3d/reflection_probes.html,/tutorials/3d/reflection_probes.html /learning/features/3d/spatial_material.html,/tutorials/3d/spatial_material.html /learning/features/3d/using_gridmaps.html,/tutorials/3d/using_gridmaps.html @@ -114,6 +119,7 @@ source,destination /learning/features/audio/audio_buses.html,/tutorials/audio/audio_buses.html /learning/features/audio/audio_streams.html,/tutorials/audio/audio_streams.html /learning/features/audio/index.html,/tutorials/audio/index.html +/learning/features/gui/,/tutorials/2d/_2d_gui.html /learning/features/gui/bbcode_in_richtextlabel.html,/tutorials/gui/bbcode_in_richtextlabel.html /learning/features/gui/custom_gui_controls.html,/tutorials/gui/custom_gui_controls.html /learning/features/gui/gui_skinning.html,/tutorials/gui/gui_skinning.html @@ -122,10 +128,14 @@ source,destination /learning/features/inputs/index.html,/tutorials/inputs/index.html /learning/features/inputs/inputevent.html,/tutorials/inputs/inputevent.html /learning/features/inputs/mouse_and_input_coordinates.html,/tutorials/inputs/mouse_and_input_coordinates.html +/learning/features/lighting/lighting.html,/tutorials/3d/lighting.html +/learning/features/lighting/shadow_mapping.html,/tutorials/3d/shadow_mapping.html +/learning/features/math/,/tutorials/_math.html /learning/features/math/index.html,/tutorials/math/index.html /learning/features/math/matrices_and_transforms.html,/tutorials/math/matrices_and_transforms.html /learning/features/math/vector_math.html,/tutorials/math/vector_math.html /learning/features/math/vectors_advanced.html,/tutorials/math/vectors_advanced.html +/learning/features/misc/,/tutorials/_misc_tutorials.html /learning/features/misc/background_loading.html,/tutorials/misc/background_loading.html /learning/features/misc/binary_serialization_api.html,/tutorials/misc/binary_serialization_api.html /learning/features/misc/data_paths.html,/tutorials/misc/data_paths.html @@ -136,10 +146,12 @@ source,destination /learning/features/misc/locales.html,/tutorials/misc/locales.html /learning/features/misc/pausing_games.html,/tutorials/misc/pausing_games.html /learning/features/misc/saving_games.html,/tutorials/misc/saving_games.html +/learning/features/networking/,/tutorials/_networking.html /learning/features/networking/high_level_multiplayer.html,/tutorials/networking/high_level_multiplayer.html /learning/features/networking/http_client_class.html,/tutorials/networking/http_client_class.html /learning/features/networking/index.html,/tutorials/networking/index.html /learning/features/networking/ssl_certificates.html,/tutorials/networking/ssl_certificates.html +/learning/features/physics/,/tutorials/2d/_2d_physics.html /learning/features/physics/index.html,/tutorials/physics/index.html /learning/features/physics/kinematic_character_2d.html,/tutorials/physics/kinematic_character_2d.html /learning/features/physics/physics_introduction.html,/tutorials/physics/physics_introduction.html @@ -147,6 +159,7 @@ source,destination /learning/features/platform/android_in_app_purchases.html,/tutorials/platform/android_in_app_purchases.html /learning/features/platform/index.html,/tutorials/platform/index.html /learning/features/platform/services_for_ios.html,/tutorials/platform/services_for_ios.html +/learning/features/shading/,/tutorials/_shaders.html /learning/features/shading/index.html,/tutorials/shading/index.html /learning/features/shading/screen-reading_shaders.html,/tutorials/shading/screen-reading_shaders.html /learning/features/shading/shader_materials.html,/tutorials/shading/shader_materials.html @@ -168,9 +181,11 @@ source,destination /learning/scripting/visual_script/index.html,/getting_started/scripting/visual_script/index.html /learning/scripting/visual_script/nodes_purposes.html,/getting_started/scripting/visual_script/nodes_purposes.html /learning/scripting/visual_script/what_is_visual_scripting.html,/getting_started/scripting/visual_script/what_is_visual_scripting.html +/learning/step_by_step/,/tutorials/step_by_step/_step_by_step.html /learning/step_by_step/animations.html,/getting_started/step_by_step/animations.html /learning/step_by_step/filesystem.html,/getting_started/step_by_step/filesystem.html /learning/step_by_step/godot_design_philosophy.html,/getting_started/step_by_step/godot_design_philosophy.html +/learning/step_by_step/gui_tutorial.html,/tutorials/step_by_step/gui_tutorial.html /learning/step_by_step/index.html,/getting_started/step_by_step/index.html /learning/step_by_step/instancing.html,/getting_started/step_by_step/instancing.html /learning/step_by_step/instancing_continued.html,/getting_started/step_by_step/instancing_continued.html @@ -180,6 +195,7 @@ source,destination /learning/step_by_step/scenes_and_nodes.html,/getting_started/step_by_step/scenes_and_nodes.html /learning/step_by_step/scripting.html,/getting_started/step_by_step/scripting.html /learning/step_by_step/scripting_continued.html,/getting_started/step_by_step/scripting_continued.html +/learning/step_by_step/simple_2d_game.html,/tutorials/step_by_step/simple_2d_game.html /learning/step_by_step/singletons_autoload.html,/getting_started/step_by_step/singletons_autoload.html /learning/step_by_step/splash_screen.html,/getting_started/step_by_step/splash_screen.html /learning/step_by_step/ui_code_a_life_bar.html,/getting_started/step_by_step/ui_code_a_life_bar.html @@ -187,12 +203,19 @@ source,destination /learning/step_by_step/ui_introduction_to_the_ui_system.html,/getting_started/step_by_step/ui_introduction_to_the_ui_system.html /learning/step_by_step/ui_main_menu.html,/getting_started/step_by_step/ui_main_menu.html /learning/step_by_step/your_first_game.html,/getting_started/step_by_step/your_first_game.html +/learning/workflow/,/tutorials/asset_pipeline/_asset_pipeline.html +/learning/workflow/assets/,/tutorials/asset_pipeline/_import.html +/learning/workflow/assets/exporting_images.html,/tutorials/asset_pipeline/exporting_images.html /learning/workflow/assets/import_process.html,/getting_started/workflow/assets/import_process.html /learning/workflow/assets/importing_audio_samples.html,/getting_started/workflow/assets/importing_audio_samples.html +/learning/workflow/assets/importing_fonts.html,/tutorials/asset_pipeline/importing_fonts.html /learning/workflow/assets/importing_images.html,/getting_started/workflow/assets/importing_images.html /learning/workflow/assets/importing_scenes.html,/getting_started/workflow/assets/importing_scenes.html +/learning/workflow/assets/importing_textures.html,/tutorials/asset_pipeline/importing_textures.html /learning/workflow/assets/importing_translations.html,/getting_started/workflow/assets/importing_translations.html /learning/workflow/assets/index.html,/getting_started/workflow/assets/index.html +/learning/workflow/assets/managing_image_files.html,/tutorials/asset_pipeline/managing_image_files.html +/learning/workflow/export/,/tutorials/asset_pipeline/_export.html /learning/workflow/export/customizing_html5_shell.html,/getting_started/workflow/export/customizing_html5_shell.html /learning/workflow/export/exporting_for_android.html,/getting_started/workflow/export/exporting_for_android.html /learning/workflow/export/exporting_for_ios.html,/getting_started/workflow/export/exporting_for_ios.html @@ -240,53 +263,12 @@ source,destination /reference/shading_language.html,/learning/features/shading/shading_language.html /reference/unity_to_godot.html,/learning/editor/unity_to_godot.html /reference/variant_class.html,/development/cpp/variant_class.html -/tutorials/2d/_2d.html,/learning/features/2d/ -/tutorials/2d/_2d_gui.html,/learning/features/gui/ -/tutorials/2d/_2d_physics.html,/learning/features/physics/ -/tutorials/2d/custom_gui_controls.html,/learning/features/gui/custom_gui_controls.html -/tutorials/2d/cutout_animation.html,/learning/features/animation/cutout_animation.html -/tutorials/2d/gui_skinning.html,/learning/features/gui/gui_skinning.html -/tutorials/2d/kinematic_character_2d.html,/learning/features/physics/kinematic_character_2d.html -/tutorials/2d/physics_introduction.html,/learning/features/physics/physics_introduction.html -/tutorials/2d/screen-reading_shaders.html,/learning/features/shading/screen-reading_shaders.html -/tutorials/2d/size_and_anchors.html,/learning/features/gui/size_and_anchors.html -/tutorials/2d/viewport_and_canvas_transforms.html,/learning/features/2d/2d_transforms.html -/tutorials/3d/_3d.html,/learning/features/3d/ -/tutorials/3d/_3d_physics.html,/learning/features/physics/ -/tutorials/3d/fixed_materials.html,/learning/features/3d/fixed_materials.html -/tutorials/3d/importing_3d_meshes.html,/learning/features/3d/importing_3d_meshes.html -/tutorials/3d/importing_3d_scenes.html,/learning/features/3d/importing_3d_scenes.html /tutorials/3d/inverse_kinematics.html,/community/tutorials/3d/inverse_kinematics.html -/tutorials/3d/lighting.html,/learning/features/lighting/lighting.html -/tutorials/3d/materials.html,/learning/features/3d/materials.html -/tutorials/3d/shader_materials.html,/learning/features/shading/shader_materials.html -/tutorials/3d/shadow_mapping.html,/learning/features/lighting/shadow_mapping.html /tutorials/3d/vertex_animation/animating_thousands_of_fish.html,/tutorials/performance/vertex_animation/animating_thousands_of_fish.html /tutorials/3d/vertex_animation/controlling_thousands_of_fish.html,/tutorials/performance/vertex_animation/controlling_thousands_of_fish.html /tutorials/3d/vertex_animation/index.html,/tutorials/performance/vertex_animation/index.html /tutorials/3d/working_with_3d_skeletons.html,/community/tutorials/3d/working_with_3d_skeletons.html -/tutorials/_math.html,/learning/features/math/ -/tutorials/_misc_tutorials.html,/learning/features/misc/ -/tutorials/_networking.html,/learning/features/networking/ /tutorials/_plugins.html,/development/plugins/ -/tutorials/_shaders.html,/learning/features/shading/ -/tutorials/asset_pipeline/_asset_pipeline.html,/learning/workflow/ -/tutorials/asset_pipeline/_export.html,/learning/workflow/export/ -/tutorials/asset_pipeline/_import.html,/learning/workflow/assets/ -/tutorials/asset_pipeline/exporting_for_android.html,/learning/workflow/export/exporting_for_android.html -/tutorials/asset_pipeline/exporting_for_ios.html,/learning/workflow/export/exporting_for_ios.html -/tutorials/asset_pipeline/exporting_for_pc.html,/learning/workflow/export/exporting_for_pc.html -/tutorials/asset_pipeline/exporting_for_uwp.html,/learning/workflow/export/exporting_for_uwp.html -/tutorials/asset_pipeline/exporting_for_web.html,/learning/workflow/export/exporting_for_web.html -/tutorials/asset_pipeline/exporting_images.html,/learning/workflow/assets/exporting_images.html -/tutorials/asset_pipeline/exporting_projects.html,/learning/workflow/export/exporting_projects.html -/tutorials/asset_pipeline/import_process.html,/learning/workflow/assets/import_process.html -/tutorials/asset_pipeline/importing_audio_samples.html,/learning/workflow/assets/importing_audio_samples.html -/tutorials/asset_pipeline/importing_fonts.html,/learning/workflow/assets/importing_fonts.html -/tutorials/asset_pipeline/importing_textures.html,/learning/workflow/assets/importing_textures.html -/tutorials/asset_pipeline/importing_translations.html,/learning/workflow/assets/importing_translations.html -/tutorials/asset_pipeline/managing_image_files.html,/learning/workflow/assets/managing_image_files.html -/tutorials/asset_pipeline/one-click_deploy.html,/learning/workflow/export/one-click_deploy.html /tutorials/assetlib/index.html,/community/asset_library/index.html /tutorials/assetlib/uploading_to_assetlib.html,/community/asset_library/uploading_to_assetlib.html /tutorials/assetlib/using_assetlib.html,/community/asset_library/using_assetlib.html @@ -300,28 +282,13 @@ source,destination /tutorials/debug/debugger_panel.html,/tutorials/scripting/debug/debugger_panel.html /tutorials/debug/index.html,/tutorials/scripting/debug/index.html /tutorials/debug/overview_of_debugging_tools.html,/tutorials/scripting/debug/overview_of_debugging_tools.html -/tutorials/engine/background_loading.html,/learning/features/misc/background_loading.html -/tutorials/engine/data_paths.html,/learning/features/misc/data_paths.html -/tutorials/engine/encrypting_save_games.html,/learning/features/misc/encrypting_save_games.html -/tutorials/engine/handling_quit_requests.html,/learning/features/misc/handling_quit_requests.html -/tutorials/engine/inputevent.html,/learning/features/inputs/inputevent.html -/tutorials/engine/internationalizing_games.html,/learning/features/misc/internationalizing_games.html -/tutorials/engine/mouse_and_input_coordinates.html,/learning/features/inputs/mouse_and_input_coordinates.html -/tutorials/engine/multiple_resolutions.html,/learning/features/viewports/multiple_resolutions.html -/tutorials/engine/pausing_games.html,/learning/features/misc/pausing_games.html -/tutorials/engine/project_organization.html,/learning/workflow/project_setup/project_organization.html -/tutorials/engine/saving_games.html,/learning/features/misc/saving_games.html -/tutorials/engine/viewports.html,/learning/features/viewports/viewports.html /tutorials/gui/bbcode_in_richtextlabel.html,/tutorials/ui/bbcode_in_richtextlabel.html /tutorials/gui/control_node_gallery.html,/tutorials/ui/control_node_gallery.html /tutorials/gui/custom_gui_controls.html,/tutorials/ui/custom_gui_controls.html /tutorials/gui/gui_containers.html,/tutorials/ui/gui_containers.html /tutorials/gui/size_and_anchors.html,/tutorials/ui/size_and_anchors.html -/tutorials/high_level_multiplayer.html,/learning/features/networking/high_level_multiplayer.html -/tutorials/http_client_class.html,/learning/features/networking/http_client_class.html /tutorials/legal/complying_with_licenses.html,/about/complying_with_licenses.html /tutorials/making_plugins.html,/development/plugins/making_plugins.html -/tutorials/matrices_and_transforms.html,/learning/features/math/matrices_and_transforms.html /tutorials/mesh_generation_with_heightmap_and_shaders.html,/community/tutorials/3d/mesh_generation_with_heightmap_and_shaders.html /tutorials/misc/background_loading.html,/tutorials/io/background_loading.html /tutorials/misc/binary_serialization_api.html,/tutorials/io/binary_serialization_api.html @@ -351,7 +318,6 @@ source,destination /tutorials/plugins/gdnative/gdnative-c-example.html,/tutorials/scripting/gdnative/gdnative_c_example.html /tutorials/plugins/gdnative/gdnative-cpp-example.html,/tutorials/scripting/gdnative/gdnative_cpp_example.html /tutorials/plugins/gdnative/index.html,/tutorials/scripting/gdnative/index.html -/tutorials/ray-casting.html,/learning/features/physics/ray-casting.html /tutorials/shading/advanced_postprocessing.html,/tutorials/shaders/advanced_postprocessing.html /tutorials/shading/godot_shader_language_style_guide.html,/tutorials/shaders/shaders_style_guide.html /tutorials/shading/index.html,/tutorials/shaders/index.html @@ -366,24 +332,8 @@ source,destination /tutorials/shading/visual_shaders.html,/tutorials/shaders/visual_shaders.html /tutorials/shading/your_first_shader/index.html,/tutorials/shaders/your_first_shader/index.html /tutorials/shading/your_first_shader/your_second_spatial_shader.html,/tutorials/shaders/your_first_shader/your_second_3d_shader.html -/tutorials/ssl_certificates.html,/learning/features/networking/ssl_certificates.html -/tutorials/step_by_step/_step_by_step.html,/learning/step_by_step/ -/tutorials/step_by_step/animations.html,/learning/step_by_step/animations.html -/tutorials/step_by_step/filesystem.html,/learning/step_by_step/filesystem.html -/tutorials/step_by_step/gui_tutorial.html,/learning/step_by_step/gui_tutorial.html -/tutorials/step_by_step/instancing.html,/learning/step_by_step/instancing.html -/tutorials/step_by_step/instancing_continued.html,/learning/step_by_step/instancing_continued.html -/tutorials/step_by_step/resources.html,/learning/step_by_step/resources.html -/tutorials/step_by_step/scene_tree.html,/learning/step_by_step/scene_tree.html -/tutorials/step_by_step/scenes_and_nodes.html,/learning/step_by_step/scenes_and_nodes.html -/tutorials/step_by_step/scripting.html,/learning/step_by_step/scripting.html -/tutorials/step_by_step/scripting_continued.html,/learning/step_by_step/scripting_continued.html -/tutorials/step_by_step/simple_2d_game.html,/learning/step_by_step/simple_2d_game.html -/tutorials/step_by_step/singletons_autoload.html,/learning/step_by_step/singletons_autoload.html -/tutorials/step_by_step/splash_screen.html,/learning/step_by_step/splash_screen.html /tutorials/threads/thread_safe_apis.html,/tutorials/performance/threads/thread_safe_apis.html /tutorials/threads/using_multiple_threads.html,/tutorials/performance/threads/using_multiple_threads.html -/tutorials/vector_math.html,/learning/features/math/vector_math.html /tutorials/viewports/custom_postprocessing.html,/tutorials/shaders/custom_postprocessing.html /tutorials/viewports/multiple_resolutions.html,/tutorials/rendering/multiple_resolutions.html /tutorials/viewports/using_viewport_as_texture.html,/tutorials/shaders/using_viewport_as_texture.html