Commit 2b8c2e34 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

doc/user: add custom 404 pages for the old links



Switching from doxygen to sphinx broke a bunch of links because doxygen used
whatever the argument to @page was - and that usually had underscores. Sphinx
uses filenames (which use dashes) so now we have a bunch of old links going to
a 404. For the transition period at least, insert a custom 404 page for each
of those to tell users this doesn't exist anymore.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent bf475898
:orphan:
===
404
===
This page has permanently moved, probably to `<@TARGET@>`_
This placeholder page will be removed soon.
......@@ -20,6 +20,72 @@ sphinx_conf_py = configure_file(input : 'conf.py.in',
configuration : sphinx_config,
install : false)
# 404 replacements for old URLs
# The switch to sphinx caused a few pages to be renamed, sphinx uses
# filename.html whereas doxygen used whatever the @page foo was. So old docs
# *mostly* used underscores, now we're consistent with dashes.
# We can't use htaccess on the server, so let's auto-generate a 404 list
# with a basic page telling users that the link has moved. This can be
# removed in a few months, towards the end of 2018.
#
# File list is: [current-sphinx-input-file, old-generated-page]
# If they're the same they'll be ignored.
src_404s = [
[ 'absolute-axes.rst', 'absolute_axes.html'],
[ 'absolute-coordinate-ranges.rst', 'absolute_coordinate_ranges.html'],
[ 'architecture.rst', 'architecture.html'],
[ 'building.rst', 'building_libinput.html'],
[ 'button-debouncing.rst', 'button_debouncing.html'],
[ 'clickpad-softbuttons.rst', 'clickpad_softbuttons.html'],
[ 'configuration.rst', 'config_options.html'],
[ 'contributing.rst', 'contributing.html'],
[ 'development.rst', 'development.html'],
[ 'device-configuration-via-udev.rst', 'udev_config.html'],
[ 'device-quirks.rst', 'device-quirks.html'],
[ 'faqs.rst', 'faq.html'],
[ 'features.rst', 'features.html'],
[ 'gestures.rst', 'gestures.html'],
[ 'middle-button-emulation.rst', 'middle_button_emulation.html'],
[ 'normalization-of-relative-motion.rst', 'motion_normalization.html'],
[ 'palm-detection.rst', 'palm_detection.html'],
[ 'pointer-acceleration.rst', 'pointer-acceleration.html'],
[ 'reporting-bugs.rst', 'reporting_bugs.html'],
[ 'scrolling.rst', 'scrolling.html'],
[ 'seats.rst', 'seats.html'],
[ 'switches.rst', 'switches.html'],
[ 't440-support.rst', 't440_support.html'],
[ 'tablet-support.rst', 'tablet-support.html'],
[ 'tapping.rst', 'tapping.html'],
[ 'test-suite.rst', 'test-suite.html'],
[ 'timestamps.rst', 'timestamps.html'],
[ 'tools.rst', 'tools.html'],
[ 'touchpad-jitter.rst', 'touchpad_jitter.html'],
[ 'touchpad-jumping-cursors.rst', 'touchpad_jumping_cursor.html'],
[ 'touchpad-pressure.rst', 'touchpad_pressure.html'],
[ 'touchpads.rst', 'touchpads.html'],
[ 'trackpoints.rst', 'trackpoints.html'],
[ 'troubleshooting.rst', 'troubleshooting.html'],
[ 'what-is-libinput.rst', 'what_is_libinput.html'],
]
dst_404s = []
foreach s404 : src_404s
target = s404[0]
oldpage = s404[1]
tname = target.split('.rst')[0]
oname = oldpage.split('.html')[0]
if tname != oname
config_404 = configuration_data()
config_404.set('TARGET', '@0@.html'.format(tname))
c = configure_file(input : '404.rst',
output : '@0@.rst'.format(oname),
configuration : config_404,
install : false)
dst_404s += [c]
endif
endforeach
src_extra = [
# dot drawings
'dot/seats-sketch.gv',
......@@ -113,7 +179,7 @@ src_sphinx = custom_target('sphinx-sources',
# do not use -j, it breaks on Ubuntu
sphinx_output_dir = 'Documentation'
custom_target('sphinx',
input : [ sphinx_conf_py, git_version_page ] + src_rst + src_extra,
input : [ sphinx_conf_py, git_version_page ] + src_rst + src_extra + dst_404s,
output : [ sphinx_output_dir ],
command : [ sphinx, '-q', '-b', 'html', '-a',
meson.current_build_dir(), sphinx_output_dir],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment