Function: hywiki-get-page-headings

hywiki-get-page-headings is a byte-compiled function defined in hywiki.el.

Signature

(hywiki-get-page-headings PAGE)

Documentation

Return a list of all headings found in FILE.

Strip any leading '*' and space characters from the headings.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hywiki.el
(defun hywiki-get-page-headings (page)
  "Return a list of all headings found in FILE.
Strip any leading '*' and space characters from the headings."
  (when (and (stringp page) (file-readable-p page))
    (let ((grep-command (format "grep -E '^\\*+ ' %s" page)))
      (with-temp-buffer
        (shell-command grep-command (current-buffer))
        (goto-char (point-min))
        (let (headings)
          (while (re-search-forward "^\\*+ +\\(.*\\)$" nil t)
            (push (match-string-no-properties 1) headings))
          (nreverse headings))))))