emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] creating new #+KEYWORD: variables


From: Diego Zamboni
Subject: Re: [O] creating new #+KEYWORD: variables
Date: Mon, 12 Nov 2018 10:11:38 +0100

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 <address@hidden> wrote:
Hello,

Matt Price <address@hidden> 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


reply via email to

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