Comments (7)
OK. I am not familiar with JS. So will all JS be specified in the form
{src: 'xxx.js', async:true, condition: function() {return !!document.body.classList} }
or it is possible there are JS in other forms.
If all JS are in the same form, I can modify org-reveal to simply the statements, otherwise, we have to leave some extensibility there.
Regards,
Yujie
from org-reveal.
- I think the JS fragment is correct.
- To allow a space-separated list and global default (see org-export-options-alist):
(:reveal-extra-js "REVEAL_EXTRA_JS" nil org-reveal-extra-js split)
(defcustom org-reveal-extra-js nil
"List of extra JS files or URLs to load"
:group 'org-export-reveal
:type 'list)
- I think that you should do the same with :reveal-extra-css.
- And it may also be better to handle :reveal-plugins like a list, instead of space-separated string.
from org-reveal.
The above defcustom is bogus. The right one is this, see (info "(elisp)Simple Types") and (info "(elisp)Composite Types")
(defcustom org-reveal-extra-js nil
"List of extra JS files or URLs to load"
:group 'org-export-reveal
:type '(set (choice (file :tag "File" :must-match t)
(string :tag "URL"))))
This will offer auto-completion if the user picks the File choice
from org-reveal.
I'm loading some extra libraries to do graphing and that required specifying the callback function so for me it was easier to do #+REVEAL_EXTRA_JS: { src: './js/Chart.min.js', async: true , callback: function() { Chart.renderChart(); } }, { src: './js/Chart.StackedBar.js', async: true }
. Figured I'd drop that here in case anyone else is trying to do something similar.
from org-reveal.
Is it good to have REVEAL_EXTRA_JS
accept the same arguments as HTML_HEAD_EXTRA
? Or actually rename it as REVEAL_HEAD_EXTRA
?
from org-reveal.
@psifertex: imho the best is to elaborate the defcustom to include for each value a string field callback
(eg Chart.renderChart()
) and a boolean field async
. Breaking the info into fields makes it easier for a user to fill out correctly.
@gongzhitaao HTML_HEAD_EXTRA is not appropriate since it's merely lines to be added to the <HEAD>
from org-reveal.
Since there are possibly different requirements for the format of JS script format, I'd like to leave REVEAL_EXTRA_JS
as it is now, where one can write whatever JS code, ugly though.
Let me close the issue for now.
from org-reveal.
Related Issues (20)
- Single file still has local dependencies
- Using plugins seems broken with current reveal.js HOT 3
- Unable to set theme HOT 2
- Left-alignment broken by comment/note HOT 2
- multiplex confusion HOT 10
- feature request: REVEAL_PROLOGUE_HTML REVEAL_EPILOGUE_HTML HOT 2
- How to tell org-reveal to use latex package HOT 5
- disable the center behavior HOT 1
- 94c43ff36a47f6fa3d865e67f0b99bf0de146db2
- Font color in tables HOT 3
- Image path after export HOT 2
- org-reveal-export-to-html does not respect ordered list start-number with the [@n] trick
- Support request: configure ORGFILE_client.html multiplex output filename
- Adding multiple stylesheets with EXPORT_REVEAL_EXTRA_CSS property does not work as expected
- No dot after section number when using split:t
- Please document minimum supported reveal.js version
- Please provide minimal test document
- Wrong docstring for org-reveal-single-file
- Possible to fragment lists by default?
- org-element-at-point error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-reveal.