Skip to content
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

Merged

Conversation

lnu
Copy link
Contributor

@lnu lnu commented Jan 16, 2021

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

  • I have read and understand the CONTRIBUTING guide
  • The commit message follows the conventional commits guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Description

All languages segment will generate an hyperlink pointing to the release notes the current version(if version and hyperlink enabled).

temp

@lnu lnu force-pushed the feature/languages_releasenotes branch from 22de490 to 9b70eec Compare January 16, 2021 14:08
@lnu
Copy link
Contributor Author

lnu commented Jan 16, 2021

Don't know if it's very useful but it's a good sample for the hyperlink and I had fun doing it :)

@lnu lnu force-pushed the feature/languages_releasenotes branch 2 times, most recently from 173abec to 7a3cf32 Compare January 16, 2021 14:56
src/segment_language.go Outdated Show resolved Hide resolved
src/segment_language.go Outdated Show resolved Hide resolved
@lnu lnu force-pushed the feature/languages_releasenotes branch from 9d80197 to 23c1647 Compare January 17, 2021 12:48
@lnu lnu force-pushed the feature/languages_releasenotes branch 2 times, most recently from 1210a10 to 155f9c3 Compare January 21, 2021 09:21
@lnu lnu marked this pull request as ready for review January 23, 2021 15:02
src/segment_language.go Outdated Show resolved Hide resolved
}

func (v *version) string() string {
version, err := TruncatingSprintf(v.urlTemplate, v.full, v.major, v.minor, v.patch)
Copy link
Owner

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.

return l.version

// if regex found no version
if l.version.full == "" {
Copy link
Owner

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.

Copy link
Contributor Author

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()?

src/segment_language.go Outdated Show resolved Hide resolved
@lnu lnu force-pushed the feature/languages_releasenotes branch 3 times, most recently from de2b8ee to 5379dbf Compare January 25, 2021 05:46
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.
@lnu lnu force-pushed the feature/languages_releasenotes branch from 5379dbf to 3e22763 Compare January 25, 2021 05:47
@lnu lnu changed the title feat: release notes access for all languages feat: release notes hyperlink for all languages Jan 25, 2021
@JanDeDobbeleer JanDeDobbeleer merged commit 59c81f3 into JanDeDobbeleer:main Jan 25, 2021
@lnu lnu deleted the feature/languages_releasenotes branch March 21, 2021 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants