From: Rasmus <rasmus@gmx.us>
To: help-gnu-emacs@gnu.org
Subject: Re: How to add more markups and formatting for markups to Org
Date: Mon, 01 Jun 2015 01:52:35 +0200 [thread overview]
Message-ID: <87pp5ge24c.fsf@gmx.us> (raw)
In-Reply-To: d6804f0a-bfea-498f-8f2c-50f451abeff7@googlegroups.com
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
prev parent reply other threads:[~2015-05-31 23:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-31 15:43 How to add more markups and formatting for markups to Org Tu, Do
2015-05-31 16:25 ` Suvayu Ali
2015-05-31 18:41 ` Drew Adams
2015-05-31 23:52 ` Rasmus [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pp5ge24c.fsf@gmx.us \
--to=rasmus@gmx.us \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.