all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* define a new export backend
@ 2014-07-31  7:11 Shiyuan
  2014-07-31  7:27 ` Thorsten Jolitz
  0 siblings, 1 reply; 7+ messages in thread
From: Shiyuan @ 2014-07-31  7:11 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1455 bytes --]

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))

[-- Attachment #2: Type: text/html, Size: 2133 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-07-31 22:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31  7:11 define a new export backend Shiyuan
2014-07-31  7:27 ` Thorsten Jolitz
2014-07-31  8:08   ` Nicolas Richard
2014-07-31  8:39     ` Nicolas Goaziou
2014-07-31  9:17       ` Nicolas Richard
2014-07-31 11:41         ` Nicolas Goaziou
2014-07-31 22:04           ` Shiyuan

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.