code-hike / codehike

Build rich content websites with Markdown and React
https://codehike.org
MIT License
4.76k stars 148 forks source link

Question: does codehike support line numbers rendering? #95

Closed cibolog closed 2 years ago

cibolog commented 2 years ago

Cannot find it on the website or in the provided resources - does codehike has an option to show line numbers to the left of the code snippet?

pomber commented 2 years ago

Not yet!

pomber commented 2 years ago

Now you can render line numbers passing lineNumbers: true on the plugin options:

const { remarkCodeHike } = require("@code-hike/mdx");
const theme = require("shiki/themes/material-ocean.json");

//...
    remarkPlugins: [[remarkCodeHike, { theme, lineNumbers: true }]],
//...
pomber commented 2 years ago

:rocket: Issue was released in v0.3.0-next.20 :rocket:

(you had one job @githubactionsbot)