emacs-orgmode
[Top][All Lists]
Advanced

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

[O] define a new export backend


From: Shiyuan
Subject: [O] define a new export backend
Date: Thu, 31 Jul 2014 00:11:56 -0700

Hi, 
    I try to define a new export backend in the new export framework. My export backend should behaves like the html except that it transcodes *bold* differently.  I try to following the Worg tutorial http://orgmode.org/worg/dev/org-export-reference.html , ox-html.el and use org-export-define-derived-backend. I can see the new backend showing up in the export menu(C-c C-e), but my transcoder for bold is not used.  Any help or reference pointer is appreciated. 

Shiyuan 


-------------------------
(org-export-define-derived-backend 'my-html-enlish 'html
  :traslate-alist '((bold . my-org-html-english-bold))
   :menu-entry
  '(?E "Export to HTML-ENGLISH"
       ((?H "As HTML buffer" my-org-html-english-export-as-html)
)))
------------------------------
(defun my-org-html-english-export-as-html
  (&optional async subtreep visible-only body-only ext-plist)
 "This is almost copied from org-html-export-as-html except using my newly defined backend"
  (interactive)
  (org-export-to-buffer 'my-html-enlish "*Org HTML-ENG Export*"
    async subtreep visible-only body-only ext-plist
    (lambda () (set-auto-mode t))))
-------------------
(defun my-org-html-english-bold (bold contents info)
  "Transcode BOLD from Org to HTML. Intead of using ordinary bold, we use color to highlight the 
CONTENTS is the text with bold markup.  INFO is a plist holding
contextual information."
  (format "<span style=\"color: #a020f0\"> %s </span>"
  contents))

reply via email to

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