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

Website: Introduce Snippets for FE Package Managers #233

Merged
merged 12 commits into from
May 3, 2023

Conversation

jackw
Copy link
Collaborator

@jackw jackw commented Apr 27, 2023

What this PR does / why we need it:
This PR adds the ability to load markdown snippets inside syntax highlighted code blocks. Right now it can be used to tab between different package managers.

image

It can also be used in combination with the SyncCommand component to update inline code blocks:

Kapture.2023-05-02.at.17.53.05.mp4

Which issue(s) this PR fixes:

Related issue: #156

Special notes for your reviewer:

@jackw jackw added the type/docs Changes only affect the documentation label Apr 27, 2023
@jackw jackw self-assigned this Apr 27, 2023
leventebalogh
leventebalogh previously approved these changes Apr 27, 2023
Copy link
Collaborator

@leventebalogh leventebalogh left a comment

Choose a reason for hiding this comment

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

Magic! 🪄🎩
Nice one, LGTM 👍

async function fetchSnippets() {
const fetchedSnippets = await Promise.all(
snippetPaths.map(async (path) => {
const [_, value, language] = path.split('.');
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would probably add a block of comments above the component definition that explains how to use this component on the call-site, especially how the name of the file relates to the names of the tabs.

@jackw jackw requested a review from leventebalogh May 3, 2023 09:03
@jackw jackw changed the title Website: Introduce CodeSnippets component Website: Introduce Snippets for FE Package Managers May 3, 2023
@mckn mckn self-requested a review May 3, 2023 12:30
Copy link
Collaborator

@mckn mckn left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@leventebalogh leventebalogh left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jackw jackw merged commit c44aa7a into main May 3, 2023
@jackw jackw deleted the jackw/package-manager-docs branch May 3, 2023 12:36
@grafanabot
Copy link
Contributor

🚀 PR was released in @grafana/create-plugin@1.3.1 🚀

@grafanabot grafanabot added the released This issue/pull request has been released. label May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released. type/docs Changes only affect the documentation
Projects
Development

Successfully merging this pull request may close these issues.

4 participants