Skip to content

Instantly share code, notes, and snippets.

@arbelt
Forked from yryozo/orgtbl-to-gfm.el
Last active August 29, 2015 14:23
Show Gist options
  • Save arbelt/566df295de2e9c393bd0 to your computer and use it in GitHub Desktop.
Save arbelt/566df295de2e9c393bd0 to your computer and use it in GitHub Desktop.
;; 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