emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Paul Schorfheide <pschorf2@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Patch for ox-confluence.el
Date: Wed, 09 Mar 2016 16:42:33 +0000	[thread overview]
Message-ID: <CADK98M2GKNNSY0y_27MukDD=u_Kp+44RMzpABuDowsHgMvfLUA@mail.gmail.com> (raw)


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


             reply	other threads:[~2016-03-09 16:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09 16:42 Paul Schorfheide [this message]
2016-03-17 11:26 ` Patch for ox-confluence.el Nicolas Goaziou
2016-03-19 14:27   ` Paul Schorfheide
2016-04-02  8:57     ` Nicolas Goaziou

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADK98M2GKNNSY0y_27MukDD=u_Kp+44RMzpABuDowsHgMvfLUA@mail.gmail.com' \
    --to=pschorf2@gmail.com \
    --cc=emacs-orgmode@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 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).