Skip to content

Commit

Permalink
Fix broken osgeo hyperlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
maawoo authored Aug 10, 2022
1 parent c4c4277 commit 352ba7c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/_extensions/osgeo_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
Instead of each time placing `gdal.Dataset <https://gdal.org/python/osgeo.gdal.Dataset-class.html>`__ 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.
Expand All @@ -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):
Expand Down

0 comments on commit 352ba7c

Please sign in to comment.