emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Customize html formatting tags for export


From: Tory S. Anderson
Subject: Re: [O] Customize html formatting tags for export
Date: Thu, 29 Jan 2015 05:55:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Thanks. With that info I did this: 

--8<---------------cut here---------------start------------->8---
;; convert =C-x=a to <kbd>C-x</kbd>, *awesome* to <strong>awesome</strong>
(setq org-html-text-markup-alist   '((bold . "<strong>%s</strong>") ; *text*
    (code . "<code>%s</code>") ; ~text~
    (italic . "<i>%s</i>") ; /text/
    (strike-through . "<del>%s</del>") ; +text+
    (underline . "<span class=\"underline\">%s</span>") ; _text_
    (verbatim . "<kbd>%s</kbd>"))) ; =text=
--8<---------------cut here---------------end--------------->8---

It seems to work great! I failed finding a way to make this just a buffer local 
change (e.g. only when I'm writing in my tech blog org file), but I can live 
with that. 

Note: I changed <b> to <strong> because I'm a web developer and most of the 
time <b> hurts my soul[1][2][3] ...

Marcin Borkowski <address@hidden> writes:

> On 2015-01-28, at 21:40, Tory S. Anderson <address@hidden> wrote:
>
>> Right now I see that =formatted= and ~formatted~ both produce 
>> <code>formatted</code> when exported to html. How can I change one of these, 
>> perhaps to a custom tag (in particular, I'm hoping to produce 
>> <kbd>formatted</kbd>)? 
>
> See ox-html.  There are functions org-html-verbatim and org-html-code.
> If you look at those, you can see that (even though it might be
> a quick-and-dirty hack) customizing org-html-text-markup-alist should
> work.  You might even utilize the strike-through, if you never use it.
>
> Hth,

Footnotes: 
[1]  https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong
[2]  http://www.html-5-tutorial.com/strong-and-b-elements.htm
[3]  
http://stackoverflow.com/questions/271743/whats-the-difference-between-b-and-strong-i-and-em





reply via email to

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