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

support line number? #56

Open
JSerZANP opened this issue Jan 10, 2024 · 1 comment
Open

support line number? #56

JSerZANP opened this issue Jan 10, 2024 · 1 comment

Comments

@JSerZANP
Copy link
Owner

No description provided.

@Seven-Y-Q-Guo
Copy link

Seven-Y-Q-Guo commented Feb 16, 2024

It should be part of shiki, but after checking this functionality is not supported natively.
I found one solution related to line number is pretty good:
shikijs/shiki#3 (comment)

code {
  counter-reset: step;
  counter-increment: step 0;
}

code .line::before {
  content: counter(step);
  counter-increment: step;
  width: 1rem;
  margin-right: 1.5rem;
  display: inline-block;
  text-align: right;
  color: rgba(115,138,148,.4)
}

and it's working fine after adding those styles into css files
Screen Shot 2024-02-16 at 1 40 39 PM

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

2 participants