fix function documentation error

This commit is contained in:
Naoya Yamashita 2020-09-03 11:13:59 +09:00
parent f9910546d6
commit 1f65b90f67
No known key found for this signature in database
GPG Key ID: F4B6A5A98EB01936

View File

@ -86,9 +86,8 @@ communication channel."
;;;; Src Block ;;;; Src Block
(defun org-gfm-src-block (src-block contents info) (defun org-gfm-src-block (src-block contents info)
"Transcode SRC-BLOCK element into Github Flavored Markdown "Transcode SRC-BLOCK element into Github Flavored Markdown format.
format. CONTENTS is nil. INFO is a plist used as a communication CONTENTS is nil. INFO is a plist used as a communication channel."
channel."
(let* ((lang (org-element-property :language src-block)) (let* ((lang (org-element-property :language src-block))
(code (org-export-format-code-default src-block info)) (code (org-export-format-code-default src-block info))
(prefix (concat "```" lang "\n")) (prefix (concat "```" lang "\n"))
@ -115,10 +114,10 @@ holding contextual information."
(defconst gfm-table-separator " |") (defconst gfm-table-separator " |")
(defun org-gfm-table-col-width (table column info) (defun org-gfm-table-col-width (table column info)
"Return width of TABLE at given COLUMN. INFO is a plist used as "Return width of TABLE at given COLUMN.
communication channel. Width of a column is determined either by INFO is a plist used as communication channel.
inquerying `width-cookies' in the column, or by the maximum cell with in Width of a column is determined either by inquerying `width-cookies'
the column." in the column, or by the maximum cell with in the column."
(let ((cookie (when (hash-table-p width-cookies) (let ((cookie (when (hash-table-p width-cookies)
(gethash column width-cookies)))) (gethash column width-cookies))))
(if (and (eq table width-cookies-table) (if (and (eq table width-cookies-table)
@ -149,8 +148,8 @@ the column."
(defun org-gfm-make-hline-builder (table info char) (defun org-gfm-make-hline-builder (table info char)
"Return a function to build horizontal line in TABLE with given "Return a function to build horizontal line in TABLE with given CHAR.
CHAR. INFO is a plist used as a communication channel." INFO is a plist used as a communication channel."
`(lambda (col) `(lambda (col)
(let ((max-width (max 3 (org-gfm-table-col-width table col info)))) (let ((max-width (max 3 (org-gfm-table-col-width table col info))))
(when (< max-width 1) (when (< max-width 1)
@ -161,8 +160,9 @@ CHAR. INFO is a plist used as a communication channel."
;;;; Table-Cell ;;;; Table-Cell
(defun org-gfm-table-cell (table-cell contents info) (defun org-gfm-table-cell (table-cell contents info)
"Transcode TABLE-CELL element from Org into GFM. CONTENTS is content "Transcode TABLE-CELL element from Org into GFM.
of the cell. INFO is a plist used as a communication channel." CONTENTS is content of the cell.
INFO is a plist used as a communication channel."
(let* ((table (org-export-get-parent-table table-cell)) (let* ((table (org-export-get-parent-table table-cell))
(column (cdr (org-export-table-cell-address table-cell info))) (column (cdr (org-export-table-cell-address table-cell info)))
(width (org-gfm-table-col-width table column info)) (width (org-gfm-table-col-width table column info))
@ -179,9 +179,9 @@ of the cell. INFO is a plist used as a communication channel."
;;;; Table-Row ;;;; Table-Row
(defun org-gfm-table-row (table-row contents info) (defun org-gfm-table-row (table-row contents info)
"Transcode TABLE-ROW element from Org into GFM. CONTENTS is cell "Transcode TABLE-ROW element from Org into GFM.
contents of TABLE-ROW. INFO is a plist used as a communication CONTENTS is cell contents of TABLE-ROW.
channel." INFO is a plist used as a communication channel."
(let ((table (org-export-get-parent-table table-row))) (let ((table (org-export-get-parent-table table-row)))
(when (and (eq 'rule (org-element-property :type table-row)) (when (and (eq 'rule (org-element-property :type table-row))
;; In GFM, rule is valid only at second row. ;; In GFM, rule is valid only at second row.
@ -206,8 +206,8 @@ channel."
(defun org-gfm-table (table contents info) (defun org-gfm-table (table contents info)
"Transcode TABLE element into Github Flavored Markdown table. "Transcode TABLE element into Github Flavored Markdown table.
CONTENTS is the contents of the table. INFO is a plist holding CONTENTS is the contents of the table.
contextual information." INFO is a plist holding contextual information."
(let* ((rows (org-element-map table 'table-row 'identity info)) (let* ((rows (org-element-map table 'table-row 'identity info))
(no-header (or (<= (length rows) 1))) (no-header (or (<= (length rows) 1)))
(cols (cdr (org-export-table-dimensions table info))) (cols (cdr (org-export-table-dimensions table info)))
@ -233,8 +233,8 @@ contextual information."
;;;; Table of contents ;;;; Table of contents
(defun org-gfm-format-toc (headline) (defun org-gfm-format-toc (headline)
"Return an appropriate table of contents entry for HEADLINE. INFO is a "Return an appropriate table of contents entry for HEADLINE.
plist used as a communication channel." INFO is a plist used as a communication channel."
(let* ((title (org-export-data (let* ((title (org-export-data
(org-export-get-alt-title headline info) info)) (org-export-get-alt-title headline info) info))
(level (1- (org-element-property :level headline))) (level (1- (org-element-property :level headline)))
@ -324,10 +324,10 @@ non-nil."
;;;###autoload ;;;###autoload
(defun org-gfm-convert-region-to-md () (defun org-gfm-convert-region-to-md ()
"Assume the current region has org-mode syntax, and convert it "Assume `org-mode' syntax, and convert it to Github Flavored Markdown.
to Github Flavored Markdown. This can be used in any buffer. This can be used in any buffer. For example, you can write an
For example, you can write an itemized list in org-mode syntax in itemized list in `org-mode' syntax in a Markdown buffer and use
a Markdown buffer and use this command to convert it." this command to convert it."
(interactive) (interactive)
(org-export-replace-region-by 'gfm)) (org-export-replace-region-by 'gfm))