forked from mirrors/org-mode
Use string width to center headline in ascii export.
This commit is contained in:
parent
a476426a73
commit
d915190dec
|
@ -2063,7 +2063,8 @@ underlined headlines. The default is 3."
|
||||||
(if org-export-with-toc
|
(if org-export-with-toc
|
||||||
(progn
|
(progn
|
||||||
(push (concat (nth 3 lang-words) "\n") thetoc)
|
(push (concat (nth 3 lang-words) "\n") thetoc)
|
||||||
(push (concat (make-string (length (nth 3 lang-words)) ?=) "\n") thetoc)
|
(push (concat (make-string (string-width (nth 3 lang-words)) ?=)
|
||||||
|
"\n") thetoc)
|
||||||
(mapc '(lambda (line)
|
(mapc '(lambda (line)
|
||||||
(if (string-match org-todo-line-regexp
|
(if (string-match org-todo-line-regexp
|
||||||
line)
|
line)
|
||||||
|
@ -2237,7 +2238,7 @@ underlined headlines. The default is 3."
|
||||||
|
|
||||||
(defun org-insert-centered (s &optional underline)
|
(defun org-insert-centered (s &optional underline)
|
||||||
"Insert the string S centered and underline it with character UNDERLINE."
|
"Insert the string S centered and underline it with character UNDERLINE."
|
||||||
(let ((ind (max (/ (- 80 (string-width s)) 2) 0)))
|
(let ((ind (max (/ (- fill-column (string-width s)) 2) 0)))
|
||||||
(insert (make-string ind ?\ ) s "\n")
|
(insert (make-string ind ?\ ) s "\n")
|
||||||
(if underline
|
(if underline
|
||||||
(insert (make-string ind ?\ )
|
(insert (make-string ind ?\ )
|
||||||
|
@ -3198,6 +3199,8 @@ lang=\"%s\" xml:lang=\"%s\">
|
||||||
(insert "<p class=\"date\"> "
|
(insert "<p class=\"date\"> "
|
||||||
(nth 2 lang-words) ": "
|
(nth 2 lang-words) ": "
|
||||||
date "</p>\n"))
|
date "</p>\n"))
|
||||||
|
(insert (format "<p>HTML generated by org-mode %s in emacs %s<\p>\n"
|
||||||
|
org-version emacs-major-version))
|
||||||
(insert "</div>"))
|
(insert "</div>"))
|
||||||
|
|
||||||
(if org-export-html-with-timestamp
|
(if org-export-html-with-timestamp
|
||||||
|
|
Loading…
Reference in New Issue