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

Improve appearance and behavior of ReST :download: links #22

Merged
merged 1 commit into from
Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions pyansys_sphinx_theme/static/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -413,5 +413,15 @@ I do not think we will be able to call this class.
}




/*
########################
ReST :download: links
########################
*/
a > code.download
{
font-family: var(--pst-font-family-base);
color: var(--pst-color-link);
text-decoration: none;
font-weight: normal;
}
6 changes: 6 additions & 0 deletions pyansys_sphinx_theme/static/js/download_target_blank.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Add target="_blank" attribute to all hyperlinks generated by the ReST :download: directive.
* This will ensure the links open in a new tab. */

$(document).ready(function () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever!

$('a.download').attr('target', '_blank');
});