mirror of
https://github.com/larstvei/ox-gfm.git
synced 2024-11-26 09:38:31 +00:00
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:
parent
4eaf2adf29
commit
1bfc320f94
39
ox-gfm.el
39
ox-gfm.el
@ -83,8 +83,8 @@ communication channel."
|
||||
;;;; Src Block
|
||||
|
||||
(defun org-gfm-src-block (src-block contents info)
|
||||
"Transcode SRC-BLOCK element into Github Flavored Markdown
|
||||
format. CONTENTS is nil. INFO is a plist used as a communication
|
||||
"Transcode SRC-BLOCK element into Github Flavored Markdown format.
|
||||
CONTENTS is nil. INFO is a plist used as a communication
|
||||
channel."
|
||||
(let* ((lang (org-element-property :language src-block))
|
||||
(code (org-export-format-code-default src-block info))
|
||||
@ -114,10 +114,10 @@ holding contextual information."
|
||||
(defconst gfm-table-separator " |")
|
||||
|
||||
(defun org-gfm-table-col-width (table column info)
|
||||
"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."
|
||||
"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."
|
||||
(let ((cookie (when (hash-table-p width-cookies)
|
||||
(gethash column width-cookies))))
|
||||
(if (and (eq table width-cookies-table)
|
||||
@ -147,8 +147,8 @@ the column."
|
||||
(puthash column max-width width-cookies))))))
|
||||
|
||||
(defun org-gfm-make-hline-builder (table info char)
|
||||
"Return a function to build horizontal line in TABLE with given
|
||||
CHAR. INFO is a plist used as a communication channel."
|
||||
"Return a function to build horizontal line in TABLE with given CHAR.
|
||||
INFO is a plist used as a communication channel."
|
||||
`(lambda (col)
|
||||
(let ((max-width (max 3 (org-gfm-table-col-width table col info))))
|
||||
(when (< max-width 1)
|
||||
@ -158,8 +158,9 @@ CHAR. INFO is a plist used as a communication channel."
|
||||
;;;; Table-Cell
|
||||
|
||||
(defun org-gfm-table-cell (table-cell contents info)
|
||||
"Transcode TABLE-CELL element from Org into GFM. CONTENTS is content
|
||||
of the cell. INFO is a plist used as a communication channel."
|
||||
"Transcode TABLE-CELL element from Org into GFM.
|
||||
CONTENTS is content of the cell. INFO is a plist used as a
|
||||
communication channel."
|
||||
(let* ((table (org-export-get-parent-table table-cell))
|
||||
(column (cdr (org-export-table-cell-address table-cell 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
|
||||
|
||||
(defun org-gfm-table-row (table-row contents info)
|
||||
"Transcode TABLE-ROW element from Org into GFM. CONTENTS is cell
|
||||
contents of TABLE-ROW. INFO is a plist used as a communication
|
||||
channel."
|
||||
"Transcode TABLE-ROW element from Org into GFM.
|
||||
CONTENTS is cell contents of TABLE-ROW. INFO is a plist used as a
|
||||
communication channel."
|
||||
(let ((table (org-export-get-parent-table table-row)))
|
||||
(when (and (eq 'rule (org-element-property :type table-row))
|
||||
;; In GFM, rule is valid only at second row.
|
||||
@ -226,8 +227,7 @@ contextual information."
|
||||
;;;; Table of contents
|
||||
|
||||
(defun org-gfm-format-toc (headline)
|
||||
"Return an appropriate table of contents entry for HEADLINE. INFO is a
|
||||
plist used as a communication channel."
|
||||
"Return an appropriate table of contents entry for HEADLINE."
|
||||
(let* ((title (org-export-data
|
||||
(org-export-get-alt-title headline info) info))
|
||||
(level (1- (org-element-property :level headline)))
|
||||
@ -311,10 +311,11 @@ non-nil."
|
||||
|
||||
;;;###autoload
|
||||
(defun org-gfm-convert-region-to-md ()
|
||||
"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."
|
||||
"Convert the region to Github Flavored Markdown.
|
||||
This can be used in any buffer, this function assume that the
|
||||
current region has org-mode syntax. For example, you can write
|
||||
an itemized list in org-mode syntax in a Markdown buffer and use
|
||||
this command to convert it."
|
||||
(interactive)
|
||||
(org-export-replace-region-by 'gfm))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user