emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Patch for ox-confluence.el
@ 2016-03-09 16:42 Paul Schorfheide
  2016-03-17 11:26 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Schorfheide @ 2016-03-09 16:42 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 148 bytes --]

Hi:

I made a small change to ox-confluence.el to support additional language
name mappings. Can someone please review it?

Thanks
Paul Schorfheide

[-- Attachment #1.2: Type: text/html, Size: 221 bytes --]

[-- Attachment #2: 0001-Add-org-confluence-lang-alist.patch --]
[-- Type: application/octet-stream, Size: 1542 bytes --]

From c69827145c437d507c87e547bc554851b964d7b8 Mon Sep 17 00:00:00 2001
From: Paul Schorfheide <pschorf2@gmail.com>
Date: Wed, 9 Mar 2016 10:38:46 -0600
Subject: [PATCH] Add org-confluence-lang-alist

* ox-confluence.el (org-confluence-src-block): Add var for mapping
language name

TINYCHANGE
---
 contrib/lisp/ox-confluence.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/contrib/lisp/ox-confluence.el b/contrib/lisp/ox-confluence.el
index 9b96d5f..d4a26bf 100644
--- a/contrib/lisp/ox-confluence.el
+++ b/contrib/lisp/ox-confluence.el
@@ -57,6 +57,10 @@
 		     (template . org-confluence-template)
 		     (underline . org-confluence-underline)))
 
+(defvar org-confluence-lang-alist
+  '(("sh" . "bash"))
+  "Map from org-babel language name to confluence wiki language name")
+
 ;; All the functions we use
 (defun org-confluence-bold (bold contents info)
   (format "*%s*" contents))
@@ -111,8 +115,9 @@
 (defun org-confluence-src-block (src-block contents info)
   ;; FIXME: provide a user-controlled variable for theme
   (let* ((lang (org-element-property :language src-block))
-         (language (if (string= lang "sh") "bash" ;; FIXME: provide a mapping of some sort
-                     lang))
+         (language (if (assoc lang org-confluence-lang-alist)
+		       (cdr (assoc lang org-confluence-lang-alist))
+                       lang))
          (content (org-export-format-code-default src-block info)))
     (org-confluence--block language "Emacs" content)))
 
-- 
2.5.4 (Apple Git-61)


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

end of thread, other threads:[~2016-04-02  8:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-09 16:42 Patch for ox-confluence.el Paul Schorfheide
2016-03-17 11:26 ` Nicolas Goaziou
2016-03-19 14:27   ` Paul Schorfheide
2016-04-02  8:57     ` Nicolas Goaziou

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).