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

Add support for code block line highlighting comments #111

Merged
merged 16 commits into from
Jul 4, 2024

Conversation

meganesu
Copy link
Owner

@meganesu meganesu commented Jun 19, 2024

As a content creator, I want a way to draw the reader's attention to a particular section of a code block.

Related to #62

API

Add the following comments to add line highlighting to your code blocks:

  • highlight-line: highlight the current line
  • highlight-next-line: highlight the following line
  • highlight-start and highlight-end: highlight all the lines between the start and end comments

Example: highlight-line

const greeting = "Howdy" // highlight-line

const name = "Megan" // highlight-line
console.log(greeting, ", my name is ", name) // highlight-line

return true

Screenshot 2024-06-19 at 12 38 17 AM

Example: highlight-next-line

const greeting = "Howdy"

// highlight-next-line
const name = "Megan"
console.log(greeting, ", my name is ", name)

// highlight-next-line
return true

Screenshot 2024-06-19 at 12 38 43 AM

Example: highlight-start and highlight-end

const greeting = "Howdy"

// highlight-start
const name = "Megan"
console.log(greeting, ", my name is ", name)
// highlight-end

return true

Screenshot 2024-06-19 at 12 39 21 AM

Copy link

netlify bot commented Jun 19, 2024

Deploy Preview for meganesulli ready!

Name Link
🔨 Latest commit 60085fc
🔍 Latest deploy log https://app.netlify.com/sites/meganesulli/deploys/66863b8a31debe000880b31a
😎 Deploy Preview https://deploy-preview-111--meganesulli.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.

@meganesu meganesu mentioned this pull request Jun 19, 2024
12 tasks
@meganesu meganesu force-pushed the 62-code-block-line-highlight branch from 47db819 to 17457b3 Compare June 19, 2024 23:06
@meganesu meganesu merged commit ae08bf0 into main Jul 4, 2024
4 checks passed
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.

1 participant