Skip to content

Refactor SCSS and HTML templates for improved code snippet presentation #1929

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

payaljhamta
Copy link

@payaljhamta payaljhamta commented Feb 4, 2025

Added 'Click to Copy' functionality for command-line code blocks using existing clippify integration

Closes: #1276

Refer :
Screenshot from 2025-02-04 15-23-34

@MHLut
Copy link

MHLut commented Feb 13, 2025

@payaljhamta Pleaso do not randomly tag people into issues. It is incredibly rude.

I appeciate you want to draw attention to your ticket, but there are hundreds of people who want the same thing for their tickets. Patience is a virtue.

With all due respect, random tags make people less inclined to help, which is the opposite of what you are trying to achieve here.

Copy link
Member

@bmispelon bmispelon left a comment

Choose a reason for hiding this comment

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

Hi and thanks for giving a go at this issue.

I've left a comment on the changes in the SCSS file, I think a different approach is needed.
Overall I'm also not super convinced about this approach in general: I don't like that we need to add an extra <div> to support this, and that we're using the old snippet-filename class which was made for really old versions of the Django documentation.

It might be worth waiting until #1968 is finished too, since that's likely to interfere with the changes in this PR.

Comment on lines +45 to +46
// background: var(--secondary-accent);
// color: var(--code-fg);
Copy link
Member

Choose a reason for hiding this comment

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

As mentioned in the comment above, these styles are used for old versions of the documentation, see for example https://docs.djangoproject.com/en/1.11/intro/tutorial01/#write-your-first-view

Commenting this out will break the styling of those older documents, so this approach doesn't work.

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.

Add Click to copy text for commands present in the official Django website.
3 participants