bitprophet / releases

A powerful Sphinx changelog-generating extension.
http://releases.readthedocs.io/
BSD 2-Clause "Simplified" License
176 stars 41 forks source link

Support for tags with prefix #65

Open tony opened 7 years ago

tony commented 7 years ago

Is it possible you could make have an option to add custom prefixes to the tree such as v?

In https://libtmux.git-pull.com/en/latest/history.html, I want 0.7.0 to point to https://github.com/tony/libtmux/tree/v0.7.0 instead of https://github.com/tony/libtmux/tree/0.7.0

bitprophet commented 7 years ago

You should be able to use a custom release_uri for this :) E.g. in your sphinx conf.py, say releases_release_uri = "https://github.com/tony/libtmux/tree/v". It will then append the numeric version number, resulting in https://github.com/tony/libtmux/tree/v0.7.0 as you need it to.

Let me know if I've missed something or if that functionality doesn't appear to work!

tony commented 7 years ago

@bitprophet what about "Next Release" forwarding to vmaster? https://cihai.git-pull.com/en/latest/history.html

bitprophet commented 7 years ago

Ah yea, that would be a problem, wouldn't it. Let's reopen. There might be an existing setting that helps still, I'd have to dig, but assuming not, I do think it'd be nice to make it easier to do exactly this - a prefix applied to released links but not unreleased ones.

tony commented 7 years ago

Thanks for getting back @bitprophet. For me it's a bug since I'm already using the v convention on releases for my projects, if you do know an existing setting I can use in the meantime it'd be helpful

tony commented 6 years ago

@bitprophet any update on this one?

tony commented 6 years ago

Hm, I can try to introduce a PR during the weekend if it's okay :)

Maybe I can try to make it toggleable via a config variable? Any suggestions for a name of a config variable/condition to use?

bitprophet commented 6 years ago

Offhand, just release_prefix or perhaps release_tag_prefix probably works? if you get a PR together I'll doublecheck names and stuff when I merge. Thanks!

tony commented 6 years ago

@bitprophet This seems to be done: https://github.com/bitprophet/releases/pull/54

eric-wieser commented 4 years ago

Seems both #54 and #76 have become stale.

eric-wieser commented 4 years ago

You can work around this with:

class _releases_release_uri:
    def __mod__(self, release):
        if release.isdigit():
            release = "v" + release
        return 'https://github.com/%s/tree/%s' % (releases_github_path, release)
releases_release_uri = _releases_release_uri()
tony commented 4 years ago

Sorry about this, I don't use this package anymore - if someone is interested in continuing this somehow - they're welcome to rebase. This request is from so long ago I forgot about it