;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310\311\312\313\314\315\316& \210\317\320\321\322\323\324\325\326\327&\207" [require ox-md ox-publish custom-declare-group org-export-gfm nil "Options specific to Markdown export back-end." :tag "Org Github Flavored Markdown" :group org-export :version "24.4" :package-version (Org . "8.0") org-export-define-derived-backend gfm md :filters-alist ((:filter-parse-tree . org-md-separate-elements)) :menu-entry (103 "Export to Github Flavored Markdown" ((71 "To temporary buffer" (lambda (a s v b) (org-gfm-export-as-markdown a s v))) (103 "To file" (lambda (a s v b) (org-gfm-export-to-markdown a s v))) (111 "To file and open" (lambda (a s v b) (if a (org-gfm-export-to-markdown t s v) (org-open-file (org-gfm-export-to-markdown nil s v))))))) :translate-alist ((inner-template . org-gfm-inner-template) (paragraph . org-gfm-paragraph) (strike-through . org-gfm-strike-through) (src-block . org-gfm-src-block) (table-cell . org-gfm-table-cell) (table-row . org-gfm-table-row) (table . org-gfm-table))] 12) #@154 Transcode PARAGRAPH element into Github Flavoured Markdown format. CONTENTS is the paragraph contents. INFO is a plist used as a communication channel. (defalias 'org-gfm-paragraph #[(paragraph contents info) "\304\305\"\204\306\307\310 !\311#\312P\n\211:\204\313\262\202(\211@9\203(\211AA\262@\211;\203@\314\315 \"\203@\316\315\317 \313\320%\202A )\207" [info contents paragraph first-object plist-get :preserve-breaks mapconcat identity split-string " " "\n" nil string-match "\\`#" replace-regexp-in-string "\\#" t] 7 (#$ . 1154)]) #@134 Transcode SRC-BLOCK element into Github Flavored Markdown format. CONTENTS is nil. INFO is a plist used as a communication channel. (defalias 'org-gfm-src-block #[(src-block contents info) "\306\211;\203\307\310#\266\202\202\311A@\"\266\202\312\n\"\313 \314Q\313\f Q,\207" [src-block lang info code prefix suffix :language get-text-property 0 plist-get org-export-format-code-default "```" "\n"] 6 (#$ . 1711)]) #@152 Transcode STRIKE-THROUGH from Org to Markdown (GFM). CONTENTS is the text with strike-through markup. INFO is a plist holding contextual information. (defalias 'org-gfm-strike-through #[(strike-through contents info) "\301\302\"\207" [contents format "~~%s~~"] 3 (#$ . 2146)]) (defvar width-cookies nil) (defvar width-cookies-table nil) (defconst gfm-table-left-border "|") (defconst gfm-table-right-border " |") (defconst gfm-table-separator " |") #@214 Return width of TABLE at given COLUMN. INFO is a plist used as communication channel. Width of a column is determined either by inquerying `width-cookies' in the column, or by the maximum cell with in the column. (defalias 'org-gfm-table-col-width #[(table column info) "\306!\205\n\307 \" \f=\203\n\310=\204\n\202B \f=\203'\306!\204,\311  \312\313 !\314 \315\316$\210\317 #*)\207" [width-cookies column cookie table width-cookies-table specialp hash-table-p gethash nil make-hash-table 0 org-export-table-has-special-column-p org-element-map table-row #[(row) "\305\203 \211:\204\306\262\202\211@9\203\211AA\262@\2027 \211:\204,\306\262\2027\211@9\2037\211AA\262\n\234\211:\204D\306\262\202O\211@9\203O\211AA\262 \"G\f]\211\207" [specialp row column info max-width org-export-data nil] 3] puthash max-width info] 5 (#$ . 2604)]) #@119 Return a function to build horizontal line in TABLE with given CHAR. INFO is a plist used as a communication channel. (defalias 'org-gfm-make-hline-builder #[(table info char) "\301\302\303\304\305\306\307EFE\207" [char lambda (col) let ((max-width (max 3 (org-gfm-table-col-width table col info)))) (when (< max-width 1) (setq max-width 1)) make-string max-width] 8 (#$ . 3486)]) #@131 Transcode TABLE-CELL element from Org into GFM. CONTENTS is content of the cell. INFO is a plist used as a communication channel. (defalias 'org-gfm-table-cell #[(table-cell contents info) "\306!\307\n\"A\310 \n#\311\n\"\203\312\202\313\314\206&\315\211\316\317\f\320!Z]\321\"P Q.\207" [table-cell table info column width left-border org-export-get-parent-table org-export-table-cell-address org-gfm-table-col-width org-export-table-cell-starts-colgroup-p "| " " " " |" "" make-string 0 string-width 32 right-border contents data] 7 (#$ . 3875)]) #@137 Transcode TABLE-ROW element from Org into GFM. CONTENTS is cell contents of TABLE-ROW. INFO is a plist used as a communication channel. (defalias 'org-gfm-table-row #[(table-row contents info) "\306!\307\211;\203\310\311#\266\202\202\312A@\"\266\202\313=\203W\314\315 \300\316\n$\"\317=\203W\306!\320\n\"\321 \n\322#\323 \n\"A\324\325\326\311 S\"#Q,)\207" [table-row table info header-p build-rule cols org-export-get-parent-table :type get-text-property 0 plist-get rule cl-position org-element-map identity 1 org-export-table-row-starts-header-p org-gfm-make-hline-builder 45 org-export-table-dimensions mapconcat #[(col) " !\207" [build-rule col] 2] number-sequence gfm-table-left-border gfm-table-separator gfm-table-right-border contents] 7 (#$ . 4457)]) #@149 Transcode TABLE element into Github Flavored Markdown table. CONTENTS is the contents of the table. INFO is a plist holding contextual information. (defalias 'org-gfm-table #[(table contents info) "\306\307\310 $\211G\311X\312 \"A\313 \205 \314\315\316#P,\207" [table info rows no-header cols build-dummy-header org-element-map table-row identity 1 org-export-table-dimensions #[nil "\306 \307#\306 \310#\311\312\nS\"\313\314 #\315\313\316 #\315\260+\207" [table info cols columns build-rule build-empty-cell org-gfm-make-hline-builder 32 45 number-sequence 0 mapconcat #[(col) " !\207" [build-empty-cell col] 2] "\n" #[(col) " !\207" [build-rule col] 2] gfm-table-left-border gfm-table-separator gfm-table-right-border] 9] replace-regexp-in-string "\n\n" "\n" contents] 6 (#$ . 5255)]) #@110 Return an appropriate table of contents entry for HEADLINE. INFO is a plist used as a communication channel. (defalias 'org-gfm-format-toc #[(headline) "\306\307 \" \"\310\211;\203\311\312#\266\202\202!\313A@\"\266\202S\314 \315_\316\"\260\317\211;\203=\311\312#\266\202\202E\313A@\"\266\202\206L\320 \"\f\321\n\322 \323\260,\207" [headline info title level indent anchor org-export-data org-export-get-alt-title :level get-text-property 0 plist-get make-string 2 32 :CUSTOM_ID org-export-get-reference "- [" "](#" ")"] 6 (#$ . 6080)]) #@79 Format the footnote section. INFO is a plist used as a communication channel. (defalias 'org-gfm-footnote-section #[(info) "\306!\211\307\211\307\211\307\n:\203U\n@\211\211A\242\211A\242@ \310 \"\307\311\203=\312\202>\313\314\311\315\314##\266\202BB\nA\211\202\237.\211\205k\316\317\320\316\321\322\323 \324#\"#*\207" [info fn-alist #1=#:--cl-var-- n type raw org-export-collect-footnote-definitions nil org-export-data replace-regexp-in-string "\\`\\([ ]*\n\\)+" "\\`[ \n ]+" "" "[ \n ]+\\'" format "## %s\n%s" "Footnotes" "\n%s\n" mapconcat #[(fn) "@A\304\305\304\306 \307\"\310\304\311\n\"\n\304\312\n\" $\" #*\207" [fn def n info format "%s %s\n" plist-get :html-footnote-format org-html--anchor "fn.%d" " class=\"footnum\" href=\"#fnr.%d\""] 10] "\n" #2=#:--cl-var-- #3=#:--cl-var--] 11 (#$ . 6646)]) #@150 Return body of document after converting it to Markdown syntax. CONTENTS is the transcoded contents string. INFO is a plist holding export options. (defalias 'org-gfm-inner-template #[(contents info) "\306\307\"\211\205 \310 \"\311\312\n\313#\206\314\n\203 \315\202!\314 \f \313\316!\260\317\320\2035\321\2026\322\314\320\323\314##\266\202,\207" [info depth headlines toc-string toc-tail contents plist-get :with-toc org-export-collect-headlines mapconcat org-gfm-format-toc "\n" "" "\n\n" org-gfm-footnote-section nil replace-regexp-in-string "\\`\\([ ]*\n\\)+" "\\`[ \n ]+" "[ \n ]+\\'"] 10 (#$ . 7508)]) #@713 Export current buffer to a Github Flavored Markdown buffer. If narrowing is active in the current buffer, only export its narrowed part. If a region is active, export that region. A non-nil optional argument ASYNC means the process should happen asynchronously. The resulting buffer should be accessible through the `org-export-stack' interface. When optional argument SUBTREEP is non-nil, export the sub-tree at point, extracting information from the headline properties first. When optional argument VISIBLE-ONLY is non-nil, don't export contents of hidden elements. Export is done in a buffer named "*Org GFM Export*", which will be displayed when `org-export-show-temporary-export-buffer' is non-nil. (defalias 'org-gfm-export-as-markdown #[(&optional async subtreep visible-only) "\303\304\305 \n\306\211\307&\207" [async subtreep visible-only org-export-to-buffer gfm "*Org GFM Export*" nil #[nil "\300 \207" [text-mode] 1]] 9 (#$ . 8144) nil]) #@245 Assume the current region has org-mode syntax, and convert it to Github Flavored Markdown. This can be used in any buffer. For example, you can write an itemized list in org-mode syntax in a Markdown buffer and use this command to convert it. (defalias 'org-gfm-convert-region-to-md #[nil "\300\301!\207" [org-export-replace-region-by gfm] 2 (#$ . 9111) nil]) #@600 Export current buffer to a Github Flavored Markdown file. If narrowing is active in the current buffer, only export its narrowed part. If a region is active, export that region. A non-nil optional argument ASYNC means the process should happen asynchronously. The resulting file should be accessible through the `org-export-stack' interface. When optional argument SUBTREEP is non-nil, export the sub-tree at point, extracting information from the headline properties first. When optional argument VISIBLE-ONLY is non-nil, don't export contents of hidden elements. Return output file's name. (defalias 'org-gfm-export-to-markdown #[(&optional async subtreep visible-only) "\304\305\"\306\307 \n %)\207" [subtreep outfile async visible-only org-export-output-file-name ".md" org-export-to-file gfm] 6 (#$ . 9479) nil]) #@206 Publish an org file to Markdown. FILENAME is the filename of the Org file to be published. PLIST is the property list for the given project. PUB-DIR is the publishing directory. Return output file name. (defalias 'org-gfm-publish-to-gfm #[(plist filename pub-dir) "\303\304\305 \n%\207" [filename plist pub-dir org-publish-org-to gfm ".md"] 6 (#$ . 10314)]) (provide 'ox-gfm)