diff --git a/quarto-mode.el b/quarto-mode.el index 3fd8e80..aff987d 100644 --- a/quarto-mode.el +++ b/quarto-mode.el @@ -68,7 +68,7 @@ ;;; Customizable variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defgroup quarto nil - "Settings for the quarto polymode" + "Settings for the quarto polymode." :group 'polymode) (defcustom quarto-root-polymode @@ -90,11 +90,13 @@ ("html" "html" "html document" "html") ("pdf" "pdf" "pdf document" "pdf") ("word" "docx" "word document" "docx") - ("revealjs" "html" "revealjs presentation" "revealjs"))) ;; TODO fill this out automatically + ("revealjs" "html" "revealjs presentation" "revealjs"))) + ;; TODO fill this out automatically "Quarto Markdown exporter. Please note that with 'AUTO DETECT' export options, output file names are inferred by quarto from the appropriate metadata. -That is, output file names don't comply with `polymode-exporter-output-file-format'." +That is, output file names do not comply with +`polymode-exporter-output-file-format'." :group 'polymode-export :type 'object) @@ -107,8 +109,8 @@ That is, output file names don't comply with `polymode-exporter-output-file-form :type 'boolean) (defcustom quarto-force-preview t - "When t, all markdown rendering commands go through quarto-preview instead of producing -disk output." + "Non-nil means markdown rendering commands go through `quarto-preview'. +Otherwise generate disk output." :group 'quarto :type 'boolean) @@ -152,7 +154,8 @@ disk output." (reverse result))) (defun quarto-mode--buffer-in-quarto-project-p () - "Return the full filename of the _quarto.yml project configuration for the present buffer or nil if none is found." + "Return full filename of _quarto.yml project configuration for present buffer. +Otherwise, return nil if none is found." (locate-dominating-file buffer-file-name "_quarto.yml")) (defvar quarto-mode--preview-process nil) @@ -169,7 +172,8 @@ disk output." (url-generic-parse-url (match-string 1 line))))))) (defun quarto-mode--process-filter (proc string) - "Filter the output generated by a `quarto-preview' process. This is a process filter operating on process PROC and input STRING." + "Filter the output generated by a `quarto-preview' process. +This is a process filter operating on process PROC and input STRING." (with-current-buffer (get-buffer "*quarto-preview*") (let ((prev-lines (count-lines (point-min) (point-max)))) (comint-output-filter proc string) @@ -189,8 +193,7 @@ disk output." (defconst quarto-mode--quarto-preview-uuid "5E89DF46-0E7B-4604-A76A-58EC4E12A11B") (defun quarto-preview () - "Start (or restart) a quarto preview process to automatically -rerender documents. + "Start (or restart) a quarto preview process to rerender documents. `quarto-preview` checks parent directories for a `_quarto.yml` file. If one is found, then `quarto-preview` previews that entire @@ -234,7 +237,7 @@ To control whether or not to show the display, customize (easy-menu-define quarto-menu (list poly-quarto-mode-map) - "Menu for quarto-mode" + "Menu for quarto-mode." '("Quarto" ["Start Preview" quarto-preview t])) @@ -243,14 +246,17 @@ To control whether or not to show the display, customize (cl-defun quarto-mode--preview-refresh-complete (&key data response symbol-status error-thrown) - "Refresh quarto-preview when the status code of the rerender request is not 200. + "Refresh `quarto-preview' unless status code of rerender request is 200. -This is an internal function." +This is an internal function. RESPONSE is used to determine status code. +DATA, SYMBOL-STATUS and ERROR-THROWN are ignored." (unless (= (request-response-status-code response) 200) (quarto-preview))) (defun quarto-mode--maybe-preview (name) - "Call `quarto-preview' with filename NAME when needed. In that case, errors intentionally to avoid `markdown-command' from finishing." + "Call `quarto-preview' with filename NAME when needed. +In that case, errors intentionally to avoid `markdown-command' +from finishing." (with-current-buffer (get-file-buffer name) (let* ((this-project-directory (quarto-mode--buffer-in-quarto-project-p))) @@ -279,9 +285,11 @@ This is an internal function." (error "Refreshing %s in quarto-preview" name)))))))) (defun quarto-mode-markdown-command (begin-region end-region buf name) - "Call quarto, typically from inside `markdown`. + "Call quarto, typically from inside `markdown'. -Ensure quarto has rendered NAME (necessary if in a project). If not in a project, render the region given by BEGIN-REGION and END-REGION, and insert the output of `quarto render` in BUF." +Ensure quarto has rendered NAME (necessary if in a project). If +not in a project, render the region given by BEGIN-REGION and +END-REGION, and insert the output of `quarto render` in BUF." ;; This handles previews (it all goes through quarto-preview instead of render) (quarto-mode--maybe-preview name)