This commit is contained in:
Chris Cochrun 2026-03-31 09:49:05 -05:00
parent ed6cbb3805
commit 35b8a04810
3 changed files with 35 additions and 30 deletions

View file

@ -4044,7 +4044,8 @@ Let's give eglot a try.
#+begin_src emacs-lisp
(use-package eldoc-box
:config
(add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t))
(add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t)
(remove-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode))
#+end_src
*** CMAKE

View file

@ -2961,7 +2961,8 @@ current buffer's, reload dir-locals."
(use-package eldoc-box
:config
(add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t))
(add-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode t)
(remove-hook 'eglot-managed-mode-hook #'eldoc-box-hover-mode))
(use-package cmake-mode
:mode ("\\CMakeLists.txt\\'" . cmake-mode))

View file

@ -150,27 +150,15 @@
(defun quick/org-copy-notes (plist)
(let ((files (--remove
(string-match-p (plist-get plist :exclude) it)
(directory-files "~/docs/notes" t ".*.org$"))))
(directory-files (file-name-as-directory
(plist-get plist :denote-directory)) t ".*.org$")))
(create-lockfiles nil))
(dolist (file files)
(let ((filename (concat (file-name-as-directory
(plist-get plist :base-directory))
(f-filename file))))
(copy-file
file filename t t))))
(chris/site-index-update plist))
(defun quick/org-copy-lessons (plist)
(let ((files (--remove
(string-match-p (plist-get plist :exclude) it)
(directory-files "~/docs/notes/lessons" t ".*.org$"))))
(dolist (file files)
(let ((filename (concat (file-name-as-directory
(plist-get plist :base-directory))
(f-filename file))))
(copy-file
file filename t t))))
(chris/site-index-update plist))
file filename t t)))))
(defun chris/site-index-update (plist)
(save-excursion
@ -183,6 +171,17 @@
(denote-org-convert-links-to-file-type)
(save-buffer))))
(defun chris/preparation-function (plist)
(quick/org-copy-notes plist)
(chris/site-index-update plist))
(defun chris/ignore-export-name-filter-function (plist _backend)
(when (plist-member plist :export-file-name)
(let ((name (plist-get plist :export-file-name))
(key-gone (remove :export-file-name))
(new-plist (remove name)))
new-plist)))
(defun chris/site-premble (plist)
(let ((project (plist-get plist :title-of-project)))
(format "<nav>
@ -200,10 +199,12 @@
(setq org-publish-project-alist
`(("notes"
:denote-directory "~/docs/notes/"
:base-directory "~/docs/site/content/notes/"
:base-extension "org"
:publishing-directory "~/docs/site/public/notes/"
:exclude "\\(_draft\\|_lesson\\|_sermon\\)"
:preparation-function quick/org-copy-notes
:preparation-function chris/preparation-function
:recursive nil
:with-toc t
:with-broken-links t
@ -229,13 +230,14 @@
</ul>
</nav>"))
:html-head "<link rel=\"stylesheet\" href=\"../static/pico.snazzy.css\" type=\"text/css\"/>"
:publishing-directory "~/docs/site/public/notes/"
:publishing-function org-html-publish-to-html)
("teaching"
:denote-directory "~/docs/notes/lessons/"
:base-directory "~/docs/site/content/teaching/"
:base-extension "org"
:preparation-function quick/org-copy-lessons
:publishing-directory "~/docs/site/public/teaching/"
:exclude "_draft"
:preparation-function chris/preparation-function
:recursive nil
:with-broken-links t
:with-author nil
@ -260,7 +262,6 @@
</ul>
</nav>"))
:html-head "<link rel=\"stylesheet\" href=\"../static/pico.snazzy.css\" type=\"text/css\"/>"
:publishing-directory "~/docs/site/public/teaching/"
:publishing-function org-html-publish-to-html)
("static"
:base-directory "~/docs/site/assets/"
@ -341,14 +342,14 @@ it will use the correct amount of "
(org-publish-property :base-directory project)))
(attachment-function? (eq #'org-publish-attachment
(org-publish-property :publishing-function project)))
(org-export-filter-options-functions '(#'chris/ignore-export-name-filter-function))
(workers (if workers workers
(* 2 (comp--effective-async-max-jobs))))
(files (org-publish-get-base-files project))
(chunks (if (> workers (length files))
files
(seq-split files (ceiling (/ (length files) workers)))))
(futures (if attachment-function?
nil
(futures (unless attachment-function?
(cl-loop for chunk in chunks
collect (async-start
`(lambda ()
@ -361,19 +362,23 @@ it will use the correct amount of "
(create-lockfiles nil)
(org-publish-cache (org-publish-initialize-cache
(car ',project)))
(org-export-filter-options-functions ',org-export-filter-options-functions)
(files (if (listp ',chunk)
',chunk
(list ,chunk))))
(dolist (file files)
(unless (file-equal-p file ,theindex)
(org-publish-file file ',project t)))))
'ignore)))))
(org-publish-file file ',project))))))))))
(message "=========================")
(message "Starting project: %s" (car project))
(message "=========================")
(when attachment-function? (message "OOOOPS AATTTTAAAACH"))
(if attachment-function?
(dolist (file files)
(unless (file-equal-p file theindex)
(org-publish-file file project t)))
(mapcar #'async-get futures))
(mapcar #'async-wait futures))
;; Populate "theindex.inc", if needed, and publish
;; "theindex.org".
@ -428,6 +433,4 @@ on your machine as makes sense."
(quick/org-publish "cochrun.xyz" nil t)
(let ((httpd-root "~/docs/site/public")
(httpd-host "localhost"))
(httpd-serve-directory "~/docs/site/public"))
(httpd-serve-directory "~/docs/site/public")