Skip to content

Add "Copy to clipboard" button. #37

Merged
neersighted merged 7 commits intopython-poetry:mainfrom
Secrus:copy-to-clipboard
Jun 2, 2022
Merged

Add "Copy to clipboard" button. #37
neersighted merged 7 commits intopython-poetry:mainfrom
Secrus:copy-to-clipboard

Conversation

@Secrus
Copy link
Copy Markdown
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.

@Secrus Secrus force-pushed the copy-to-clipboard branch from ac3c695 to 635f70a Compare May 29, 2022 11:16
@Secrus Secrus force-pushed the copy-to-clipboard branch from 635f70a to 114f47c Compare May 29, 2022 11:21
@Secrus Secrus force-pushed the copy-to-clipboard branch from 2bac76b to 4e487be Compare May 29, 2022 11:27
@branchv branchv added the safe label May 30, 2022
@Secrus Secrus requested a review from neersighted May 30, 2022 22:06
Copy link
Copy Markdown
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.

@branchv
Copy link
Copy Markdown
Member

branchv 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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