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

feat: highlight code #6794

Merged
merged 7 commits into from
Aug 20, 2023
Merged

feat: highlight code #6794

merged 7 commits into from
Aug 20, 2023

Conversation

floyd-li
Copy link
Member

@floyd-li floyd-li commented Aug 18, 2023

Thank you for your contribution to the KodaDot - One Stop Shop for Polkadot NFTs.

enable code highlight on blog post. support light and dark theme.

code syntax theme based on atom-one theme

👇 __ Let's make a quick check before the contribution.

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Before submitting pull request, please make sure:

  • My contribution builds clean without any errors or warnings
  • I've merged recent default branch -- main and I've no conflicts
  • I've tried to respect high code quality standards
  • I've didn't break any original functionality

Optional

  • I've tested it at </ksm/collection>
  • I've tested PR on mobile
  • I've written unit tests 🧪
  • I've found edge cases

Did your issue had any of the "$" label on it?

  • Fill up your DOT address: Payout

Community participation

Screenshot 📸

  • My fix has changed something on UI; a screenshot is best to understand changes for others.
图片 图片

Copilot Summary

🤖 Generated by Copilot at 60f740a

Added code highlighting feature for blog posts using highlight.js. Adjusted code block style to match page theme.

🤖 Generated by Copilot at 60f740a

In the dark of the night, we write our stories
With the power of code, we shape our glories
We unleash the light, we highlight our code blocks
We adapt to the fight, we change our syntax

@floyd-li floyd-li requested a review from a team as a code owner August 18, 2023 15:05
@floyd-li floyd-li requested review from preschian and roiLeo and removed request for a team August 18, 2023 15:05
@kodabot
Copy link
Collaborator

kodabot commented Aug 18, 2023

SUCCESS @floyd-li PR for issue #6487 which is assigned to you. Please wait for review and don't hesitate to grab another issue in the meantime!

@netlify
Copy link

netlify bot commented Aug 18, 2023

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit c73d732
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/64e01d0f1d58ff00087ea42c
😎 Deploy Preview https://deploy-preview-6794--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@reviewpad
Copy link
Contributor

reviewpad bot commented Aug 18, 2023

AI-Generated Summary: This pull request includes a feature update to the BlogPost.vue component within the blog section. The main feature added is the code highlighting capability, making use of the 'highlight.js' library and appropriate CSS styles. The code updates include the addition of highlighting functions triggered on mounted stage of the component and styling for both light and dark modes for the highlighted syntax. Support for dynamic theme loading based on the page's theme is also added for better UX.

@floyd-li
Copy link
Member Author

@exezbcz pls review this pr

@reviewpad reviewpad bot added small Pull request is small waiting-for-review labels Aug 18, 2023
@exezbcz
Copy link
Member

exezbcz commented Aug 18, 2023

@floyd-li Welcome back sir

image
Is it needed for it to have left-right padding? The block is not then aligned with the start of the content. Not sure if its done like this everywhere

  • could you please make the font size in the code bloc 16px

@floyd-li
Copy link
Member Author

Is it needed for it to have left-right padding?

could you please make the font size in the code bloc 16px

both done @exezbcz

@exezbcz
Copy link
Member

exezbcz commented Aug 18, 2023

image
something weird here
https://deploy-preview-6794--koda-canary.netlify.app/blog/first-time

By the way, is there any way to add copy code to each of them in the follow-up, or would it require more than I think?

works for me

@floyd-li
Copy link
Member Author

image something weird here https://deploy-preview-6794--koda-canary.netlify.app/blog/first-time

图片

manually adjust the color of the inline code-block to match the code syntax theme

By the way, is there any way to add copy code to each of them in the follow-up, or would it require more than I think?

i think this feature need integration of clipboard.js, if you want it i may do it in another pr. wdyt?

cc @vikiival @yangwao

@codeclimate
Copy link

codeclimate bot commented Aug 19, 2023

Code Climate has analyzed commit c73d732 and detected 0 issues on this pull request.

View more on Code Climate.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@exezbcz
Copy link
Member

exezbcz commented Aug 19, 2023

i think this feature need integration of clipboard.js, if you want it i may do it in another pr. wdyt?

I did follow up with p4, let's see if its demanded

nice job!

@vikiival
Copy link
Member

4 mb package 🥲

@exezbcz
Copy link
Member

exezbcz commented Aug 20, 2023

@vikiival then its pass

@yangwao
Copy link
Member

yangwao commented Aug 20, 2023

4 mb package 🥲

@floyd-li isn't there lighter package?

@floyd-li
Copy link
Member Author

4 mb package 🥲

sorry but which package? i did not import any new package this pr 🤔️

@yangwao
Copy link
Member

yangwao commented Aug 20, 2023

sorry but which package? i did not import any new package this pr 🤔️

ah I see we are already using it
https://github.com/kodadot/nft-gallery/blob/main/package.json#L100

@vikiival then whatever merge?

@vikiival
Copy link
Member

Yup, proceed and merge

@yangwao
Copy link
Member

yangwao commented Aug 20, 2023

pay 30 usd

@yangwao yangwao merged commit a91c08f into kodadot:main Aug 20, 2023
@yangwao
Copy link
Member

yangwao commented Aug 20, 2023

😍 Perfect, I’ve sent the payout
💵 $30 @ 4.49 USD/DOT ~ 6.682 $DOT
🧗 13rv1SWoLg9Gb3tmvHPZxb7JbVy51BtMziX7k9WQGSJ7Kp3A
🔗 0xab1358d4fa0efa486149e1811374ea8e3ceb131c6c1da662da2b2654f2594597

🪅 Let’s grab another issue and get rewarded!
🪄 github.com/kodadot/nft-gallery/issues

@yangwao yangwao added the paid pull-request has been paid label Aug 20, 2023
This was referenced Aug 21, 2023
@floyd-li floyd-li deleted the feat/6487 branch October 8, 2023 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
paid pull-request has been paid S-visual-ok-✅ small Pull request is small waiting-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Syntax highlighting and dark mode for code blocks on blog markdown
6 participants