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

"Edit" button on code examples #35638

Closed
wants to merge 8 commits into from
Closed

"Edit" button on code examples #35638

wants to merge 8 commits into from

Conversation

PuruVJ
Copy link
Contributor

@PuruVJ PuruVJ commented Jan 2, 2022

Based on #35188, this PR adds the "Edit" button on code examples, clicking which will open up stackblitz editor in new tab with the code example in mind.

Here's a video:

CleanShot.2022-01-03.at.00.29.35.mp4

@PuruVJ PuruVJ requested review from a team as code owners January 2, 2022 19:02
@XhmikosR
Copy link
Member

XhmikosR commented Jan 3, 2022

Hey, thanks for the PR, but this has many unrelated changes.

@XhmikosR XhmikosR marked this pull request as draft January 3, 2022 08:08
@PuruVJ
Copy link
Contributor Author

PuruVJ commented Jan 3, 2022

Can you specify the unrelated changes? So I can rectify them

@XhmikosR

@XhmikosR
Copy link
Member

XhmikosR commented Jan 3, 2022

Sorry, I don't have the time to clarify everything. For starters you are not running the lint scripts locally.

Secondly, you are loading the SDK from unpkg. You should use a real CDN and pin the version. And finally, you have hardcoded stuff.

@PuruVJ
Copy link
Contributor Author

PuruVJ commented Jan 3, 2022

Changed it from unkpg to jsdelivr

I ran the lint scripts and fixed the issue with EOF on _clipboard-js.scss

If you have time, can you specify what you mean by "hard-coded"?


{{ printf .Site.Params.cdn.css | safeHTMLAttr }}

<script src="https://cdn.jsdelivr.net/npm/@stackblitz/sdk@1.5.3/bundles/sdk.umd.min.js"></script>
Copy link
Member

Choose a reason for hiding this comment

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

We don't need to load this in every page. Which probably means, you shouldn't add the logic in application.js.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Which file do you suggest I add this logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would adding a script tag to the example.html partial and putting "open in stackblitz" logic there be fine?

@PuruVJ
Copy link
Contributor Author

PuruVJ commented Jan 3, 2022

Hi, I will close this PR and make a new one with new changes. I am having some issues in git locally

@PuruVJ PuruVJ closed this Jan 3, 2022
@PuruVJ
Copy link
Contributor Author

PuruVJ commented Jan 3, 2022

New PR here #35644

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