design-system icon indicating copy to clipboard operation
design-system copied to clipboard

`CodeBlock` - Expose ability to set custom line number start

Open KristinLBradley opened this issue 1 year ago • 4 comments

:pushpin: Summary

If merged, this PR will add the ability to set a custom line numbering starting number to the CodeBlock component.

  • Showcase preview: https://hds-showcase-git-code-block-add-line-number-st-0fda5f-hashicorp.vercel.app/components/code-block#content
  • API docs preview: https://hds-website-git-code-block-add-line-number-sta-677e12-hashicorp.vercel.app/components/code-block?tab=code#codeblock

:link: External links


👀 Component checklist

  • [x] Percy was checked for any visual regression
  • [x] A changelog entry was added via Changesets if needed (see templates here)

:speech_balloon: Please consider using conventional comments when reviewing this PR.

KristinLBradley avatar Oct 01 '24 18:10 KristinLBradley

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Oct 1, 2024 8:50pm
hds-website ✅ Ready (Inspect) Visit Preview Oct 1, 2024 8:50pm

vercel[bot] avatar Oct 01 '24 18:10 vercel[bot]

I was unable to figure out a way to test the custom line numbers as they are added in CSS and not in the DOM.

KristinLBradley avatar Oct 01 '24 18:10 KristinLBradley

@alex-ju Would it be ok if I go ahead and merge this feature? I think it's a generally useful feature for consumers.

KristinLBradley avatar Oct 02 '24 18:10 KristinLBradley

Nice! Great work on this

zamoore avatar Oct 03 '24 17:10 zamoore

@alex-ju Would it be ok if I go ahead and merge this feature? I think it's a generally useful feature for consumers.

I'm ok with merging it. We can monitor its usage in the long run.

alex-ju avatar Oct 07 '24 14:10 alex-ju