code-hike / codehike

Marvellous code walkthroughs
https://codehike.org
MIT License
4.39k stars 135 forks source link

Enabling lineNumbers in code block's meta #321

Closed mahdiaslanimk closed 1 year ago

mahdiaslanimk commented 1 year ago

Hi. Thanks for the great job, I really enjoy using code-hike. Sometimes I want to turn on lineNumbers for a specific code block and not for all of them. It would be great to add lineNumbers' state (on or off) to code block's meta instead of plugin options, like this:

'''js App.js focus=5:8 lineNumbers=on
import React from "react";
import { graphql } from "gatsby";

//...
'''
pomber commented 1 year ago

This is how you do it https://codehike.org/docs/ch-code#override-configuration

<CH.Code lineNumbers={true}>

```python one.py
print("Hello, world!")
print("Hello, world!")
print("Hello, world!")

</CH.Code>



I know it's not the same but it's more flexible