Created
June 18, 2013 17:02
-
-
Save yryozo/5807243 to your computer and use it in GitHub Desktop.
Orgtbl Translator function for the GitHub-Flavored-Markdown(GFM)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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