From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: including external file in src block execution; ATTR_HTML on src blocks Date: Mon, 12 Dec 2016 09:16:53 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cGUE5-0008BF-4C for emacs-orgmode@gnu.org; Mon, 12 Dec 2016 12:17:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cGUE1-0004Pf-4V for emacs-orgmode@gnu.org; Mon, 12 Dec 2016 12:17:21 -0500 Received: from iport-acv2-out.ucsd.edu ([132.239.0.174]:14739) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1cGUE0-0004PV-Ma for emacs-orgmode@gnu.org; Mon, 12 Dec 2016 12:17:17 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Matt Price Cc: Org Mode On Mon, 12 Dec 2016, Matt Price wrote: [snip] > > My questions are: > 1. can I pass this html attribute to the
 block somehow?

Yes.

> ATTR_HTML doesn't seem to work.  Is this a bug? If so, should I try to fix
> it?

No and no.

Did you try

: (plist-get (cadr src-block) :attr_html)

in `org-html-src-block' ?


> If not, is there a simple way to use header arguments to pass
> information down?

The answer is still no. ;-)

There are complicated ways. See

https://github.com/chasberry/orgmode-accessories/blob/ravel-lang/ox-ravel.org

for one such. But for what you are doing ATTR_HTML is easiest.


> I am already rewriting the exporter's src-block export
> function, so I can try to accomplish what I need to in that context.

BTW, the cleanest way to do this is by writing a derived exporter:

:  (org-export-define-derived-backend 'reveal 'revealplus ...

In your case you only provide the src-block entry for the 
:translate-alist, :options-alist entries for any you redefine or 
introduce, and optionally a :menu-entry.

Also, you'll probably want to add a hook to 
`org-export-before-parsing-hook' (see below).


If you do this, then `#+ATTR_REVEALPLUS:' seems suitable.

> 2. I'd like to be able to test my code directly in org (since I'm a lousy
> coder and a clumsy typist). Can I tell org to load other files before
> executing a src block?

Yes. Depending on what you want one of these:

* Add this to `org-export-before-parsing-hook', perhaps in setting up a
   derived exporter.

* Or perhaps by using a local variable `eval' see

: (info "(emacs) Specifying File Variables")

* Or by executing a src-block that loads those files.

HTH,

Chuck