Skip to content

Instantly share code, notes, and snippets.

@grafov
Forked from yryozo/orgtbl-to-gfm.el
Last active October 14, 2022 01:38
Show Gist options
  • Save grafov/8244792 to your computer and use it in GitHub Desktop.
Save grafov/8244792 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