emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Link between org-publish project options and org-export-options-alist
@ 2024-08-13 14:22 Sébastien Gendre
  2024-08-18 11:58 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Sébastien Gendre @ 2024-08-13 14:22 UTC (permalink / raw)
  To: Org mailing list

[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]

Hello,

I (continue to) develop a custom preamble function. And I try to found
if there is a link between options set in an org-publish project and
options set in variable `org-export-options-alist.

For my function, I have defined one new export option in the variable
`org-export-options-alist`:

    (add-to-list 'org-export-options-alist
                 '(:html-doc-name-template "HTML_DOC_NAME_TEMPLATE" my/org-html-doc-name-template nil))

This options have a default value defined in variable
`my/org-html-doc-name-template`:

    (setq my/org-html-doc-name-template "<div class=\"doc_name\">
        <a aria-label=\"Documentation name\" href=\"/\">
            <span>%n</span>
        </a>
    </div>")


But, when I use org-publish and try to retrieve option ":html-doc-name-template" from my
custom preamble function like this:

    …
    (plist-get info :html-doc-name-template)
    …

If I do not define the options `:html-doc-name-temple` in my publish
project options, I get the value `nil` and not the value of the variable
`my/org-html-doc-name-template`.

Are the options of org-publish independent of options defined in
`org-export-options-alist` ?


Best regards

-------
Gendre Sébastien

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 849 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Link between org-publish project options and org-export-options-alist
  2024-08-13 14:22 Link between org-publish project options and org-export-options-alist Sébastien Gendre
@ 2024-08-18 11:58 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-08-18 11:58 UTC (permalink / raw)
  To: Sébastien Gendre; +Cc: Org mailing list

Sébastien Gendre <seb@k-7.ch> writes:

> I (continue to) develop a custom preamble function. And I try to found
> if there is a link between options set in an org-publish project and
> options set in variable `org-export-options-alist.
> ...
> For my function, I have defined one new export option in the variable
> `org-export-options-alist`:
>
>     (add-to-list 'org-export-options-alist
>                  '(:html-doc-name-template "HTML_DOC_NAME_TEMPLATE" my/org-html-doc-name-template nil))

This is a wrong format. Please check the docstring.
Should be '(:html-doc-name-template "HTML_DOC_NAME_TEMPLATE" nil my/org-html-doc-name-template nil)

> But, when I use org-publish and try to retrieve option ":html-doc-name-template" from my
> custom preamble function like this:
>
>     …
>     (plist-get info :html-doc-name-template)
>     …
>
> If I do not define the options `:html-doc-name-temple` in my publish
> project options, I get the value `nil` and not the value of the variable
> `my/org-html-doc-name-template`.
>
> Are the options of org-publish independent of options defined in
> `org-export-options-alist` ?

Publish plist is transferred to INFO plist, taking priority.
However, parsing the in-file keywords and export options should be
configured via export backend (or globally, all backends, as you did by
modifying `org-export-options-alist') - you can create a custom derived
backend programatically within you publishing function via
`org-export-create-backend'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-18 11:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-13 14:22 Link between org-publish project options and org-export-options-alist Sébastien Gendre
2024-08-18 11:58 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).