[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/dslide 7784e7ad06 183/230: introducing every-child slide a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/dslide 7784e7ad06 183/230: introducing every-child slide action |
Date: |
Sun, 7 Jul 2024 19:00:35 -0400 (EDT) |
branch: elpa/dslide
commit 7784e7ad06cc5b08f2bade0dd615b3ae307fbc68
Author: Psionik K <73710933+psionic-k@users.noreply.github.com>
Commit: Psionik K <73710933+psionic-k@users.noreply.github.com>
introducing every-child slide action
steps all of its children simultaneously. If one of them makes progress,
keeps
going.
Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
---
dslide.el | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
test/demo.org | 19 +++++++++++++++++
2 files changed, 84 insertions(+)
diff --git a/dslide.el b/dslide.el
index 4b5bd3fb47..432b3b13b6 100644
--- a/dslide.el
+++ b/dslide.el
@@ -1727,6 +1727,71 @@ Child headings become independent slides.")
(mapc #'delete-overlay (oref obj overlays))
(mapc #'dslide-final (oref obj children)))
+;; ** Every Child Action
+(defclass dslide-slide-action-every-child (dslide-slide-action)
+ ((overlay
+ :initform nil)
+ (children
+ :initform nil
+ :documentation "Children that have been instantiated."))
+ "Display children inline and step every child at once.")
+
+(cl-defmethod dslide-begin ((obj dslide-slide-action-every-child))
+ (dslide-narrow obj t)
+ (oset obj overlay (dslide-hide-children (dslide-heading obj))))
+
+;; TODO multi-progress, like babel blocks
+(cl-defmethod dslide-forward ((obj dslide-slide-action-every-child))
+ (let ((progress))
+ (while-let ((child-heading (dslide-child-next obj))
+ (child (dslide--make-slide
+ child-heading
+ :slide-action 'dslide-slide-action-every-child
+ :inline t)))
+ (dslide-begin child)
+ ;; TODO inline animate in
+ (setq progress child)
+ (push child (oref obj children)))
+ (when progress
+ (delete-overlay (oref obj overlay))
+ (oset obj overlay nil))
+ (unless progress
+ (let ((progresses (mapcar #'dslide-forward
+ (oref obj children))))
+ (setq progress (seq-first progresses))))
+ progress))
+
+(cl-defmethod dslide-backward ((obj dslide-slide-action-every-child))
+ (let (progress)
+ (let ((progresses (mapcar #'dslide-backward
+ (oref obj children))))
+ (setq progress (seq-first progresses)))
+ (unless progress
+ (oset obj overlay (dslide-hide-children (dslide-heading obj)))
+ (mapc #'dslide-final (oref obj children))
+ (oset obj children nil)
+ ;; TODO just noticed that the marker method could store a marker that is
+ ;; shared, which could result in actions clobbering each other's sense of
+ ;; progress. ☢️
+ (set-marker (oref obj marker) nil)
+ (dslide-marker obj (copy-marker (oref obj begin))))
+ progress))
+
+(cl-defmethod dslide-end ((obj dslide-slide-action-every-child))
+ (dslide-narrow obj t)
+ (while-let ((child-heading (dslide-child-next obj)))
+ (push (dslide--make-slide
+ child-heading
+ :slide-action 'dslide-slide-action-every-child
+ :inline t)
+ (oref obj children)))
+ (mapc #'dslide-end (oref obj children)))
+
+(cl-defmethod dslide-final :after ((obj dslide-slide-action-every-child))
+ (when-let ((overlay (oref obj overlay)))
+ (delete-overlay overlay))
+ (mapc #'dslide-final (oref obj children)))
+
;; * Filters
(defun dslide-built-in-filter (heading)
diff --git a/test/demo.org b/test/demo.org
index c7f590f681..ccb735d3cb 100644
--- a/test/demo.org
+++ b/test/demo.org
@@ -77,6 +77,25 @@ This slide shows its child headings inline.
** Red Team
- Uses some metasploit and calls it a day
- Failure is an option
+* Every Child
+:PROPERTIES:
+:DSLIDE_SLIDE_ACTION: dslide-slide-action-every-child
+:END:
+This is not a test, but a testament to excellence. Note that the item reveal
in the child slides is configured with =:inline t= automatically.
+** Pen-Pineapple 🖊️🍍
+:PROPERTIES:
+:DSLIDE_ACTIONS: dslide-action-item-reveal
+:END:
+- Pen 🖊 is an office utensil used to sign documents
+- Pineapple is an office utensil used to enhance the water cooler
+- Long-pen 🖊🖊 is an office utensil that connects fruit
+** Apple-Pen 🍎🖊️
+:PROPERTIES:
+:DSLIDE_ACTIONS: dslide-action-item-reveal
+:END:
+- Apple is a fruit that grows on a tree
+- Pen 🖊 is a fruit that grows on paper
+- Apple-pineapple is a fruit grows on a tree made out of paper
* Reveal Items
:PROPERTIES:
:DSLIDE_ACTIONS: dslide-action-item-reveal
- [nongnu] elpa/dslide c48dc05cb6 168/230: set up animation before changing buffer restriction, (continued)
- [nongnu] elpa/dslide c48dc05cb6 168/230: set up animation before changing buffer restriction, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 8c57337331 170/230: default to starting at point, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 9687c5e329 171/230: when viewing contents, place cursor at beginning of root heading, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 48bd59bdde 172/230: image action delegates to begin to display images, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 6a8897f592 174/230: version 0.4.0, some breaking changes, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 009d938a11 173/230: default include-linked to nil, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide fa919adc26 180/230: Bumping version to 0.5.0, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 1a8cc52ac6 178/230: ! minor hack to support hacky hidden babel from demo, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 32547dbe24 176/230: Remove child actions (pretty major refactor), ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide f9a1c47bf7 179/230: Get rid of redundant parent slot on slides, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 7784e7ad06 183/230: introducing every-child slide action,
ELPA Syncer <=
- [nongnu] elpa/dslide c9eeb66a9e 187/230: No-header slide action was incorrect in the demo, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 20c4a44f18 184/230: line noise, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 09b750ae6c 189/230: attempted to clean up some misinformation and update recommendations, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide ef1421cb82 190/230: Version 0.5.1, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide f529a1ed6b 193/230: Video url, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide ed197cf5cc 191/230: Finalize the current slide before displaying contents, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide baedd89de4 195/230: macro expansion was creating an unused expression, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 9874ec8263 204/230: Recenter follow buffer on slide change, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 8dd7b6490b 206/230: enable clearing results going backward and after exiting the slide, ELPA Syncer, 2024/07/07
- [nongnu] elpa/dslide 41a5681e00 210/230: compiler warning, ELPA Syncer, 2024/07/07