help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to add more markups and formatting for markups to Org


From: Rasmus
Subject: Re: How to add more markups and formatting for markups to Org
Date: Mon, 01 Jun 2015 01:52:35 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux)

Hi,

"Tu, Do" <solidius4747@gmail.com> writes:

> For example, anything in between *...* is bold by default. I want to
> add a markup with my own formatting for such markup,
> i.e. <kbd>...</kbd> with a box surrounds such markup. I also want the
> mark up to be compatible with (setq org-hide-emphasis-markers t). That
> is, when the variable is set to t, the <kbd> and </kbd>tags should
> disappear, leaving the text between it with the specified formatting
> above.

The org format has a fixed number of supported types.  From the context,
it seems like you have a case in mind where you export to html.

Try (with-temp-buffer (insert "a *b*") (org-element-context)).  As you see
it's bold.  When exporting to html, it's transcoded via org-html-bold.
Thus, adding new markup the way you want in non-trivial as you have to add
it to both org-element and the export backend, e.g. ox-html.

For your case, I'd use a macro:

#+macro: kbd @@html:<kbd>@@$1@@html:</kdb>@@
{{{kbd(my-key)}}}

See also org-hide-macro-markers and font-lock-add-keywords for changing
the face.

Rasmus

-- 
This message is brought to you by the department of redundant departments




reply via email to

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