diff --git a/docs/_extensions/osgeo_links.py b/docs/_extensions/osgeo_links.py index c37d32a..9d58b3c 100644 --- a/docs/_extensions/osgeo_links.py +++ b/docs/_extensions/osgeo_links.py @@ -6,10 +6,10 @@ Instead of each time placing `gdal.Dataset `__ into a docstring for linking to the class documentation, one can just type the following: -:osgeo:class:`gdal.Dataset` -> https://gdal.org/python/osgeo.gdal.Dataset-class.html -:osgeo:meth:`gdal.Dataset.ReadAsArray` -> https://gdal.org/python/osgeo.gdal.Dataset-class.html#ReadAsArray -:osgeo:func:`ogr.CreateGeometryFromWkt` -> https://gdal.org/python/osgeo.ogr-module.html#CreateGeometryFromWkt -:osgeo:module:`gdalconst` -> https://gdal.org/python/osgeo.gdalconst-module.html +:osgeo:class:`gdal.Dataset` -> https://gdal.org/api/python/osgeo.gdal.html#osgeo.gdal.Dataset +:osgeo:meth:`gdal.Dataset.ReadAsArray` -> https://gdal.org/api/python/osgeo.gdal.html#osgeo.gdal.Dataset.ReadAsArray +:osgeo:func:`ogr.CreateGeometryFromWkt` -> https://gdal.org/api/python/osgeo.ogr.html#osgeo.ogr.CreateGeometryFromWkt +:osgeo:module:`gdalconst` -> https://gdal.org/api/python/osgeo.gdalconst.html This is only necessary if the documentation is not built by sphinx. In other cases, like e.g. matplotlib, the intersphinx extension is used. @@ -18,10 +18,10 @@ def setup(app): - app.add_role('osgeo:class', autolink('https://gdal.org/python/osgeo.{0}.{1}-class.html')) - app.add_role('osgeo:func', autolink('https://gdal.org/python/osgeo.{0}-module.html#{1}')) - app.add_role('osgeo:meth', autolink('https://gdal.org/python/osgeo.{0}.{1}-class.html#{2}')) - app.add_role('osgeo:module', autolink('https://gdal.org/python/osgeo.{0}-module.html')) + app.add_role('osgeo:class', autolink('https://gdal.org/api/python/osgeo.{0}.html#osgeo.{0}.{1}')) + app.add_role('osgeo:func', autolink('https://gdal.org/api/python/osgeo.{0}.html#osgeo.{0}.{1}')) + app.add_role('osgeo:meth', autolink('https://gdal.org/api/python/osgeo.{0}.html#osgeo.{0}.{1}.{2}')) + app.add_role('osgeo:module', autolink('https://gdal.org/api/python/osgeo.{0}.html')) def autolink(pattern):