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

Conversation

Andy-Grigg
Copy link
Contributor

This is a relatively minor PR to improve how links generated with the ReST :download: directive work:

  • CSS to theme them as hyperlinks instead of code blocks.
  • JS to set them to open in a new tab by default. In my use case, this means download .py / .ipynb files instead of opening them in the current tab

Before / after screenshots:

image

image

Copy link
Contributor

@germa89 germa89 left a comment

Choose a reason for hiding this comment

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

I think it is good. This is a very good idea and the result looks super nice. Honestly I'm not the most appropriate to judge your work, but I like it!

/* 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!

@Andy-Grigg
Copy link
Contributor Author

I think it is good. This is a very good idea and the result looks super nice. Honestly I'm not the most appropriate to judge your work, but I like it!

Thanks! Do you want me to hold off until @akaszynski has a chance to review, or shall I merge?

@germa89
Copy link
Contributor

germa89 commented Feb 7, 2022

Up to you really, if you are in rush, just merge it. If not, surely @akaszynski might have some useful contributions.

@akaszynski
Copy link
Contributor

Nothing to add. Thanks!

@akaszynski akaszynski merged commit 9d131bf into main Feb 8, 2022
@akaszynski akaszynski deleted the feat/download-links branch February 8, 2022 15:22
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.

3 participants