mirror of
https://github.com/larstvei/ox-gfm.git
synced 2024-11-26 09:38:31 +00:00
change uncommon prefix variable name
This commit is contained in:
parent
1f65b90f67
commit
89ee762af4
44
ox-gfm.el
44
ox-gfm.el
@ -106,28 +106,28 @@ holding contextual information."
|
|||||||
|
|
||||||
;;;; Table-Common
|
;;;; Table-Common
|
||||||
|
|
||||||
(defvar width-cookies nil)
|
(defvar org-gfm-width-cookies nil)
|
||||||
(defvar width-cookies-table nil)
|
(defvar org-gfm-width-cookies-table nil)
|
||||||
|
|
||||||
(defconst gfm-table-left-border "|")
|
(defconst org-gfm-table-left-border "|")
|
||||||
(defconst gfm-table-right-border " |")
|
(defconst org-gfm-table-right-border " |")
|
||||||
(defconst gfm-table-separator " |")
|
(defconst org-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.
|
"Return width of TABLE at given COLUMN.
|
||||||
INFO is a plist used as communication channel.
|
INFO is a plist used as communication channel.
|
||||||
Width of a column is determined either by inquerying `width-cookies'
|
Width of a column is determined either by inquerying `org-gfm-width-cookies'
|
||||||
in the column, or by the maximum cell with in 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 org-gfm-width-cookies)
|
||||||
(gethash column width-cookies))))
|
(gethash column org-gfm-width-cookies))))
|
||||||
(if (and (eq table width-cookies-table)
|
(if (and (eq table org-gfm-width-cookies-table)
|
||||||
(not (eq nil cookie)))
|
(not (eq nil cookie)))
|
||||||
cookie
|
cookie
|
||||||
(progn
|
(progn
|
||||||
(unless (and (eq table width-cookies-table)
|
(unless (and (eq table org-gfm-width-cookies-table)
|
||||||
(hash-table-p width-cookies))
|
(hash-table-p org-gfm-width-cookies))
|
||||||
(setq width-cookies (make-hash-table))
|
(setq org-gfm-width-cookies (make-hash-table))
|
||||||
(setq width-cookies-table table))
|
(setq org-gfm-width-cookies-table table))
|
||||||
(let ((max-width 0)
|
(let ((max-width 0)
|
||||||
(specialp (org-export-table-has-special-column-p table)))
|
(specialp (org-export-table-has-special-column-p table)))
|
||||||
(org-element-map
|
(org-element-map
|
||||||
@ -144,7 +144,7 @@ in the column, or by the maximum cell with in the column."
|
|||||||
info))
|
info))
|
||||||
max-width)))
|
max-width)))
|
||||||
info)
|
info)
|
||||||
(puthash column max-width width-cookies))))))
|
(puthash column max-width org-gfm-width-cookies))))))
|
||||||
|
|
||||||
|
|
||||||
(defun org-gfm-make-hline-builder (table info char)
|
(defun org-gfm-make-hline-builder (table info char)
|
||||||
@ -193,11 +193,11 @@ INFO is a plist used as a communication channel."
|
|||||||
(build-rule (org-gfm-make-hline-builder table info ?-))
|
(build-rule (org-gfm-make-hline-builder table info ?-))
|
||||||
(cols (cdr (org-export-table-dimensions table info))))
|
(cols (cdr (org-export-table-dimensions table info))))
|
||||||
(setq contents
|
(setq contents
|
||||||
(concat gfm-table-left-border
|
(concat org-gfm-table-left-border
|
||||||
(mapconcat (lambda (col) (funcall build-rule col))
|
(mapconcat (lambda (col) (funcall build-rule col))
|
||||||
(number-sequence 0 (- cols 1))
|
(number-sequence 0 (- cols 1))
|
||||||
gfm-table-separator)
|
org-gfm-table-separator)
|
||||||
gfm-table-right-border))))
|
org-gfm-table-right-border))))
|
||||||
contents))
|
contents))
|
||||||
|
|
||||||
|
|
||||||
@ -217,15 +217,15 @@ INFO is a plist holding contextual information."
|
|||||||
(let ((build-empty-cell (org-gfm-make-hline-builder table info ?\s))
|
(let ((build-empty-cell (org-gfm-make-hline-builder table info ?\s))
|
||||||
(build-rule (org-gfm-make-hline-builder table info ?-))
|
(build-rule (org-gfm-make-hline-builder table info ?-))
|
||||||
(columns (number-sequence 0 (- cols 1))))
|
(columns (number-sequence 0 (- cols 1))))
|
||||||
(concat gfm-table-left-border
|
(concat org-gfm-table-left-border
|
||||||
(mapconcat (lambda (col) (funcall build-empty-cell col))
|
(mapconcat (lambda (col) (funcall build-empty-cell col))
|
||||||
columns
|
columns
|
||||||
gfm-table-separator)
|
org-gfm-table-separator)
|
||||||
gfm-table-right-border "\n" gfm-table-left-border
|
org-gfm-table-right-border "\n" org-gfm-table-left-border
|
||||||
(mapconcat (lambda (col) (funcall build-rule col))
|
(mapconcat (lambda (col) (funcall build-rule col))
|
||||||
columns
|
columns
|
||||||
gfm-table-separator)
|
org-gfm-table-separator)
|
||||||
gfm-table-right-border "\n"))))))
|
org-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))))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user