-
Notifications
You must be signed in to change notification settings - Fork 76
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
Provide a 'Create Badge' function for users #670
Merged
adpi2
merged 5 commits into
scalacenter:main
from
rtyley:help-users-create-badge-markdown
Jun 11, 2021
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
be4091f
Fix markdown for Badge links in README
rtyley b325776
Fix broken links to Scala tools in dependency incantations
rtyley 4ae6d0e
Provide a 'Create Badge' function for users
rtyley 3e7498e
Display badge for targetType appropriate to release
rtyley 84e826e
Move badge display to it's own box on RHS bar
rtyley File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
30 changes: 30 additions & 0 deletions
30
template/src/main/twirl/ch.epfl.scala.index.views/project/badges.scala.html
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@import ch.epfl.scala.index.model.Release | ||
@(release: Release) | ||
<div class="box badge-showcase"> | ||
<h4>Markdown Badge</h4> | ||
<div style="overflow: hidden"> | ||
<a href="#badge-markdown"> | ||
<img src="@release.reference.badgeUrl" /> | ||
</a> | ||
</div> | ||
<div id="badge-markdown" class="overlay"> | ||
<div class="popup"> | ||
<h2>Create badge</h2> | ||
<a class="close" href="#">×</a> | ||
|
||
<div class="content"> | ||
<img src="@release.reference.badgeUrl" /> | ||
<div> | ||
<h5>Markdown:</h5> | ||
<pre | ||
aria-label="Badge markdown" | ||
id="copy-badge-markdown" | ||
class="copyable-incantation" | ||
>[![@release.reference.artifact Scala version support](@release.reference.badgeUrl)](@release.reference.artifactFullHttpUrl)</pre> | ||
<button class="btn-copy btn btn-primary pull-right" data-clipboard-target="copy-badge-markdown">Copy Markdown</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 has the nice effect of the user selecting the entire text sample, rather just a word, when they click on it - at that point it's very easy to copy & paste the entire expression, so it's a nice complement (or possibly even replacement) to the Javascript 'Copy' button.
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.
Nice trick!