Giter Site home page Giter Site logo

option which plugins to enable about org-reveal HOT 7 CLOSED

yjwen avatar yjwen commented on August 9, 2024
option which plugins to enable

from org-reveal.

Comments (7)

yjwen avatar yjwen commented on August 9, 2024

Hi, Vladimir,

I just checked in codes for selective plugins. Now you can use #+REVEAL_PLUGINS or set variable org-reveal-plugins to a Lisp list to select plugins.

To meet the request you mentioned, please add

#+REVEAL_PLUGINS: (classList highlight zoom notes search)

from org-reveal.

VladimirAlexiev avatar VladimirAlexiev commented on August 9, 2024

Great! But you've used a string, so you had to do (car (read-from-string...)).
Better declare it a list (see org-export-options-alist):

    (:reveal-plugins "REVEAL_PLUGINS" nil org-reveal-plugins split)

But there's something I don't like about the documentation of 'split': "Split values at white spaces, and cons them to the previous list": does that mean the user can only add to the default value? Before proceeding, please check this.

If you declare it a list, then you can check for correct values, see (info "(elisp)Composite Types"):

(defcustom org-reveal-plugins
  '(classList markdown highlight zoom notes)
  "Reveal plugins to load"
  :group 'org-export-reveal
  :type (set (choice (const :doc "Cross-browser shim implementing classList, MANDATORY" classList)
                     (const :doc "Interpret Markdown in slides" markdown)
                     (const :doc "Syntax highlight for SRC blocks" highlight)
                     ...
                     )))

Note: I've never used defcustom, this above is untested :-)

from org-reveal.

yjwen avatar yjwen commented on August 9, 2024

I tried as you have suggested. The split option specify how the new value of an option is appended to the old ones. split join them together with white spaces as the seperator. So the value is still a string. To extract the list, we still need a call of read-from-string, an equivalent effort as current code does. So I'd prefer not change the codes. :)

from org-reveal.

VladimirAlexiev avatar VladimirAlexiev commented on August 9, 2024

Sorry I can't debug this now, but I looked at the code:
'split appears twice in ox.el:

(defun org-export-insert-default-template
            ...
                               (mapconcat 'identity (eval (nth 3 entry)) " ")
(defun org-export--get-subtree-options
            ...
                               (org-split-string value))

The first one converts a list value to a space-separated string, for inserting in the org buffer wiht C-e #.
The second one converts space-separated string to list, for usage by the export process.
So it seems to me your code should get a list. What initial value do you use?

Even if it gets a string (which you can split with org-split-string), isn't it worth it to have choice checking with (defcustom :type)?

from org-reveal.

VladimirAlexiev avatar VladimirAlexiev commented on August 9, 2024

isn't it worth it to have choice checking with (defcustom :type)?

from org-reveal.

yjwen avatar yjwen commented on August 9, 2024

Hi, Vladimir,

I just checked in the codes that use the Emacs sexp widget type to define org-reveal-plugins.

I'd like to thank you for your suggestions, which get me to be familiar with the Emacs widgets, a realy amazing feature that I didn't know before. I didn't even know the exact purpose of (defcustom) when I was imitating those in ox-html. :)

Regards,
Yujie

from org-reveal.

VladimirAlexiev avatar VladimirAlexiev commented on August 9, 2024

Nice!

from org-reveal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.