[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Need for dedicated kinds of paragraphs
From: |
Ihor Radchenko |
Subject: |
Re: Need for dedicated kinds of paragraphs |
Date: |
Mon, 17 Oct 2022 11:33:32 +0000 |
Damien Cassou <damien@cassou.me> writes:
> I'm not sure what kind of markup to use nor how to transcode that
> markup. I tried with:
>
> #+BOX: attention
> This text will appear with a red background
>
> Does that make sense? Do you have a better suggestion?
Note that #+BOX is not a valid affiliated keyword. Only keywords from
org-element-affiliated-keywords + #+ATTR_X keywords are considered
affiliated.
So, you example is actually parsed as
<keyword :name "BOX" ...>
<paragraph>
not as
<paragraph :BOX ...>
In addition to special blocks suggested by others, a natural way to
customize paragraph export is using #+ATTR_YOURBACKEND keywords.
Something like
#+ATTR_BACKEND: :style attention
This text will appear with a red background
Then, you can use
(plist-get (org-export-read-attribute :attr_backend paragraph-element)
:style)
from inside the paragraph transcoder.
--
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>