From mboxrd@z Thu Jan 1 00:00:00 1970 From: Diego Zamboni Subject: Re: creating new #+KEYWORD: variables Date: Mon, 12 Nov 2018 10:11:38 +0100 Message-ID: References: <87h8gpcs86.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005f7b1b057a7419e8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gM8Gy-0004Bl-Bj for emacs-orgmode@gnu.org; Mon, 12 Nov 2018 04:12:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gM8Gs-0005wR-84 for emacs-orgmode@gnu.org; Mon, 12 Nov 2018 04:12:44 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]:40719) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gM8Gh-0005dK-Om for emacs-orgmode@gnu.org; Mon, 12 Nov 2018 04:12:30 -0500 Received: by mail-ed1-x535.google.com with SMTP id d3so6139985edx.7 for ; Mon, 12 Nov 2018 01:12:25 -0800 (PST) In-Reply-To: <87h8gpcs86.fsf@nicolasgoaziou.fr> 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: Org-mode --0000000000005f7b1b057a7419e8 Content-Type: text/plain; charset="UTF-8" Hi Nicolas, Thank you for this pointer! I have modified my own leanpub-multifile backend (derived from leanpub) to use this instead of manually extracting the keywords. In case anyone is interested, my code is here: https://github.com/zzamboni/dot-emacs/blob/master/init.org#publishing-to-leanpub Best, --Diego On Sat, Nov 10, 2018 at 8:22 AM Nicolas Goaziou wrote: > Hello, > > Matt Price writes: > > > I am writing this interface to my university's learning management > system: > > > https://github.com/titaniumbones/Org-Marking-Mode/tree/use-structured-course-def > . > > I am only using hte exporting system tangentially and I have not defined > a > > new exporter. However, I would really like to be able to set some > variable > > values in the header section of hte document, e.g.: > > > > #+ORG_LMS_COURSE: becomingmodern > > You can add keywords specific to a given export back-end in its > definition, more precisely in :options-alist value. For example, in > "ox-texinfo", there is > > (org-export-define-backend 'texinfo > '((bold . org-texinfo-bold)) > ... > :options-alist > '((:texinfo-filename "TEXINFO_FILENAME" nil nil t) > ...)) > > which means `texinfo' back-end should recognize the "#+TEXINFO_FILENAME" > keyword, and store its value in the :texinfo-filename property from > "info" paramater, which is passed to each function. > > You can write a derived back-end using this new keyword, along with > a template function that actually uses it. Look at the definition of > `beamer' back-end for an example. > > HTH, > > -- > Nicolas Goaziou > > --0000000000005f7b1b057a7419e8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Nicolas,

Thank you = for this pointer! I have modified my own leanpub-multifile backend (derived= from leanpub) to use this instead of manually extracting the keywords.

In case anyone is interested, my code is here:=C2=A0<= a href=3D"https://github.com/zzamboni/dot-emacs/blob/master/init.org#publis= hing-to-leanpub">https://github.com/zzamboni/dot-emacs/blob/master/init.org= #publishing-to-leanpub

Best,
--Diego=


On Sat, Nov = 10, 2018 at 8:22 AM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Hello,

Matt Price <mopt= op99@gmail.com> writes:

> I am writing this interface to my university's learning management= system:
> https://github.= com/titaniumbones/Org-Marking-Mode/tree/use-structured-course-def.
> I am only using hte exporting system tangentially and I have not defin= ed a
> new exporter. However, I would really like to be able to set some vari= able
> values in the header section of hte document, e.g.:
>
> #+ORG_LMS_COURSE: becomingmodern

You can add keywords specific to a given export back-end in its
definition, more precisely in :options-alist value. For example, in
"ox-texinfo", there is

=C2=A0 =C2=A0 (org-export-define-backend 'texinfo
=C2=A0 =C2=A0 =C2=A0 '((bold . org-texinfo-bold))
=C2=A0 =C2=A0 =C2=A0 ...
=C2=A0 =C2=A0 =C2=A0 :options-alist
=C2=A0 =C2=A0 =C2=A0 '((:texinfo-filename "TEXINFO_FILENAME" = nil nil t)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ...))

which means `texinfo' back-end should recognize the "#+TEXINFO_FIL= ENAME"
keyword, and store its value in the :texinfo-filename property from
"info" paramater, which is passed to each function.

You can write a derived back-end using this new keyword, along with
a template function that actually uses it. Look at the definition of
`beamer' back-end for an example.

HTH,

--
Nicolas Goaziou

--0000000000005f7b1b057a7419e8--