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

Add "Copy to clipboard" button. #37

Merged
merged 7 commits into from
Jun 2, 2022

Conversation

Secrus
Copy link
Member

@Secrus Secrus commented May 29, 2022

This code allows for adding the "copy to clipboard" button using Hugo shortcodes. As not every code block needs to be copyable, the button will be added only to parts wrapped in {{% clipboard %}} ... {{% /clipboard %}} tags. After this is accepted and merged, I will prepare separate PR in the main repo, adding required tags to docs.

How to preview

As docs files are not kept with website code, previewing requires some legwork. Checkout this PR, setup the website (as in README) and manually add required tags in downloaded docs files.

Copy link
Member

@neersighted neersighted left a comment

Choose a reason for hiding this comment

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

Code looks good -- let's just add comments to the SVG files with the license.

@branchvincent
Copy link
Member

branchvincent commented May 31, 2022

fyi, main is now using node 16. also, you can try out running locally with just make site

@Secrus
Copy link
Member Author

Secrus commented Jun 1, 2022

@neersighted added licensing comments to SVGs

@Secrus Secrus requested a review from neersighted June 1, 2022 21:30
@neersighted neersighted merged commit b9e3b41 into python-poetry:main Jun 2, 2022
abn added a commit that referenced this pull request Jun 2, 2022
@b-kamphorst
Copy link
Contributor

Hi @abn! I intended to work on #77 using this MR, but I now see that the changes have been reverted. Could you elaborate on the revert? In particular: are there certain changes that need to be made for this MR to be acceptable?

@Secrus Secrus deleted the copy-to-clipboard branch August 17, 2022 10:15
@Secrus
Copy link
Member Author

Secrus commented Aug 17, 2022

Hi @abn! I intended to work on python-poetry/website#77 using this MR, but I now see that the changes have been reverted. Could you elaborate on the revert? In particular: are there certain changes that need to be made for this MR to be acceptable?

Hi! I am not Abn, but I will try to answer. Biggest issue was that with current setup there was no good plugin for rollup to bundle SVG files with icons for the button. It looked ok on previews, but when we deployed it to production, it broke all JS on our website and that caused a lot of issues. Feel free to work on that feature.

@b-kamphorst
Copy link
Contributor

Hi @abn! I intended to work on python-poetry/website#77 using this MR, but I now see that the changes have been reverted. Could you elaborate on the revert? In particular: are there certain changes that need to be made for this MR to be acceptable?

Hi! I am not Abn, but I will try to answer. Biggest issue was that with current setup there was no good plugin for rollup to bundle SVG files with icons for the button. It looked ok on previews, but when we deployed it to production, it broke all JS on our website and that caused a lot of issues. Feel free to work on that feature.

OK. I have to admit that I am completely novel to hugo and JS, but this might be a nice time to get started (low prio though). Do you have any thoughts on (1) how to proceed and, perhaps more importantly, (2) how to test (and actually fail) before production?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants