-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the clickable stdlib URLs in the PR descriptions (#70)
- Loading branch information
1 parent
2da0931
commit 97143f0
Showing
2 changed files
with
6 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,17 @@ | ||
function _try_extract_clickable_url_from_git_url(git_url::AbstractString) | ||
git_url_stripped = strip(git_url) | ||
regex_1 = r"^git:\/\/github.com\/([\w\-]*?)\/([\w\-\.]*?).git$" | ||
m_1 = match(regex_1, git_url_stripped) | ||
if m_1 !== nothing | ||
owner = m_1[1] | ||
repo = m_1[2] | ||
return "https://github.com/$(owner)/$(repo)" | ||
git_url_stripped = convert(String, strip(git_url))::String | ||
if startswith(lowercase(git_url_stripped), "https://") | ||
return git_url_stripped | ||
end | ||
return nothing | ||
end | ||
|
||
function _git_url_to_formatted_markdown(git_url::AbstractString) | ||
git_url_stripped = strip(git_url) | ||
git_url_stripped = convert(String, strip(git_url))::String | ||
clickable_url_maybe = _try_extract_clickable_url_from_git_url(git_url_stripped) | ||
if clickable_url_maybe === nothing | ||
@warn "Could not convert Git URL into a clickable link" git_url | ||
return "`$(git_url_stripped)`" | ||
end | ||
clickable_link_markdown = "[$(clickable_url_maybe)]($(clickable_url_maybe))" | ||
return clickable_link_markdown | ||
return clickable_url_maybe | ||
end |
97143f0
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.
@JuliaRegistrator register
97143f0
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.
Registration pull request created: JuliaRegistries/General/48323
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: