Skip to content

Commit 685113e

Browse files
Trying overlays
1 parent d72622f commit 685113e

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

courses/fundamentals_of_ada/273_subprogram_contracts.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,12 @@ Quiz
539539
Given the following expressions, what is their value if they are evaluated in the postcondition
540540
of the call :ada:`Set_And_Move ('X', 4)`
541541

542-
.. container:: animate 1
542+
.. container:: overlay 1
543543

544544
.. image:: subprogram_contracts_special_attributes-quiz.svg
545545
:width: 50%
546546

547-
.. container:: animate 2
547+
.. container:: overlay 2
548548

549549
.. image:: subprogram_contracts_special_attributes-answer.svg
550550
:width: 50%

pandoc/beamer_filter.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,10 @@ def is_animate(classes):
440440
return ("container" in classes) and ("animate" in classes)
441441

442442

443+
def is_overlay(classes):
444+
return ("container" in classes) and ("overlay" in classes)
445+
446+
443447
def animate(classes, contents):
444448
slide_number = 2
445449
dash = "-"
@@ -468,6 +472,29 @@ def animate(classes, contents):
468472
return value
469473

470474

475+
def overlay(classes, contents):
476+
slide_number = 2
477+
if len(classes) > 2:
478+
requested = classes[2]
479+
if len(requested) > 0:
480+
slide_number = int(requested)
481+
slide_number = str(slide_number)
482+
483+
first = {
484+
"t": "RawBlock",
485+
"c": ["latex", "\\begin{onlyenv}<" + slide_number + ">"],
486+
}
487+
last = {"t": "RawBlock", "c": ["latex", "\\end{onlyenv}"]}
488+
489+
value = []
490+
value.append(first)
491+
for c in contents:
492+
value.append(c)
493+
value.append(last)
494+
495+
return value
496+
497+
471498
########################
472499
## LATEX ENVIRONMENTS ##
473500
########################
@@ -836,6 +863,9 @@ def perform_filter(key, value, format, meta):
836863
if is_animate(classes):
837864
return animate(classes, contents)
838865

866+
if is_overlay(classes):
867+
return overlay(classes, contents)
868+
839869
if is_latex_environment(classes):
840870
return latex_environment(classes, contents)
841871

0 commit comments

Comments
 (0)