Skip to content

Commit

Permalink
Rename DSLIDE_SECTION_ACTIONS -> DSLIDE_ACTIONS
Browse files Browse the repository at this point in the history
A followup to the removal of the child action.  There is less need to be
distinct, and this simplifies the configuration API just a bit more.

While `section-actions' is still used internally in some places, and its meaning
should be well understood by org hackers.

Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com>
  • Loading branch information
psionic-k committed May 26, 2024
1 parent 32547db commit 0f123e3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
16 changes: 9 additions & 7 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ If you display the slideshow in one window or frame, you can configure the point
- *Deck*: an object that is used to relate the display and base buffer and is the root of all sequences. It's another word for "presentation" or PT.
- *Slide*: an object that interprets an org heading to hydrate its actions
- *Action*: an object that responds to ~dslide-deck-forward~ and ~dslide-deck-backward~ calls and implements lifecycle methods to initialize and clean up state
+ *Slide Action*: an action subclass that handles initial display of the slide and creation of child slides from sub-headings.
+ *Section Actions*: actions that typically control the display and behavior of a heading's section, the region between the headline and child headings.
- *Step*: a single call to ~dslide-deck-foward~ or ~dslide-deck-backward~, usually delegated down to ~dslide-forward~ and ~dslide-backward~ methods
- *Contents*: use org folding to create a view of folded headings to quickly navigate slides
- *Contents*: A view of the folded root headings that is used for quickly navigating between headings during a presentation.
- *Slide Buffer*: the slides are shown in an indirect buffer that is cloned from your org document buffer. The source is called the *base buffer*. Check for the =deck: my-presentation.org= buffer name.
+ Inderect buffer and =slide-buffer= are used interchangeably
+ Indirect buffer and =slide-buffer= are used interchangeably
+ Base buffer or =base-buffer= is used pretty exclusively
* Configuring
Be sure to check =M-x= ~customize-group~ =dslide= to see all declared custom variables. All of the variables are configured to recommended defaults except hooks, which would depend on other packages usually.
Expand Down Expand Up @@ -120,7 +122,7 @@ The out-of-the-box experience can be a bit messy due to property drawers, keywor
Headings are treated as slides. Slides have actions. Actions are configured in the property drawer.

- =DSLIDE_SLIDE_ACTION=: Usually narrows to the slide and creates children from child headings. Lifecycle encloses the section.
- =DSLIDE_SECTION_ACTIONS:= Most commonly customized. You can list multiple actions. Each one will step through its forward and backward steps.
- =DSLIDE_ACTIONS:= Most commonly customized. You can list multiple actions. Each one will step through its forward and backward steps.

Some actions must be fully enclosed by the lifecycle of a surrounding action, such as narrowing to the headline and section before displaying a contained list item-by-item.

Expand All @@ -141,14 +143,14 @@ Many actions understand arguments, allowing tuning of similar behaviors from the
Configuring the slot is done by adding plist-style properties after the class name:
#+begin_src org
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-item-reveal :inline t
:DSLIDE_ACTIONS: dslide-action-item-reveal :inline t
:END:
#+end_src
You can also use "property+" syntax to add to a property, and these accept plist arguments too:
#+begin_src org
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-babel
:DSLIDE_SECTION_ACTIONS+: dslide-action-images :fullscreen t
:DSLIDE_ACTIONS: dslide-action-babel
:DSLIDE_ACTIONS+: dslide-action-images :fullscreen t
:END:
#+end_src
* Customizing
Expand Down Expand Up @@ -310,7 +312,7 @@ A consequence of this is that there are usually multiple actions alive at once.
** Work In Progress 🚧
Open issues and give feedback on feature requests. Contributions welcome.
*** Secondary Commands
See the section about bindings for context. Video play or other situations where the presentation might branch should be supported by overloading the behavior of ~dslide-deck-start~
See the section about bindings for context. Video play or other situations where the presentation might branch should be supported by overloading the behavior of ~dslide-deck-start~. I think this command will turn into ~dslide-deck-secondary~ in the ~dslide-mode-map~.
*** ~dslide-goto~, starting from point
Since not many actions currently have implemented this very accurately, playing from point is likely not that accurate. Progress updating in the base buffer is also currently only at the slide level of granularity.
*** Affiliated Buffers
Expand Down
20 changes: 10 additions & 10 deletions dslide.el
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ again. `dslide-deck-stop' is another good choice."
"Action class with lifecycle around the section actions.
When stepping forward or backward, it is called before any
section action. It's normal purpose is to update the buffer
restriction before section-actions are run.
restriction before section actions are run.
You can configure this per-heading by setting the
SLIDE_ACTION keyword. You can configure it for
Expand All @@ -305,7 +305,7 @@ keyword."
:group 'dslide)

