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

How to add line numbers to default playpen? #1028

Closed
adamchalmers opened this issue Sep 16, 2019 · 3 comments · Fixed by #1035
Closed

How to add line numbers to default playpen? #1028

adamchalmers opened this issue Sep 16, 2019 · 3 comments · Fixed by #1035

Comments

@adamchalmers
Copy link

adamchalmers commented Sep 16, 2019

I notice that the Ace editor can be configured to show/hide line numbers by setting showLineNumbers, but mdbook explicitly sets this to false.

I couldn't see a way to pass configuration from my mdbook project's .toml to override this. IMO it would be a big improvement if book authors could configure their editor to show or hide line numbers.

@andymac-2
Copy link
Contributor

@Michael-F-Bryan I would like to take on this issue. I apologize if you're the wrong person to ping.

@Michael-F-Bryan
Copy link
Contributor

Thanks for volunteering to help, @andymac-2!

At a glance, you would need to add a new show-line-numbers option to the HtmlConfig so it's configurable from book.toml under the output.html table.

From there you'll have to figure out how to tell Ace to show/hide line numbers (probably by playing with from the generated HTML, around here somewhere). The context info passed to each handlebars template is done [in the make_data() function][3].

I didn't have much to do with the frontend and am not actively working on mdbook, but @ehuss or @Dylan-DPC may be able to point you in the right direction.

@andymac-2
Copy link
Contributor

Already done ;) PR #1035 has the required implementation, and updates the docs accordingly. Thanks for your help! You're the first name that pops up on the CONTRIBUTORS file

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

Successfully merging a pull request may close this issue.

3 participants