We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
User story.
As a @stoplight/ui-kit user, I can pass a prop to the CodeViewer and CodeEditor components, so that I can highlight specific code lines.
Describe the solution you'd like
Update the following to take an optional "highlightLines" prop:
CodeEditor
CodeViewer
highlightCode
Additional context
The highlightLines prop should have the following typing:
type highlightLines = [number, number?] | Array<[number, number?]>;
Examples:
// The following will highlight lines 1, 2, and 3 <CodeViewer language={language} value={code} highlightLines={[1, 3]} />
// The following will highlight lines 1, 3, 4, and 5 <CodeViewer language={language} value={code} highlightLines={[[1], [3, 5]]} />
The text was updated successfully, but these errors were encountered:
No branches or pull requests
User story.
As a @stoplight/ui-kit user, I can pass a prop to the CodeViewer and CodeEditor components, so that I can highlight specific code lines.
Describe the solution you'd like
Update the following to take an optional "highlightLines" prop:
CodeEditor
component: https://github.com/stoplightio/ui-kit/blob/master/src/CodeEditor/index.tsx#L10CodeViewer
component: https://github.com/stoplightio/ui-kit/blob/master/src/CodeViewer/index.tsx#L15highlightCode
util function: https://github.com/stoplightio/ui-kit/blob/master/src/CodeEditor/utils/highlightCode.ts#L30Additional context
The highlightLines prop should have the following typing:
Examples:
The text was updated successfully, but these errors were encountered: