mirror of
https://github.com/vale981/sphinx-multiversion
synced 2025-03-05 09:31:40 -05:00
Add support for listing versions by version number
This commit is contained in:
parent
4849ee449e
commit
f6ecbc761c
2 changed files with 4 additions and 3 deletions
|
@ -91,6 +91,7 @@ def main(argv=None):
|
|||
project = sphinx_project.Project(srcdir, source_suffixes)
|
||||
metadata[versionref.name] = {
|
||||
"name": versionref.name,
|
||||
"version": versionref.version,
|
||||
"source": versionref.source,
|
||||
"sourcedir": srcdir,
|
||||
"outputdir": outputdir,
|
||||
|
|
|
@ -14,7 +14,7 @@ DEFAULT_BRANCH_WHITELIST = r'^.*$'
|
|||
DEFAULT_REMOTE_WHITELIST = None
|
||||
DEFAULT_OUTPUTDIR_FORMAT = r'{version.version}/{language}'
|
||||
|
||||
Version = collections.namedtuple('Version', ['version', 'url'])
|
||||
Version = collections.namedtuple('Version', ['name', 'url', 'version'])
|
||||
|
||||
|
||||
class VersionInfo:
|
||||
|
@ -26,14 +26,14 @@ class VersionInfo:
|
|||
@property
|
||||
def tags(self):
|
||||
return [
|
||||
Version(v["name"], self.vpathto(v["name"]))
|
||||
Version(v["name"], self.vpathto(v["name"]), v["version"])
|
||||
for v in self.metadata.values() if v["source"] == "tags"
|
||||
]
|
||||
|
||||
@property
|
||||
def branches(self):
|
||||
return [
|
||||
Version(v["name"], self.vpathto(v["name"]))
|
||||
Version(v["name"], self.vpathto(v["name"]), v["version"])
|
||||
for v in self.metadata.values() if v["source"] != "tags"
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue