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

CodeViewer/CodeEditor: Add support for highlighting specific lines #139

Open
lottamus opened this issue Dec 17, 2019 · 0 comments
Open

CodeViewer/CodeEditor: Add support for highlighting specific lines #139

lottamus opened this issue Dec 17, 2019 · 0 comments

Comments

@lottamus
Copy link
Contributor

lottamus commented Dec 17, 2019

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:

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]]} />
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

No branches or pull requests

1 participant