summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorWismill <dev@wismill.eu>2023-05-14 15:11:15 +0200
committerGitHub <noreply@github.com>2023-05-14 15:11:15 +0200
commit64aaa7cda29196a9142dc8785c29201468429fe8 (patch)
treee8b0eab4da9ba6eb573751edd0cb46ef637bcb35 /meson.build
parentfc664cf1cc8c1cccd6137134cf5018d8fc9b1ca5 (diff)
downloadxorg-lib-libxkbcommon-64aaa7cda29196a9142dc8785c29201468429fe8.tar.gz
Add support for stable doc URLs (#342)
Doc URLs may change with time because they depend on Doxygen machinery. This is unfortunate because it is good practice to keep valid URLs (see: https://www.w3.org/Provider/Style/URI.html). I could not find a built-in solution in Doxygen, so the solution proposed here is to maintain a registry of all URLs and manage legacy URLs as redirections to their canonical page. This commit adds a registry of URLs that has three functions: - Check no previous URL is now invalid. - Add aliases for moved pages. - Generate redirection pages for aliases. The redirection works with a simple <meta http-equiv="refresh"> HTML tag. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#http-equiv This commit also initialize the URLs registry with current pages and some redirections needed after recent documentation refactoring. Finally, the CI is updated to catch any change that invalidate previous URLs.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build23
1 files changed, 21 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index b64427d..2cd1ee7 100644
--- a/meson.build
+++ b/meson.build
@@ -819,15 +819,34 @@ You can disable the documentation with -Denable-docs=false.''')
)
# TODO: Meson should provide this.
docdir = get_option('datadir')/'doc'/meson.project_name()
- custom_target(
+ doc_gen = custom_target(
'doc',
input: [doxyfile] + doxygen_input,
output: 'html',
- command: [doxygen_wrapper, doxygen, meson.current_build_dir()/'Doxyfile', meson.current_source_dir()],
+ command: [
+ doxygen_wrapper,
+ doxygen,
+ meson.current_build_dir()/'Doxyfile',
+ meson.current_source_dir(),
+ ],
install: true,
install_dir: docdir,
build_by_default: true,
)
+ ensure_stable_urls = find_program('scripts'/'ensure-stable-doc-urls.py')
+ custom_target(
+ 'doc-cool-uris',
+ input: [doc_gen, 'doc'/'cool-uris.yaml'],
+ output: 'html-xtra',
+ command: [
+ ensure_stable_urls,
+ 'generate-redirections',
+ meson.current_source_dir()/'doc'/'cool-uris.yaml',
+ meson.current_build_dir()/'html'
+ ],
+ install: false,
+ build_by_default: true,
+ )
endif
configure_file(output: 'config.h', configuration: configh_data)