New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: release notes hyperlink for all languages #348
feat: release notes hyperlink for all languages #348
Conversation
22de490
to
9b70eec
Compare
Don't know if it's very useful but it's a good sample for the hyperlink and I had fun doing it :) |
173abec
to
7a3cf32
Compare
9d80197
to
23c1647
Compare
1210a10
to
155f9c3
Compare
src/segment_language.go
Outdated
} | ||
|
||
func (v *version) string() string { | ||
version, err := TruncatingSprintf(v.urlTemplate, v.full, v.major, v.minor, v.patch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The url creation should not be in here, all it should do is return the version, everything else should be handled in language.go
.
src/segment_language.go
Outdated
return l.version | ||
|
||
// if regex found no version | ||
if l.version.full == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an internal property only, removing the hyperlink creation in version.string()
will allow you to not do this check at all. On top of that, it's not even useful as you return the value you validate it contains meaning the last return does exactly the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get those points related to the generation of the hyperlink. In the end, to build the hyperlink all properties from version are needed. If it's not done from a function on version
, then I need to get the data from those properties inside language.string()
?
de2b8ee
to
5379dbf
Compare
If version enabled and hyperlink enabled(global level), an hyperlink to the release notes of the current version is generated. The regex and the url template can be modified in the json template.
5379dbf
to
3e22763
Compare
If version enabled and hyperlink enabled(global level), an hyperlink to the release notes of the current version is generated
The regex and the url template can be modified in the json template.
Prerequisites
CONTRIBUTING
guideDescription
All languages segment will generate an hyperlink pointing to the release notes the current version(if version and hyperlink enabled).