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

Docs: added copy button to non-inline code snippets #29700

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

snowiewdev
Copy link

Related issue: N/A

Description

  • Added copy button to non-inline code snippets in the Docs pages, so that viewers can copy snippets easier as they go through the documentation
  • This update involved adding 2 svg icons (copy and tick icons) that are from Iconify, in which both are allowed for commercial use and no attribution required, so it should be good to use
  • Used tick icon to alert users on copy successful state so no localization is required

Feature Screenshots

Light Mode:

image

Dark Mode:

image

Video Demo:
https://drive.google.com/file/d/1fMJ6SR6oGHHYmZ0OdtRYgRsNG2M0k9lu/view?usp=sharing

width: 24px;
height: 24px;
background-color: transparent;
background-image: url('/files/ic_copy_grey_24dp.svg');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you write these URLs like so:

background-image: url('../files/ic_copy_grey_24dp.svg');

That makes them more compatible with different hosting setups like githack. Check out the 404 in:

https://rawcdn.githack.com/snowiewdev/three.js/feature/copy-button/docs/index.html#manual/en/introduction/Creating-a-scene

@Mugen87 Mugen87 added this to the r170 milestone Oct 21, 2024
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.

2 participants