End first line of each docstring with a period

The convention calls for the first line to form a complete sentence.
Here we can achieve that in most cases simply by not beginning the
second sentence on the first line.
This commit is contained in:
Jonas Bernoulli 2023-06-26 14:27:56 +02:00
parent 4eaf2adf29
commit 1bfc320f94
No known key found for this signature in database
GPG Key ID: 230C2EFBB326D927

View File

@ -83,8 +83,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))
@ -114,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. Width of a column
inquerying `width-cookies' in the column, or by the maximum cell with in is determined either by inquerying `width-cookies' in the column,
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)
@ -147,8 +147,8 @@ the column."
(puthash column max-width width-cookies)))))) (puthash column max-width width-cookies))))))
(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)
@ -158,8 +158,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))
@ -175,9 +176,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. INFO is a plist used as a
channel." 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.
@ -226,8 +227,7 @@ 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."
(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)))
@ -311,10 +311,11 @@ 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 "Convert the region to Github Flavored Markdown.
to Github Flavored Markdown. This can be used in any buffer. This can be used in any buffer, this function assume that the
For example, you can write an itemized list in org-mode syntax in current region has org-mode syntax. For example, you can write
a Markdown buffer and use this command to convert it." an itemized list in org-mode syntax in a Markdown buffer and use
this command to convert it."
(interactive) (interactive)
(org-export-replace-region-by 'gfm)) (org-export-replace-region-by 'gfm))