Skip to content

Commit cae87c4

Browse files
dlaxdvarrazzo
authored andcommitted
docs: let the 'pq' role possibly link to "devel" PostgreSQL docs
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.
1 parent 31905a6 commit cae87c4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

docs/lib/libpq_docs.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class LibpqReader:
8989
app = None
9090

9191
_url_pattern = (
92-
"https://raw.githubusercontent.com/postgres/postgres/REL_{ver}_STABLE"
92+
"https://raw.githubusercontent.com/postgres/postgres/{branch}"
9393
"/doc/src/sgml/libpq.sgml"
9494
)
9595

@@ -130,7 +130,13 @@ def local_file(self):
130130

131131
@property
132132
def sgml_url(self):
133-
return self._url_pattern.format(ver=self.version)
133+
return self._url_pattern.format(branch=self.branch)
134+
135+
@property
136+
def branch(self):
137+
if self.version == "devel":
138+
return "master"
139+
return f"REL_{self.version}_STABLE"
134140

135141
@property
136142
def version(self):

0 commit comments

Comments
 (0)