Function: hywiki-get-page-file

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

Signature

(hywiki-get-page-file FILE-STEM-NAME)

Documentation

Return possibly non-existent hywiki-directory path from FILE-STEM-NAME.

FILE-STEM-NAME may be an existing absolute file path; then, return it. Otherwise, FILE-STEM-NAME should not contain a directory and may have or may omit hywiki-file-suffix and an optional trailing #section.

Checks only that FILE-STEM-NAME is not nil, not an empty string and does not contain a directory path or returns nil.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hywiki.el
(defun hywiki-get-page-file (file-stem-name)
  "Return possibly non-existent `hywiki-directory' path from FILE-STEM-NAME.
FILE-STEM-NAME may be an existing absolute file path; then, return it.
Otherwise, FILE-STEM-NAME should not contain a directory and may have or may
omit `hywiki-file-suffix' and an optional trailing #section.

Checks only that FILE-STEM-NAME is not nil, not an empty string and does
not contain a directory path or returns nil."
  (make-directory hywiki-directory t)
  (if (and (stringp file-stem-name) (file-readable-p file-stem-name))
      file-stem-name
    (unless (or (null file-stem-name) (string-empty-p file-stem-name)
                (file-name-directory file-stem-name))
      (let (file-name
	    section)
        ;; Remove any suffix from `file-stem-name' and make it singular
        (if (string-match hywiki-word-suffix-regexp file-stem-name)
	    (setq section (match-string 0 file-stem-name)
		  file-name (hywiki-get-singular-wikiword
			     (substring file-stem-name 0 (match-beginning 0))))
	  (setq file-name file-stem-name))
        (concat (expand-file-name file-name hywiki-directory)
                (unless (string-suffix-p hywiki-file-suffix file-name)
		  hywiki-file-suffix)
                section)))))