emacs-orgmode
[Top][All Lists]
Advanced

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

Re: exporter: How to get :file property on a src block in an exporter


From: Yasushi SHOJI
Subject: Re: exporter: How to get :file property on a src block in an exporter
Date: Thu, 23 Dec 2021 07:16:26 +0900

Hi,

On Thu, Dec 23, 2021 at 3:22 AM Berry, Charles <ccberry@health.ucsd.edu> wrote:
> > On Dec 22, 2021, at 8:07 AM, Yasushi SHOJI <yasushi.shoji@gmail.com> wrote:
> > On Thu, Dec 23, 2021 at 12:52 AM Yasushi SHOJI <yasushi.shoji@gmail.com> 
> > wrote:
> >> Then, why don't I have :file in the info?
> >
> > The :exports must be "file" to have the file name in the info.  I used
> > to have "code" because
> > I wanted to export code with the file name as an attribute.
>
> I don't see that here:
>
> #+begin_src emacs-lisp :exports code :file abc
>   (assq :file (caddr (org-babel-get-src-block-info 'light)))
> #+end_src
>
> #+RESULTS:
> : (:file . abc)

Indeed, this one works.  But I don't see :file, or the whole
:parameters in the info arg passed to my function.

> `org-export-as' runs `org-babel-exp-process-buffer' *before*  it parses the 
> buffer and the header args get stripped from the copy buffer at that time.

Would you mind telling me where the stripping part is in the code, and
the reason why it strips?

> So you need to find a way to get the :file header arg whilst babel runs and 
> hang onto it for later use.

I'm still learning but :parameters, which holds :file, are already
gone from the info arg when org-myexporter-src-block is called.

Thanks,
-- 
            yashi



reply via email to

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