emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] allow live execution of code snippets in html export


From: Bastien
Subject: Re: [O] allow live execution of code snippets in html export
Date: Thu, 15 Dec 2016 11:07:13 +0100
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/26.0.50 (gnu/linux)

Hi Matt,

Matt Price <address@hidden> writes:

> Would we need a switch to permit the old syntax for people with
> complex setups who don't want to change?

Yes.  We need to be more careful on being backward compatible.

>     - make src-clojure in <pre class="src src-clojure"> customizable
>     ?
>
> Is this likely to break anything in derived exporters? It would
> certianly be convenient e.g for using highlight.js in wordpress in
> similar environments.

Yes.

>     - have ob-javascript.el to let ox-html know how to export js
>     code ?
>
> Isn't this in org already? there's an ob-js.el in my org repo.

Yep, indeed -- I have just this in my emacs.el for inline js:

(add-to-list 'org-src-lang-modes '("inline-js" . javascript))
(defvar org-babel-default-header-args:inline-js
  '((:results . "html")
    (:exports . "results")))
(defun org-babel-execute:inline-js (body _params)
  (format "<script type=\"text/javascript\">\n%s\n</script>" body))

Maybe this could be made available too.

>     - have org-html-js to easily allow adding js libraries at the
>     bottom of a page? Perhaps together with #+html_js and
>     #+html_js_extra ?
>
> This seems like a good idea and pretty easy.

I will think more about this.

> I odn't really quite understand the problem and solution parameters. 
> Since Yehonathan is here on this thread and enthusiastic about
> helping out: is there something he could do to make this feasible for
> us?  Or by "more general mechanism" do you mean some third way
> between bundling and linking to?

One way to solve this on Yehonathan's side is to update klipse.js and
follow the instruction on librejs on how to make librejs accept the js
code as "safe":

https://www.gnu.org/software/librejs/free-your-javascript.html

I don't know how much work is involved in this, though.

-- 
 Bastien



reply via email to

[Prev in Thread] Current Thread [Next in Thread]