-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add support data-line-numbers from reveal.js #266
Comments
Hi. It would be very useful for programing courses to be able to highlight particular line. |
We support a similar feature in Asciidoctor. See https://asciidoctor.org/docs/user-manual/#highlight-select-lines (so the framework is there). I'm sure it's possible to get it working in this converter. The converter can retrieve this information from the node, massage it, and pass it on to data-line-numbers. (What's funny about this is that highlight.js refuses to support line number itself. If it did, this would be something Asciidoctor would already set up). |
I have been trying with coderay and pygments. As for remarkjs, it uses a simple hack: a '*' put at the beginning of a line inject a specific css class to highlight the whole row. It produces think of highlithed code: https://marcdexet-cnrs.github.io/devworkshop5_tips_for_maintainability/#136 |
The .medium[We now can distinguish the **WHAT**...] ```python *def check_propulsion_energy_against_duration(report, patrol_duration): average_energy_per_day = get_average_propulsion_energy_consumption_per_day() required_energy_level = patrol_duration * average_energy_per_day * SECURITY_COEFF + MINIMAL if required_energy_level > get_actual_stocked_energy() : report.register('propulsion_energy','NotEnoughEnergy', CRITICAL) ``` -- .medium[...from the **HOW**] ```python def check_propulsion_energy_against_duration(report, patrol_duration): * average_energy_per_day = get_average_propulsion_energy_consumption_per_day() * required_energy_level = patrol_duration * average_energy_per_day * SECURITY_COEFF + MINIMAL * if required_energy_level > get_actual_stocked_energy() : * report.register('propulsion_energy','NotEnoughEnergy', CRITICAL) ``` |
Reveal.js uses highlight.js, which Asciidoctor already offers. This is a matter of configuring the integration in this converter. It's possible. The information needs to be passed from the AsciiDoc file to the HTML output. That's all. |
Sorry, guys, I'm completely lost. If I've asked for something which asciidoctor-revealjs already offers — please close this task. |
Not at all. I'm just saying it's within reach to enable it. |
Oh, got it, thanks |
I have produced lately a few courses about software dev good practices and I really missed this feature. It makes examples very clear. |
Support was merged in master minutes ago. Release soon. |
Currently reveal.js supports line highlighting in source code: https://github.com/hakimel/reveal.js/#line-numbers--highlights
Is it possible to support this feature in asciidoctor-revealjs?
The text was updated successfully, but these errors were encountered: