Skip to content

Commit

Permalink
add slide numbering (#1654)
Browse files Browse the repository at this point in the history
* add slide numbering

- fixes #737

* Update slides.py

Co-authored-by: Sylvain Corlay <sylvain.corlay@gmail.com>
  • Loading branch information
casperdcl and SylvainCorlay authored Nov 6, 2021
1 parent 5d2c5e2 commit dd6d9c7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nbconvert/exporters/slides.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ def _reveal_url_prefix_default(self):
"""
).tag(config=True)

reveal_number = Unicode('',
help="""
slide number format (e.g. 'c/t'). Choose from:
'c': current, 't': total, 'h': horizontal, 'v': vertical
"""
).tag(config=True)

font_awesome_url = Unicode(
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css",
help="""
Expand All @@ -172,4 +179,5 @@ def _init_resources(self, resources):
resources['reveal']['theme'] = self.reveal_theme
resources['reveal']['transition'] = self.reveal_transition
resources['reveal']['scroll'] = self.reveal_scroll
resources['reveal']['number'] = self.reveal_number
return resources
2 changes: 2 additions & 0 deletions share/jupyter/nbconvert/templates/reveal/index.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
{% set reveal_url_prefix = resources.reveal.url_prefix | default('https://unpkg.com/reveal.js@4.0.2', true) %}
{% set reveal_theme = resources.reveal.theme | default('white', true) %}
{% set reveal_transition = resources.reveal.transition | default('slide', true) %}
{% set reveal_number = resources.reveal.number | default('', true) %}
{% set reveal_scroll = resources.reveal.scroll | default(false, true) | json_dumps %}

{%- block header -%}
Expand Down Expand Up @@ -144,6 +145,7 @@ require(
progress: true,
history: true,
transition: "{{reveal_transition}}",
slideNumber: "{{reveal_number}}",
plugins: [RevealNotes]
});
Expand Down

0 comments on commit dd6d9c7

Please sign in to comment.