Cleanup indentation; remove :export-block

This commit is contained in:
Lars Tveito 2016-08-04 18:02:01 +02:00
parent 66bed0d179
commit 437771130f

View File

@ -44,7 +44,6 @@
;;; Define Back-End ;;; Define Back-End
(org-export-define-derived-backend 'gfm 'md (org-export-define-derived-backend 'gfm 'md
:export-block '("GFM" "GITHUB FLAVORED MARKDOWN")
:filters-alist '((:filter-parse-tree . org-md-separate-elements)) :filters-alist '((:filter-parse-tree . org-md-separate-elements))
:menu-entry :menu-entry
'(?g "Export to Github Flavored Markdown" '(?g "Export to Github Flavored Markdown"
@ -56,7 +55,7 @@
(if a (org-gfm-export-to-markdown t s v) (if a (org-gfm-export-to-markdown t s v)
(org-open-file (org-gfm-export-to-markdown nil s v))))))) (org-open-file (org-gfm-export-to-markdown nil s v)))))))
:translate-alist '((inner-template . org-gfm-inner-template) :translate-alist '((inner-template . org-gfm-inner-template)
(paragraph . org-gfm-paragraph) (paragraph . org-gfm-paragraph)
(strike-through . org-gfm-strike-through) (strike-through . org-gfm-strike-through)
(src-block . org-gfm-src-block) (src-block . org-gfm-src-block)
(table-cell . org-gfm-table-cell) (table-cell . org-gfm-table-cell)
@ -74,12 +73,11 @@
CONTENTS is the paragraph contents. INFO is a plist used as a CONTENTS is the paragraph contents. INFO is a plist used as a
communication channel." communication channel."
(unless (plist-get info :preserve-breaks) (unless (plist-get info :preserve-breaks)
(setq contents (concat (mapconcat 'identity (split-string contents) " ") (setq contents (concat (mapconcat 'identity (split-string contents) " ") "\n")))
"\n")))
(let ((first-object (car (org-element-contents paragraph)))) (let ((first-object (car (org-element-contents paragraph))))
;; If paragraph starts with a #, protect it. ;; If paragraph starts with a #, protect it.
(if (and (stringp first-object) (string-match "\\`#" first-object)) (if (and (stringp first-object) (string-match "\\`#" first-object))
(replace-regexp-in-string "\\`#" "\\#" contents nil t) (replace-regexp-in-string "\\`#" "\\#" contents nil t)
contents))) contents)))
@ -226,8 +224,8 @@ contextual information."
columns columns
gfm-table-separator) gfm-table-separator)
gfm-table-right-border "\n")))))) gfm-table-right-border "\n"))))))
(concat (when no-header (funcall build-dummy-header)) (concat (when no-header (funcall build-dummy-header))
(replace-regexp-in-string "\n\n" "\n" contents)))) (replace-regexp-in-string "\n\n" "\n" contents))))
;;;; Table of contents ;;;; Table of contents