From 130815ce0c0b3eac9707114b0ed5080f3941802c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sat, 2 Jan 2021 23:15:49 -0600 Subject: Get rid of “Useful HTML Anchors” section It clobbered all my org-mode stuff!! --- config.org | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'config.org') diff --git a/config.org b/config.org index 93e136d..65dc47a 100644 --- a/config.org +++ b/config.org @@ -1488,47 +1488,6 @@ I’ve put org mode under Applications, as opposed to Writing, because it’s m (add-hook 'emacs-lisp-mode-hook #'org-link-minor-mode) #+end_src -*** Useful HTML Anchors - - #+begin_src emacs-lisp - (defun my/ensure-headline-ids (&rest _) - "Ensure better headlines for Org trees. - - Use CUSTOM_ID property, or barring that, a \"fixed\" title. - - All non-alphanumeric characters are cleverly replaced with ‘-’. - - If multiple trees end-up with the same id property, issue a - message and undo any property insertion thus far. - - E.g., ↯ We'll go on a ∀∃⇅ adventure - ↦ We'll-go-on-a-adventure - " - (interactive) - (let ((ids)) - (org-map-entries - (lambda () - (org-with-point-at (point) - (let ((id (org-entry-get nil "CUSTOM_ID"))) - (unless id - (thread-last (nth 4 (org-heading-components)) - (s-replace-regexp "[^[:alnum:]']" "-") - (s-replace-regexp "-+" "-") - (s-chop-prefix "-") - (s-chop-suffix "-") - (setq id)) - (if (not (member id ids)) - (push id ids) - (message-box "Oh no, a repeated id!\n\n\t%s" id) - (undo) - (setq quit-flag t)) - (org-entry-put nil "CUSTOM_ID" id)))))))) - - ;; Whenever html & md export happens, ensure we have headline ids. - (advice-add 'org-html-export-to-html :before 'my/ensure-headline-ids) - (advice-add 'org-md-export-to-markdown :before 'my/ensure-headline-ids) - #+end_src - ** Git #+begin_src emacs-lisp -- cgit 1.4.1-21-gabe81