Function: org-md--headline-title
org-md--headline-title is a byte-compiled function defined in
ox-md.el.gz.
Signature
(org-md--headline-title STYLE LEVEL TITLE &optional ANCHOR TAGS)
Documentation
Generate a headline title in the preferred Markdown headline style.
STYLE is the preferred style (atx or setext). LEVEL is the
header level. TITLE is the headline title. ANCHOR is the HTML
anchor tag for the section as a string. TAGS are the tags set on
the section.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox-md.el.gz
(defun org-md--headline-title (style level title &optional anchor tags)
"Generate a headline title in the preferred Markdown headline style.
STYLE is the preferred style (`atx' or `setext'). LEVEL is the
header level. TITLE is the headline title. ANCHOR is the HTML
anchor tag for the section as a string. TAGS are the tags set on
the section."
(let ((anchor-lines (and anchor (concat anchor "\n\n"))))
;; Use "Setext" style
(if (and (eq style 'setext) (< level 3))
(let* ((underline-char (if (= level 1) ?= ?-))
(underline (concat (make-string (length title) underline-char)
"\n")))
(concat "\n" anchor-lines title tags "\n" underline "\n"))
;; Use "Atx" style
(let ((level-mark (make-string level ?#)))
(concat "\n" anchor-lines level-mark " " title tags "\n\n")))))