;; TODO test the use of plist args
(defcustom dslide-default-section-actions '()
(defcustom dslide-default-actions '()
"Actions that run within the section display action lifecycle.
It's value is a list of symbol `dslide-action' sub-classes or (CLASS . ARGS)
forms where ARGS is a plist. Each subclass will be instantiated
Expand All @@ -316,9 +316,9 @@ Many section actions are no-op whenever the content doesn't
contain any elements they act on. You can add classes to this
list in order to have default behaviors for some org elements.
You can configure this per-heading by setting the
DSLIDE_SECTION_ACTIONS keyword. You can configure it for the
document default by adding an DSLIDE_SECTION_ACTIONS keyword."
You can configure this per-heading by setting the DSLIDE_ACTIONS
keyword. You can configure it for the document default by adding
an DSLIDE_ACTIONS keyword."
:type '(list function)
:group 'dslide)

Expand Down Expand Up @@ -883,7 +883,7 @@ created. See `dslide-default-slide-action'.")
:initform nil :initarg :section-actions
:documentation "Typical actions that work on the section.
Live within slide action lifecycle. See
`dslide-default-section-actions'.")
`dslide-default-actions'.")
(begin
:initform nil :initarg :begin
:documentation "Marker for retrieving this heading's org element."))
Expand Down Expand Up @@ -971,7 +971,7 @@ may be refactored out."
;; instantiate them all.
(let* ((keywords (org-collect-keywords
'("DSLIDE_SLIDE_ACTION"
"DSLIDE_SECTION_ACTIONS"
"DSLIDE_ACTIONS"
"DSLIDE_FILTER"
"DSLIDE_CLASS")))

Expand Down Expand Up @@ -1012,9 +1012,9 @@ may be refactored out."
;; the restriction.
(section-action-classes
(or (dslide--parse-classes-with-args
(or (org-element-property :DSLIDE_SECTION_ACTIONS heading)
(cdr (assoc-string "DSLIDE_SECTION_ACTIONS" keywords))))
dslide-default-section-actions))
(or (org-element-property :DSLIDE_ACTIONS heading)
(cdr (assoc-string "DSLIDE_ACTIONS" keywords))))
dslide-default-actions))
(section-actions
(mapcar
(lambda (c) (when c
Expand Down
22 changes: 11 additions & 11 deletions test/demo.org
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
2. Press the right arrow key ➡️
** Controls
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-item-reveal
:DSLIDE_ACTIONS: dslide-action-item-reveal
:END:
See the ~dslide-mode-map~ but basically, arrow keys.
- right arrow ➡️ ~dslide-deck-forward~
Expand All @@ -16,7 +16,7 @@ See the ~dslide-mode-map~ but basically, arrow keys.
- down arrow ⬇️ ~dslide-deck-stop~
*** Contents View
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-item-reveal
:DSLIDE_ACTIONS: dslide-action-item-reveal
:END:
After a presentation is started, up arrow ⬆️ goes to the contents view.

Expand Down Expand Up @@ -79,7 +79,7 @@ This slide shows its child headings inline.
- Failure is an option
* Reveal Items
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-item-reveal
:DSLIDE_ACTIONS: dslide-action-item-reveal
:END:
Positron is deeply committed to bringing you the finest in:
- Pen 🖊️
Expand All @@ -88,7 +88,7 @@ Positron is deeply committed to bringing you the finest in:
- Pen 🖊️
* Image Slides
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-image
:DSLIDE_ACTIONS: dslide-action-image
:END:
- The action will automatically turn on inline images so you don't have to remember to run ~org-toggle-inline-images~.
- The image buffer is configured to act as a slide, so it still responds to the keybindings.
Expand All @@ -99,7 +99,7 @@ Positron is deeply committed to bringing you the finest in:
[[./images/before-google3.jpeg]] [[./images/all-software-is-the-same-with-tang.jpeg]]
* No Header Slide
:PROPERTIES:
:DSLIDE_SLIDE_ACTION: dslide-action-narrow :header nil
:DSLIDE_ACTION: dslide-action-narrow :header nil
:END:
- The content and heading are still displayed
- The slide-in effect still works
Expand All @@ -108,7 +108,7 @@ Positron is deeply committed to bringing you the finest in:
=M-x describe-symbol dslide-action-narrow=
* Babel Slide Integration
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-babel
:DSLIDE_ACTIONS: dslide-action-babel
:END:
Go 2-3 steps forwards and then backwards. This slide also supports starting at the end. Just go to the next slide and back up.
#+attr_dslide: begin end
Expand Down Expand Up @@ -153,7 +153,7 @@ Can has display?
** No Display! Only Execute!
:PROPERTIES:
:DSLIDE_SLIDE_ACTION: nil
:DSLIDE_SECTION_ACTIONS: dslide-action-babel
:DSLIDE_ACTIONS: dslide-action-babel
:END:
These four org blocks will not be displayed since this slide has no slide action. They will however execute when navigating forward and backward. Note these features:

Expand Down Expand Up @@ -195,7 +195,7 @@ Our cleanup is always run, after everything
#+end_src
* Package Integration
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-babel
:DSLIDE_ACTIONS: dslide-action-babel
:END:
- You need the ~master-of-ceremonies~ package installed to complete this slide.
- Let arbitrary buffers be shown while still completing steps within the slide-show.
Expand Down Expand Up @@ -229,7 +229,7 @@ Our cleanup is always run, after everything
#+end_src
* Babel is every Feature
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-babel
:DSLIDE_ACTIONS: dslide-action-babel
:END:
If a feature seems like it's missing, it can probably be added. There is a babel block below this paragraph, but if you are viewing this presentation, you won't see it because it has hidden itself with an overlay. File an issue, but don't be held back. A quick hunk of [[info:elisp#Top][elisp]] can solve every problem.
#+attr_dslide: begin end
Expand Down Expand Up @@ -262,7 +262,7 @@ Positron is cheating and also apply custom line-spacing and line-height. While
Bind the command ~dslide-deck-start~ in the ~org-mode-map~. Any key will do.
** Custom Actions
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-babel
:DSLIDE_ACTIONS: dslide-action-babel
:END:
The babel block below is a custom action supporting both forward, each step making a paragraph red when going forward or removing the red when going backward. Key methods you want to use in your custom actions:
- ~dslide-section-next~
Expand Down Expand Up @@ -306,7 +306,7 @@ The babel block below is a custom action supporting both forward, each step maki
#+end_src
*** Custom Action Demo
:PROPERTIES:
:DSLIDE_SECTION_ACTIONS: dslide-action-red-paragraphs
:DSLIDE_ACTIONS: dslide-action-red-paragraphs
:END:
Massachusetts, in particular, has always been one of the laboratories of democracy. It's where people try things before they're popular. It's where we experiment.

Expand Down

0 comments on commit 0f123e3

Please sign in to comment.