From 199bb5b68b0ddce9ee9ee23e95e37cc2570a17b2 Mon Sep 17 00:00:00 2001 From: Psionik K <73710933+psionic-k@users.noreply.github.com> Date: Wed, 8 May 2024 19:26:39 +0900 Subject: [PATCH] Properties standardized to MS_ prefix According to Yantar / Ihor, this is the way. It looks consistent to the user, so I concur. In a crazily complex presentation, the MS_ propertiess should cluster together. Signed-off-by: Psionik K <73710933+psionic-k@users.noreply.github.com> --- README.org | 6 +++--- macro-slides.el | 48 ++++++++++++++++++++++++------------------------ test/demo.org | 18 +++++++++--------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.org b/README.org index a97eb39..b0870ac 100644 --- a/README.org +++ b/README.org @@ -91,9 +91,9 @@ The out-of-the-box experience can be a bit messy due to property drawers, keywor ** Heading Properties Headings are treated as slides. Slides have actions. Actions are configured in the property drawer. -- =SLIDE_ACTION=: Usually narrows to the slide. Lifecycle encloses the section. -- =SLIDE_SECTION_ACTIONS:= Most commonly customized. You can list multiple actions. Each one will step through its forward and backward steps. -- =SLIDE_CHILD_ACTION=: Used to customize if and how child headings become slides +- =MS_SLIDE_ACTION=: Usually narrows to the slide. Lifecycle encloses the section. +- =MS_SECTION_ACTIONS:= Most commonly customized. You can list multiple actions. Each one will step through its forward and backward steps. +- =MS_CHILD_ACTION=: Used to customize if and how child headings become slides 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. diff --git a/macro-slides.el b/macro-slides.el index 6bf7a8a..3795fe3 100644 --- a/macro-slides.el +++ b/macro-slides.el @@ -302,8 +302,8 @@ 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 -SLIDE_SECTION_ACTIONS keyword. You can configure it for the -document default by adding an SLIDE_SECTION_ACTIONS keyword." +MS_SECTION_ACTIONS keyword. You can configure it for the +document default by adding an MS_SECTION_ACTIONS keyword." :type '(list function) :group 'macro-slides) @@ -315,8 +315,8 @@ Value is an action class, usually extending the child headings, which come after the section element. You can configure this per-heading by setting the -SLIDE_CHILD_ACTION keyword. You can configure it for the -document default by adding an SLIDE_CHILD_ACTION keyword." +MS_CHILD_ACTION keyword. You can configure it for the +document default by adding an MS_CHILD_ACTION keyword." :type 'function :group 'macro-slides) @@ -326,9 +326,9 @@ Value should be a custom class extending `ms'. You can override methods if the built-in implementation is insufficient. Consider upstreaming changes. -You can configure this per heading by setting the SLIDE_CLASS +You can configure this per heading by setting the MS_CLASS property. You can configure it for the document default by -adding an SLIDE_CLASS keyword." +adding an MS_CLASS keyword." :type 'symbol :group 'macro-slides) @@ -337,7 +337,7 @@ adding an SLIDE_CLASS keyword." Value should be a custom class extending `ms-deck'. Use this to modify the root-level behaviors, including switching to children and finding siblings. You can configure this for the -document by adding the SLIDE_ROOT_CLASS keyword." +document by adding the MS_ROOT_CLASS keyword." :type 'symbol :group 'macro-slides) @@ -348,9 +348,9 @@ The function used as actions should accept an org element, a `headline' type element and return it if it is a valid heading or return nil if it should be skipped. -You can configure this per heading by setting the SLIDE_FILTER +You can configure this per heading by setting the MS_FILTER keyword. You can configure it for the document default by adding -an SLIDE_FILTER keyword." +an MS_FILTER keyword." :type 'function :group 'macro-slides) @@ -1085,11 +1085,11 @@ Many optional ARGS. See code." ;; Hydrate the slide's configuration as classes and arguments and then ;; instantiate them all. (let* ((keywords (org-collect-keywords - '("SLIDE_ACTION" - "SLIDE_SECTION_ACTIONS" - "SLIDE_CHILD_ACTION" - "SLIDE_FILTER" - "SLIDE_CLASS"))) + '("MS_SLIDE_ACTION" + "MS_SECTION_ACTIONS" + "MS_CHILD_ACTION" + "MS_FILTER" + "MS_CLASS"))) (args `(:inline ,inline)) @@ -1099,8 +1099,8 @@ Many optional ARGS. See code." (slide-action-class (or slide-action-class (if-let ((declared - (or (org-element-property :SLIDE_ACTION heading) - (cdr (assoc-string "SLIDE_ACTION" + (or (org-element-property :MS_SLIDE_ACTION heading) + (cdr (assoc-string "MS_SLIDE_ACTION" keywords))))) (ms--parse-class-with-args declared) ms-default-slide-action))) @@ -1125,8 +1125,8 @@ Many optional ARGS. See code." ;; the restriction. (section-action-classes (or (ms--parse-classes-with-args - (or (org-element-property :SLIDE_SECTION_ACTIONS heading) - (cdr (assoc-string "SLIDE_SECTION_ACTIONS" keywords)))) + (or (org-element-property :MS_SECTION_ACTIONS heading) + (cdr (assoc-string "MS_SECTION_ACTIONS" keywords)))) ms-default-section-actions)) (section-actions (mapcar @@ -1141,8 +1141,8 @@ Many optional ARGS. See code." (child-action-class (or child-action-class (if-let ((declared - (or (org-element-property :SLIDE_CHILD_ACTION heading) - (cdr (assoc-string "SLIDE_CHILD_ACTION" + (or (org-element-property :MS_CHILD_ACTION heading) + (cdr (assoc-string "MS_CHILD_ACTION" keywords))))) (ms--parse-class-with-args declared) ms-default-child-action))) @@ -1163,13 +1163,13 @@ Many optional ARGS. See code." (filter (or (ms--filter - (or (org-element-property :SLIDE_FILTER heading) - (cdr (assoc-string "SLIDE_FILTER" keywords)))) + (or (org-element-property :MS_FILTER heading) + (cdr (assoc-string "MS_FILTER" keywords)))) ms-default-filter)) (class (or (ms--parse-class-with-args - (or (org-element-property :SLIDE_CLASS heading) - (cdr (assoc-string "SLIDE_CLASS" + (or (org-element-property :MS_CLASS heading) + (cdr (assoc-string "MS_CLASS" keywords)))) ms-default-class))) diff --git a/test/demo.org b/test/demo.org index cbba97a..04bc8d9 100644 --- a/test/demo.org +++ b/test/demo.org @@ -14,7 +14,7 @@ Wow, these breadcrumbs are very high-carb How many levels of headings could there be? * Inline Children :PROPERTIES: -:SLIDE_CHILD_ACTION: ms-child-action-inline +:MS_CHILD_ACTION: ms-child-action-inline :END: - You won't believe these animations - This is the world's greatest presentation software @@ -29,7 +29,7 @@ This is a reason to be alive [[https://www.youtube.com/watch?v=Ct6BUPvE2sM][In case you live under a rock]] * Reveal Items :PROPERTIES: -:SLIDE_SECTION_ACTIONS: ms-action-item-reveal +:MS_SECTION_ACTIONS: ms-action-item-reveal :END: Positron is deeply committed to bringing you the finest in: - Pen 🖊️ @@ -38,8 +38,8 @@ Positron is deeply committed to bringing you the finest in: - Pen 🖊️ * Flat Slide :PROPERTIES: -:SLIDE_ACTION: ms-action-narrow :with-children t -:SLIDE_CHILD_ACTION: nil +:MS_SLIDE_ACTION: ms-action-narrow :with-children t +:MS_CHILD_ACTION: nil :END: This slide shows its child headings inline. - The slide action shows the entire contents, not just the section @@ -56,8 +56,8 @@ This slide has a child, but it will not be displayed. It will only run the babe Can has display? ** No Display! Only Execute! :PROPERTIES: -:SLIDE_ACTION: nil -:SLIDE_SECTION_ACTIONS: ms-action-babel +:MS_SLIDE_ACTION: nil +:MS_SECTION_ACTIONS: ms-action-babel :END: These three 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: @@ -99,7 +99,7 @@ Our cleanup is always run #+end_src * Babel Slide Integration :PROPERTIES: -:SLIDE_SECTION_ACTIONS: ms-action-babel +:MS_SECTION_ACTIONS: ms-action-babel :END: Both backwards and forward are supported on this slide. @@ -142,7 +142,7 @@ Both backwards and forward are supported on this slide. * Image Slides :PROPERTIES: -:SLIDE_SECTION_ACTIONS: ms-action-image +:MS_SECTION_ACTIONS: ms-action-image :END: This is an image slide. You can view the images inline using ~org-toggle-inline-images~. Each image will be opened in a full-screen buffer, which is configured to act as a slide, so it still responds to the keybindings. @@ -152,7 +152,7 @@ This is an image slide. You can view the images inline using ~org-toggle-inline [[./images/before-google3.jpeg]] [[./images/all-software-is-the-same-with-tang.jpeg]] * Package Integration :PROPERTIES: -:SLIDE_SECTION_ACTIONS: ms-action-babel +:MS_SECTION_ACTIONS: ms-action-babel :END: - Let arbitrary buffers be shown while still completing steps within the slide-show - Run babel against other buffers 😈