emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Charles Durst <cwdurst+orgmode@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] ox-confluence.el: Add support for verbatim & code
Date: Wed, 30 Nov 2016 17:41:22 -0500	[thread overview]
Message-ID: <CAM4wePgp=XRBnBG64jYLb01qQQ=-1W8g=kEzU=xh2tRwnOFW0w@mail.gmail.com> (raw)

A tiny patch to improve text formatting support for exporting to
Confluence wiki-markup.

--
Charles Durst
cwdurst+orgmode@gmail.com


* contrib/lisp/ox-confluence.el (org-confluence-verbatim,
  org-confluence-code): New functions.

Convert org-mode =verbatim= and ~code~ into Confluence {{monospace}}.

TINYCHANGE
---
 contrib/lisp/ox-confluence.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/contrib/lisp/ox-confluence.el b/contrib/lisp/ox-confluence.el
index 48bc5ea..bbdc58a 100644
--- a/contrib/lisp/ox-confluence.el
+++ b/contrib/lisp/ox-confluence.el
@@ -41,6 +41,8 @@
   :translate-alist '((bold . org-confluence-bold)
      (example-block . org-confluence-example-block)
      (fixed-width . org-confluence-fixed-width)
+     (verbatim . org-confluence-verbatim)
+     (code . org-confluence-code)
      (footnote-definition . org-confluence-empty)
      (footnote-reference . org-confluence-empty)
      (headline . org-confluence-headline)
@@ -86,6 +88,12 @@
 (defun org-confluence-fixed-width (fixed-width contents info)
   (format "\{\{%s\}\}" contents))

+(defun org-confluence-verbatim (verbatim contents info)
+  (format "\{\{%s\}\}" (org-element-property :value verbatim)))
+
+(defun org-confluence-code (code contents info)
+  (format "\{\{%s\}\}" (org-element-property :value code)))
+
 (defun org-confluence-headline (headline contents info)
   (let ((low-level-rank (org-export-low-level-p headline info))
         (text (org-export-data (org-element-property :title headline)
-- 
2.5.4 (Apple Git-61)

             reply	other threads:[~2016-11-30 22:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 22:41 Charles Durst [this message]
2016-12-05 21:23 ` [PATCH] ox-confluence.el: Add support for verbatim & code 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='CAM4wePgp=XRBnBG64jYLb01qQQ=-1W8g=kEzU=xh2tRwnOFW0w@mail.gmail.com' \
    --to=cwdurst+orgmode@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).