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

Numbering function: not possible with asciidoctor-revealjs? #185

Closed
antoinentl opened this issue Mar 1, 2018 · 12 comments
Closed

Numbering function: not possible with asciidoctor-revealjs? #185

antoinentl opened this issue Mar 1, 2018 · 12 comments

Comments

@antoinentl
Copy link

It seems that asciidoctor-revealjs don't understand or implement the numbering function of Asciidoctor: Asciidoctor offer to activate an automatic numbering of the sections with :sectnums:.

Is there a way to automatically number the sections in asciidoctor-revealjs?

@mojavelinux
Copy link
Member

The converter is currently responsible for honoring the sectnums setting. You can see how this is done in the default HTML converter:

https://github.com/asciidoctor/asciidoctor/blob/1ad875c60f5847a5f70b23726197fc487bf3734b/lib/asciidoctor/converter/html5.rb#L324

The reveal.js converter would need to do something similar.

I am sort of curious what the use case is for numbering titles in slides. I didn't think that really applied in this context.

@antoinentl
Copy link
Author

I use AsciiDoc, Asciidoctor, asciidoctor-pdf and asciidoctor-revealjs for course materials: I generate HTML presentations and PDF (and sometimes ODT with Pandoc) from the same AsciiDoc file. I need to numbering titles in my HTML presentations because my students are sometimes lost... It's useful for them when they take notes, they can refer to the course material (PDF or print) during a presentation. Maybe another way could be use, for example with a fixed element in the HTML presentation.

I will write an article about my use of this workflow in the coming months!

@mojavelinux
Copy link
Member

Thank you for clarifying that use case. That indeed makes sense. I was not considering the case of slides for a training.

It's very feasible to add support for the section number feature to this converter. There may be some edge cases we have to consider, but basic support should be straightforward to add.

@obilodeau
Copy link
Member

Interesting use case @antoinentl. Let us know when your article is published. I'm curious about the multi-backend users. How easy or ugly it is to try to support several different output medias.

@eiswind
Copy link
Contributor

eiswind commented Jan 21, 2020

I see the same issue with my students. Would be great to have sect-nums in revealjs. There is always someone who gets lost...

@obilodeau obilodeau added this to the 3.2.0 milestone Jan 21, 2020
@obilodeau
Copy link
Member

Tagging it to our compliance milestone so I don't forget when I get into compliance improvements.

That said, it shouldn't be too hard to tackle. Template code is in templates/, @mojavelinux gave a pointer to what happens upstream (for inspiration or copy-back into here) and there's development hints in HACKING.adoc.

@eiswind
Copy link
Contributor

eiswind commented Jan 21, 2020

I'll see if I can create a PR. I'm not so much into Ruby at last.... :)

@obilodeau
Copy link
Member

As you can see this is slim templates code with inlined ruby.

I would drop with a debugger here (instructions in HACKING.adoc) and see what is exposed by Asciidoctor's core. Is section.num already provided? If so then it would be little ruby and mostly slim templating.

@eiswind
Copy link
Contributor

eiswind commented Jan 22, 2020

OK. I really had a tough time getting all the ruby stuff working :)

I created #317

obilodeau added a commit that referenced this issue Jan 23, 2020
Issue #158: Use section title (with sectnums)
@obilodeau
Copy link
Member

Fixed in master with the merger of #317. It will be part of our next feature release.

@antoinentl
Copy link
Author

A big thank you to both of you @eiswind and @obilodeau! It's perfect 👍

@eiswind
Copy link
Contributor

eiswind commented Feb 23, 2020

@antoinentl I'll do a first run with my students very soon. Let's hope they appreciate it :)

@ggrossetie ggrossetie modified the milestones: 4.2.0, 4.0.0 Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants