If we now set libpq_docs_version to 'devel', the pq Sphinx role will use
the master branch when looking libpq.sgml and the 'devel' URL component
when linking to libpq online documentation.
app = None
_url_pattern = (
- "https://raw.githubusercontent.com/postgres/postgres/REL_{ver}_STABLE"
+ "https://raw.githubusercontent.com/postgres/postgres/{branch}"
"/doc/src/sgml/libpq.sgml"
)
@property
def sgml_url(self):
- return self._url_pattern.format(ver=self.version)
+ return self._url_pattern.format(branch=self.branch)
+
+ @property
+ def branch(self):
+ if self.version == "devel":
+ return "master"
+ return f"REL_{self.version}_STABLE"
@property
def version(self):