Skip to content

Instantly share code, notes, and snippets.

@yryozo
Created June 18, 2013 17:02
Show Gist options
  • Save yryozo/5807243 to your computer and use it in GitHub Desktop.
Save yryozo/5807243 to your computer and use it in GitHub Desktop.
Orgtbl Translator function for the GitHub-Flavored-Markdown(GFM)
;; Usage Example:
;;
;; <!-- BEGIN RECEIVE ORGTBL ${1:YOUR_TABLE_NAME} -->
;; <!-- END RECEIVE ORGTBL $1 -->
;;
;; <!--
;; #+ORGTBL: SEND $1 orgtbl-to-gfm
;; | $0 |
;; -->
(defun orgtbl-to-gfm (table params)
"Convert the Orgtbl mode TABLE to GitHub Flavored Markdown."
(let* ((alignment (mapconcat (lambda (x) (if x "|--:" "|---"))
org-table-last-alignment ""))
(params2
(list
:splice t
:hline (concat alignment "|")
:lstart "| " :lend " |" :sep " | ")))
(orgtbl-to-generic table (org-combine-plists params2 params))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment