From 131261c783e9a2f9a6342f7e341d5c263ce33c2d Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Tue, 31 Mar 2026 02:23:16 -0700 Subject: fix website build; add new content --- tests/ci-build-stage-two.el | 98 ++++++++++++++++++++++++++++++++++++++++++--- tests/ci-build.el | 16 +++++++- tests/ci-runner.el | 13 ++---- 3 files changed, 111 insertions(+), 16 deletions(-) (limited to 'tests') diff --git a/tests/ci-build-stage-two.el b/tests/ci-build-stage-two.el index aca425d..1b58af4 100644 --- a/tests/ci-build-stage-two.el +++ b/tests/ci-build-stage-two.el @@ -16,6 +16,7 @@ (setq org-html-link-org-files-as-html t) (require (quote htmlize)) +(require 'hl-line) (require (quote nix-mode)) (setq org-html-htmlize-output-type (quote css)) @@ -24,14 +25,22 @@ (defun my-ci-force-fontification () "Ensure the buffer is fully colorized before htmlize touches it." - (font-lock-ensure) - (font-lock-flush) - (font-lock-ensure)) + ;; Do NOT try to syntax-highlight the Frankenstein RSS file + (unless (string-match-p "rss\\.org$" (buffer-file-name)) + (font-lock-ensure))) + +(princ "after ci force fontification\n" (quote external-debugging-output)) +(princ "C\n" 'external-debugging-output) (add-hook 'org-publish-before-export-hook #'my-ci-force-fontification) +(princ "C\n" 'external-debugging-output) + +(princ "please work\n" (quote external-debugging-output)) (face-spec-recalc 'default (selected-frame)) -(when (fboundp 'redisplay) (redisplay t)) +(princ "please work part 2\n" (quote external-debugging-output)) +;; (when (fboundp 'redisplay) (redisplay t)) +(princ "please work part 3\n" (quote external-debugging-output)) (princ (format "THEME CHECK - Default background: %s\n" (face-attribute 'default :background)) @@ -39,5 +48,84 @@ (princ "STEP 6: before publish-all\n" (quote external-debugging-output)) +(setq treesit-auto-install nil) + +;; --- DUMP LOG BUFFERS --- +(let ((warnings-buf (get-buffer "*Warnings*")) + (messages-buf (get-buffer "*Messages*"))) + + (princ "\n========================================\n" 'external-debugging-output) + + ;; 1. Dump Warnings + (if warnings-buf + (with-current-buffer warnings-buf + (princ " DUMPING *Warnings* BUFFER \n" 'external-debugging-output) + (princ "----------------------------------------\n" 'external-debugging-output) + (princ (buffer-string) 'external-debugging-output)) + (princ " No *Warnings* buffer found. \n" 'external-debugging-output)) + + (princ "\n========================================\n" 'external-debugging-output) + + ;; 2. Dump Messages + (if messages-buf + (with-current-buffer messages-buf + (princ " DUMPING *Messages* BUFFER \n" 'external-debugging-output) + (princ "----------------------------------------\n" 'external-debugging-output) + (princ (buffer-string) 'external-debugging-output)) + (princ " No *Messages* buffer found. \n" 'external-debugging-output)) + + (princ "========================================\n\n" 'external-debugging-output)) +;; ---------------------------- + +(require 'pp) ; Pull in the pretty-printer + +(princ "\n========================================\n" 'external-debugging-output) +(princ " DUMPING org-publish-project-alist \n" 'external-debugging-output) +(princ "----------------------------------------\n" 'external-debugging-output) + +;; pp-to-string formats the nested list with proper indentation and line breaks +(princ (pp-to-string org-publish-project-alist) 'external-debugging-output) + +(princ "\n========================================\n\n" 'external-debugging-output) +(setq org-export-use-babel nil) + +(advice-add 'org-publish-file :before + (lambda (file &rest _) + (princ (format "-> Exporting file: %s\n" file) 'external-debugging-output))) + +(advice-add 'org-publish-find-title :before + (lambda (file &rest _) + (princ (format "-> Extracting title for sitemap: %s\n" file) 'external-debugging-output))) + +(advice-add 'org-publish-file :after + (lambda (file &rest _) + (princ (format "<- Finished file: %s\n" file) 'external-debugging-output))) + +(defvar my-sitemap-counter 0) +(advice-add 'org-sitemap-format-entry-xml :before + (lambda (entry &rest _) + (setq my-sitemap-counter (1+ my-sitemap-counter)) + (when (= 0 (mod my-sitemap-counter 20)) + (princ (format " [Sitemap XML] Processed %d files... Current: %s\n" + my-sitemap-counter entry) + 'external-debugging-output)))) + +(advice-add 'org-rss-publish-to-rss :around + (lambda (fn plist filename pub-dir) + (princ (format "[rss] enter %s\n" filename) 'external-debugging-output) + (prog1 (funcall fn plist filename pub-dir) + (princ (format "[rss] leave %s\n" filename) 'external-debugging-output)))) + +(advice-add 'org-icalendar-create-uid :before + (lambda (&rest _) (princ "[rss] before uid\n" 'external-debugging-output))) + +(advice-add 'org-rss-add-pubdate-property :before + (lambda (&rest _) (princ "[rss] before pubdate\n" 'external-debugging-output))) + +(advice-add 'write-file :before + (lambda (&rest _) (princ "[rss] before write-file\n" 'external-debugging-output))) + +(advice-add 'org-export-to-file :before + (lambda (&rest _) (princ "[rss] before org-export-to-file\n" 'external-debugging-output))) + (org-publish-all t) -(org-publish-all nil) diff --git a/tests/ci-build.el b/tests/ci-build.el index 68d8670..02827d8 100644 --- a/tests/ci-build.el +++ b/tests/ci-build.el @@ -1,9 +1,17 @@ +(setq debug-on-error t) (setq inhibit-startup-screen t) (setq inhibit-startup-message t) (setq enable-local-variables :all) -(defalias (quote yes-or-no-p) (lambda (&rest args) t)) -(defalias (quote y-or-n-p) (lambda (&rest args) t)) +(defalias 'yes-or-no-p + (lambda (prompt &rest args) + (princ (format "!!! EMACS PROMPTED YES/NO: %s\n" prompt) 'external-debugging-output) + t)) + +(defalias 'y-or-n-p + (lambda (prompt &rest args) + (princ (format "!!! EMACS PROMPTED Y/N: %s\n" prompt) 'external-debugging-output) + t)) (setq message-log-max t) (setq standard-output (quote external-debugging-output)) @@ -15,6 +23,7 @@ (setq system-username "ci-runner") (setq system-fullname "Preston Pan") ;; needed for postamble (setq system-gpgkey "00000000") +(setq logo-file "~/monorepo/img/logo.webp") (defun package-vc-install (&rest args) (message "blocked package-vc-install for %s" args)) (defun package-vc--unpack (&rest args) nil) (setq package-archives nil) @@ -41,6 +50,9 @@ (setq make-backup-files nil auto-save-default nil create-lockfiles nil) (require 'catppuccin-theme) +(add-to-list 'custom-theme-load-path + (file-name-directory (locate-library "catppuccin-theme"))) + (setq catppuccin-flavor 'mocha) (load-theme 'catppuccin t) diff --git a/tests/ci-runner.el b/tests/ci-runner.el index 5b3397f..7f41a0d 100644 --- a/tests/ci-runner.el +++ b/tests/ci-runner.el @@ -1,9 +1,4 @@ -(condition-case err - (progn - (load-file (expand-file-name "tests/ci-build.el" default-directory)) - (load-file (expand-file-name "init.el" (getenv "NIXMACS_DIR"))) - (load-file (expand-file-name "tests/ci-build-stage-two.el" default-directory)) - (kill-emacs 0)) - (error - (princ (format "\nFATAL CI ERROR: %s\n" (error-message-string err)) 'external-debugging-output) - (kill-emacs 1))) +;; ci-runner.el +(load-file (expand-file-name "tests/ci-build.el" default-directory)) +(load-file (expand-file-name "init.el" (getenv "NIXMACS_DIR"))) +(load-file (expand-file-name "tests/ci-build-stage-two.el" default-directory)) -- cgit v1.3