nir_lower_io: Add addr_format_is_offset helper
[mesa.git] / docs / _exts / redirects.py
1 import os
2
3 redirects = [
4 ('llvmpipe', 'gallium/drivers/llvmpipe'),
5 ('postprocess', 'gallium/postprocess')
6 ]
7
8 def create_redirect(dst):
9 tpl = '<html><head><meta http-equiv="refresh" content="0; url={0}"><script>window.location.replace("{0}")</script></head></html>'
10 return tpl.format(dst)
11
12 def create_redirects(app, docname):
13 if not app.builder.name == 'html':
14 return
15 for src, dst in redirects:
16 path = os.path.join(app.outdir, '{0}.html'.format(src))
17 url = '{0}.html'.format(dst)
18 with open(path, 'w') as f:
19 f.write(create_redirect(url))
20
21 def setup(app):
22 app.connect('build-finished', create_redirects)