rearrange org settings
This commit is contained in:
@@ -14,6 +14,16 @@
|
|||||||
|
|
||||||
;; * Overview of modes and commands
|
;; * Overview of modes and commands
|
||||||
;; --------------------------------
|
;; --------------------------------
|
||||||
|
;;
|
||||||
|
;; ** `org-appear'
|
||||||
|
;; ---------------
|
||||||
|
;; auto toogle entities, emphasis markers, links, subscripts and superscripts,
|
||||||
|
;; keywords
|
||||||
|
;; `org-appear-autoentities', `org-appear-autoemphasis', `org-appear-autolinks'
|
||||||
|
;; `org-appear-autosubmarkers', `org-appear-autokeywords'
|
||||||
|
;; and from `org': `org-pretty-entries', `org-hide-emphasis-markers',
|
||||||
|
;; `org-link-descriptive', `org-hidden-keywords'
|
||||||
|
;;
|
||||||
;; ** Export `ox-reveal'
|
;; ** Export `ox-reveal'
|
||||||
;; ---------------------
|
;; ---------------------
|
||||||
;; (org-export-get-all-options 'reveal)
|
;; (org-export-get-all-options 'reveal)
|
||||||
@@ -250,6 +260,14 @@ Example defines
|
|||||||
(setq org-pretty-entities t) ;; see also `org-appear' and [C-c C-x \] (`org-toggle-pretty-entities')
|
(setq org-pretty-entities t) ;; see also `org-appear' and [C-c C-x \] (`org-toggle-pretty-entities')
|
||||||
(setq org-pretty-entities-include-sub-superscripts t) ;; if `org-pretty-entities' is active include also sub-superscripts.
|
(setq org-pretty-entities-include-sub-superscripts t) ;; if `org-pretty-entities' is active include also sub-superscripts.
|
||||||
(setq org-image-actual-width '(600)) ;; image width displayed in org
|
(setq org-image-actual-width '(600)) ;; image width displayed in org
|
||||||
|
(setq org-format-latex-options
|
||||||
|
'(:foreground default
|
||||||
|
:background default
|
||||||
|
:scale 1.75
|
||||||
|
:html-foreground "Black"
|
||||||
|
:html-background "Transparent"
|
||||||
|
:html-scale 1.0
|
||||||
|
:matchers ("begin" "$1" "$" "$$" "\\(" "\\[")))
|
||||||
(setq org-tag-persistent-alist '(("ignore" . ?i) ("noexport" . ?n)))
|
(setq org-tag-persistent-alist '(("ignore" . ?i) ("noexport" . ?n)))
|
||||||
;; todo see also org-todo-keyword-faces and org-superstar-todo-bullet-alist
|
;; todo see also org-todo-keyword-faces and org-superstar-todo-bullet-alist
|
||||||
(setq org-todo-keywords ;; (x!) record a time stamp, (x@) add a note (with time), (y/z) entering the state / leaving the state
|
(setq org-todo-keywords ;; (x!) record a time stamp, (x@) add a note (with time), (y/z) entering the state / leaving the state
|
||||||
@@ -297,6 +315,9 @@ Example defines
|
|||||||
|
|
||||||
(add-to-list 'image-file-name-extensions "eps" t)) ;; TODO: eps not needed?
|
(add-to-list 'image-file-name-extensions "eps" t)) ;; TODO: eps not needed?
|
||||||
|
|
||||||
|
(use-package org-contrib
|
||||||
|
:load-path (lambda () (list (concat config-dir "lisp/org-contrib"))))
|
||||||
|
|
||||||
;; Make invisible parts of Org elements appear visible.
|
;; Make invisible parts of Org elements appear visible.
|
||||||
(use-package org-appear
|
(use-package org-appear
|
||||||
:after (org)
|
:after (org)
|
||||||
@@ -308,30 +329,61 @@ Example defines
|
|||||||
(setq org-appear-autosubmarkers t) ;; toogle subscripts and superscripts: ^3 -> ³, needs `org-pretty-entries' active
|
(setq org-appear-autosubmarkers t) ;; toogle subscripts and superscripts: ^3 -> ³, needs `org-pretty-entries' active
|
||||||
(setq org-appear-autokeywords t)) ;; toogle keywords: #+TITLE: foo -> foo, needs `org-hidden-keywords' active
|
(setq org-appear-autokeywords t)) ;; toogle keywords: #+TITLE: foo -> foo, needs `org-hidden-keywords' active
|
||||||
|
|
||||||
(use-package org-contrib
|
(use-package org-brain ;; uses org-id If you find that org-brain is missing entries, or list entries which doesn’t exist, try using M-x org-brain-update-id-locations, which syncs the org-brain entries with the org-id caching system.
|
||||||
:load-path (lambda () (list (concat config-dir "lisp/org-contrib"))))
|
:commands (org-brain-visualize)
|
||||||
|
:init
|
||||||
(use-package org-id ;; used by org-brain
|
(setq org-brain-path my-org-brain-path)
|
||||||
:defer t
|
|
||||||
:config
|
:config
|
||||||
;; (setq org-id-track-globally t) ;; default is t
|
(require 'org-capture)
|
||||||
(setq org-id-locations-file (concat user-cache-directory ".org-id-locations")))
|
;; make org-brain commands more accessable if you edit entries from org-mode
|
||||||
|
(bind-key "C-c B" 'org-brain-prefix-map org-mode-map)
|
||||||
|
;; org-brain use org-id in order to speed things up. Because of
|
||||||
|
;; this, the variable org-id-track-globally should be t (which it
|
||||||
|
;; already is by default). You may want to modify
|
||||||
|
;; org-id-locations-file too. If you add entries to org-brain
|
||||||
|
;; directly from org-mode you must assign headliens an ID. A
|
||||||
|
;; comfortable way to do this is with the command
|
||||||
|
;; org-brain-ensure-ids-in-buffer. Even more comfortable is to add
|
||||||
|
;; that to before-save-hook, so that it runs when saving.
|
||||||
|
(add-hook 'before-save-hook #'org-brain-ensure-ids-in-buffer)
|
||||||
|
;; to add information at the end of an entry, without visiting the file.
|
||||||
|
(push '("b" "Brain" plain (function org-brain-goto-end)
|
||||||
|
"* %i%?" :empty-lines 1)
|
||||||
|
org-capture-templates)
|
||||||
|
;; (setq org-brain-visualize-default-choices 'all)
|
||||||
|
;; (setq org-brain-show-resources t)
|
||||||
|
;; (setq org-brain-show-text t)
|
||||||
|
;; (setq org-brain-title-max-length 12)
|
||||||
|
;; Some users find it confusing having both headline entries and
|
||||||
|
;; file entries (see below). It may be preferable to only use
|
||||||
|
;; headline entries, by setting org-brain-include-file-entries to
|
||||||
|
;; nil. If doing this, you should probably also set
|
||||||
|
;; org-brain-file-entries-use-title to nil. Another possibility is
|
||||||
|
;; if you’re only using file entries, in which case you can set
|
||||||
|
;; org-brain-scan-for-header-entries to nil.
|
||||||
|
;; (setq org-brain-include-file-entries nil)
|
||||||
|
;; (setq org-brain-file-entries-use-title nil)
|
||||||
|
|
||||||
(use-package org-faces
|
(require 'deft)
|
||||||
:defer t
|
(defun org-brain-deft ()
|
||||||
:config
|
"Use `deft' for files in `org-brain-path'."
|
||||||
(setq org-todo-keyword-faces ;; TODO keywords
|
(interactive)
|
||||||
'(("TODO" . "LightSkyBlue4") ;; org-warning (bold red), DeepSkyBlue3
|
(let ((deft-directory org-brain-path)
|
||||||
("WAIT" . "LightSkyBlue4") ;;
|
(deft-recursive t)
|
||||||
("DONE" . "#5e5079") ;; DarkSlateGray4 PaleTurquoise4, CadetBlue4, LightSkyBlue4
|
(deft-extensions '("org")))
|
||||||
("CANC" . "#5e5079") ;;
|
(deft)))
|
||||||
("STARTED" . "yellow")
|
|
||||||
("CANCELED" . (:foreground "blue" :weight bold)))))
|
|
||||||
|
|
||||||
(use-package org-table
|
(require 'org-cliplink)
|
||||||
:defer t
|
(defun org-brain-cliplink-resource ()
|
||||||
:config
|
"Add a URL from the clipboard as an org-brain resource.
|
||||||
(setq org-table-convert-region-max-lines 9999))
|
Suggest the URL title as a description for resource."
|
||||||
|
(interactive)
|
||||||
|
(let ((url (org-cliplink-clipboard-content)))
|
||||||
|
(org-brain-add-resource
|
||||||
|
url
|
||||||
|
(org-cliplink-retrieve-title-synchronously url)
|
||||||
|
t)))
|
||||||
|
(define-key org-brain-visualize-mode-map (kbd "L") #'org-brain-cliplink-resource))
|
||||||
|
|
||||||
(use-package org-capture
|
(use-package org-capture
|
||||||
:defer t
|
:defer t
|
||||||
@@ -344,59 +396,55 @@ Example defines
|
|||||||
(add-to-list 'org-capture-templates
|
(add-to-list 'org-capture-templates
|
||||||
'(;; put entries under a date tree (year - month - day - entry) in the default file
|
'(;; put entries under a date tree (year - month - day - entry) in the default file
|
||||||
("j" "Journal" entry (file+olp+datetree "") ;; empty string is the file, e.g. "~/org/journal.org"
|
("j" "Journal" entry (file+olp+datetree "") ;; empty string is the file, e.g. "~/org/journal.org"
|
||||||
"* %?\nEntered on %U\n %i\n %a")))
|
"* %?\nEntered on %U\n %i\n %a"))))
|
||||||
;; see also org-cliplink K, org-brain b
|
;; see also org-cliplink K, org-brain b
|
||||||
)
|
|
||||||
|
|
||||||
(use-package org-mouse ;; to load mouse features, like clicking on the bullet of a heading
|
(use-package org-cliplink
|
||||||
|
:after (org)
|
||||||
|
:load-path (lambda() (concat config-dir "lisp/org-cliplink"))
|
||||||
|
:config
|
||||||
|
(defun my-org-link-description-update ()
|
||||||
|
"."
|
||||||
|
;; content is the link description
|
||||||
|
(interactive)
|
||||||
|
(let ((elem (org-element-context)))
|
||||||
|
(if (eq (car elem) 'link)
|
||||||
|
(let* ((content-begin (org-element-property :contents-begin elem))
|
||||||
|
(content-end (org-element-property :contents-end elem))
|
||||||
|
(link-begin (org-element-property :begin elem))
|
||||||
|
(link-end (org-element-property :end elem))
|
||||||
|
(raw-link (org-element-property :raw-link elem)))
|
||||||
|
(save-excursion
|
||||||
|
;; if content-begin (and content-end) is not nil (will be nil if there is no description)
|
||||||
|
(if (and content-begin content-end)
|
||||||
|
(progn
|
||||||
|
(delete-region content-begin content-end)
|
||||||
|
(insert (org-cliplink-retrieve-title-synchronously raw-link)))
|
||||||
|
(delete-region link-begin link-end)
|
||||||
|
(insert (org-cliplink-org-mode-link-transformer
|
||||||
|
raw-link (org-cliplink-retrieve-title-synchronously raw-link)))))))))
|
||||||
|
|
||||||
|
(with-eval-after-load 'org-capture
|
||||||
|
(add-to-list 'org-capture-templates
|
||||||
|
'("K" "Cliplink capture task" entry (file "")
|
||||||
|
"* TODO %(org-cliplink-capture) \n SCHEDULED: %t\n" :empty-lines 0))))
|
||||||
|
|
||||||
|
(use-package org-collector ;; collect properties into tables, using #+BEGIN: propview
|
||||||
:after (org))
|
:after (org))
|
||||||
|
|
||||||
(use-package org-tempo ;; expand <s to a src block, ...
|
(use-package org-drill ;; requires persist https://elpa.gnu.org/packages/persist.html
|
||||||
:after (org))
|
:commands org-drill)
|
||||||
|
|
||||||
(use-package org-num ;; numbering of headings
|
(use-package org-faces
|
||||||
:after (org)
|
:defer t
|
||||||
:delight (org-num-mode "#") ;; o#
|
|
||||||
:config
|
:config
|
||||||
(setq org-num-skip-tags '("ignore"))
|
(setq org-todo-keyword-faces ;; TODO keywords
|
||||||
(setq org-num-skip-unnumbered t))
|
'(("TODO" . "LightSkyBlue4") ;; org-warning (bold red), DeepSkyBlue3
|
||||||
|
("WAIT" . "LightSkyBlue4") ;;
|
||||||
(use-package org-collector ;; collect properties into tables, using #+BEGIN: propview
|
("DONE" . "#5e5079") ;; DarkSlateGray4 PaleTurquoise4, CadetBlue4, LightSkyBlue4
|
||||||
:after (org))
|
("CANC" . "#5e5079") ;;
|
||||||
|
("STARTED" . "yellow")
|
||||||
(use-package org-superstar
|
("CANCELED" . (:foreground "blue" :weight bold)))))
|
||||||
;; formerly
|
|
||||||
;;(require 'org-bullets)
|
|
||||||
;;(add-hook 'org-mode-hook 'org-bullets-mode)
|
|
||||||
:hook (org-mode . org-superstar-mode) ;; defers the loading.
|
|
||||||
:config
|
|
||||||
(setq org-superstar-leading-bullet " ·") ;; " ․" " ·" " ⚫" or to hide: ?\s
|
|
||||||
(setq org-superstar-prettify-item-bullets t) ;; can cause slowdown when using a lot of lists (thousands), run command org-superstar-toggle-lightweight-list or set this variable to nil or see hack on the source web page
|
|
||||||
(setq org-superstar-remove-leading-stars nil) ;; to remove the indentation
|
|
||||||
(setq org-superstar-special-todo-items t) ;; using symbols defined in org-superstar-todo-bullet-alist
|
|
||||||
;; (setq org-superstar-todo-bullet-alist
|
|
||||||
;; '(("TODO" . 9744)
|
|
||||||
;; ("WAIT" . 9744)
|
|
||||||
;; ("DONE" . 9745)
|
|
||||||
;; ("CANC" . 9745)))
|
|
||||||
(setq org-superstar-todo-bullet-alist
|
|
||||||
'(("TODO" . 9744)
|
|
||||||
("WAIT" . 9744)
|
|
||||||
("DONE" . 9744)
|
|
||||||
("CANC" . 9744)))
|
|
||||||
(set-face-attribute 'org-superstar-leading nil :foreground "#42444a")) ;; "#42444a"
|
|
||||||
|
|
||||||
(use-package org-table-sticky-header
|
|
||||||
:after (org)
|
|
||||||
:delight (org-table-sticky-header-mode "Ⓣ") ;; Ⓞt OTSH
|
|
||||||
:hook (org-mode . org-table-sticky-header-mode)) ;; must be set before org-sticky-header-mode, maybe orgtbl-show-header can also be used
|
|
||||||
|
|
||||||
(use-package org-sticky-header
|
|
||||||
:after (org)
|
|
||||||
:hook (org-mode . org-sticky-header-mode)
|
|
||||||
:config
|
|
||||||
;;(setq org-sticky-header-always-show-header nil)
|
|
||||||
(setq org-sticky-header-full-path 'reversed))
|
|
||||||
|
|
||||||
(use-package org-fancy-priorities
|
(use-package org-fancy-priorities
|
||||||
:after (org)
|
:after (org)
|
||||||
@@ -442,35 +490,63 @@ Example defines
|
|||||||
(list ?4 :foreground "green1")
|
(list ?4 :foreground "green1")
|
||||||
(list ?I :foreground "#df5f5f" :weight 'bold))))
|
(list ?I :foreground "#df5f5f" :weight 'bold))))
|
||||||
|
|
||||||
(use-package org-cliplink
|
(use-package org-id ;; used by org-brain
|
||||||
:after (org)
|
:defer t
|
||||||
:load-path (lambda() (concat config-dir "lisp/org-cliplink"))
|
|
||||||
:config
|
:config
|
||||||
(defun my-org-link-description-update ()
|
;; (setq org-id-track-globally t) ;; default is t
|
||||||
"."
|
(setq org-id-locations-file (concat user-cache-directory ".org-id-locations")))
|
||||||
;; content is the link description
|
|
||||||
(interactive)
|
(use-package org-mouse ;; to load mouse features, like clicking on the bullet of a heading
|
||||||
(let ((elem (org-element-context)))
|
:after (org))
|
||||||
(if (eq (car elem) 'link)
|
|
||||||
(let* ((content-begin (org-element-property :contents-begin elem))
|
(use-package org-num ;; numbering of headings
|
||||||
(content-end (org-element-property :contents-end elem))
|
:after (org)
|
||||||
(link-begin (org-element-property :begin elem))
|
:delight (org-num-mode "#") ;; o#
|
||||||
(link-end (org-element-property :end elem))
|
:config
|
||||||
(raw-link (org-element-property :raw-link elem)))
|
(setq org-num-skip-tags '("ignore"))
|
||||||
(save-excursion
|
(setq org-num-skip-unnumbered t))
|
||||||
;; if content-begin (and content-end) is not nil (will be nil if there is no description)
|
|
||||||
(if (and content-begin content-end)
|
(use-package org-sticky-header
|
||||||
(progn
|
:after (org org-table-sticky-header) ;; org-table-sticky-header-mode must be set before
|
||||||
(delete-region content-begin content-end)
|
:hook (org-mode . org-sticky-header-mode)
|
||||||
(insert (org-cliplink-retrieve-title-synchronously raw-link)))
|
:config
|
||||||
(delete-region link-begin link-end)
|
;;(setq org-sticky-header-always-show-header nil)
|
||||||
(insert (org-cliplink-org-mode-link-transformer
|
(setq org-sticky-header-full-path 'reversed))
|
||||||
raw-link (org-cliplink-retrieve-title-synchronously raw-link)))))))))
|
|
||||||
|
(use-package org-superstar
|
||||||
(with-eval-after-load 'org-capture
|
;; formerly
|
||||||
(add-to-list 'org-capture-templates
|
;;(require 'org-bullets)
|
||||||
'("K" "Cliplink capture task" entry (file "")
|
;;(add-hook 'org-mode-hook 'org-bullets-mode)
|
||||||
"* TODO %(org-cliplink-capture) \n SCHEDULED: %t\n" :empty-lines 0))))
|
:hook (org-mode . org-superstar-mode) ;; defers the loading.
|
||||||
|
:config
|
||||||
|
(setq org-superstar-leading-bullet " ·") ;; " ․" " ·" " ⚫" or to hide: ?\s
|
||||||
|
(setq org-superstar-prettify-item-bullets t) ;; can cause slowdown when using a lot of lists (thousands), run command org-superstar-toggle-lightweight-list or set this variable to nil or see hack on the source web page
|
||||||
|
(setq org-superstar-remove-leading-stars nil) ;; to remove the indentation
|
||||||
|
(setq org-superstar-special-todo-items t) ;; using symbols defined in org-superstar-todo-bullet-alist
|
||||||
|
;; (setq org-superstar-todo-bullet-alist
|
||||||
|
;; '(("TODO" . 9744)
|
||||||
|
;; ("WAIT" . 9744)
|
||||||
|
;; ("DONE" . 9745)
|
||||||
|
;; ("CANC" . 9745)))
|
||||||
|
(setq org-superstar-todo-bullet-alist
|
||||||
|
'(("TODO" . 9744)
|
||||||
|
("WAIT" . 9744)
|
||||||
|
("DONE" . 9744)
|
||||||
|
("CANC" . 9744)))
|
||||||
|
(set-face-attribute 'org-superstar-leading nil :foreground "#42444a")) ;; "#42444a"
|
||||||
|
|
||||||
|
(use-package org-table
|
||||||
|
:defer t
|
||||||
|
:config
|
||||||
|
(setq org-table-convert-region-max-lines 9999))
|
||||||
|
|
||||||
|
(use-package org-table-sticky-header
|
||||||
|
:after (org)
|
||||||
|
:delight (org-table-sticky-header-mode "Ⓣ") ;; Ⓞt OTSH
|
||||||
|
:hook (org-mode . org-table-sticky-header-mode)) ;; must be set before org-sticky-header-mode, maybe orgtbl-show-header can also be used
|
||||||
|
|
||||||
|
(use-package org-tempo ;; expand <s to a src block, ...
|
||||||
|
:after (org))
|
||||||
|
|
||||||
(use-package ob-core
|
(use-package ob-core
|
||||||
:defer t
|
:defer t
|
||||||
@@ -507,6 +583,26 @@ Updating an old preamble.org should remove this warning."))
|
|||||||
(t "_dark"))
|
(t "_dark"))
|
||||||
".svg")))
|
".svg")))
|
||||||
|
|
||||||
|
(use-package ob-async ;; https://melpa.org/#/ob-async execute src blocks async, insert in block header (without argument) :async
|
||||||
|
:after (org))
|
||||||
|
|
||||||
|
(use-package ob-csharp
|
||||||
|
:after (org))
|
||||||
|
|
||||||
|
(use-package ob-ditaa
|
||||||
|
:defer t
|
||||||
|
:config
|
||||||
|
;; org-ditaa-jar-path (car (directory-files "/usr/share/java/ditaa" 'full "[.]*.jar" #'file-newer-than-file-p))
|
||||||
|
;; config to change from a ditaa.jar file to a ditaa executable file
|
||||||
|
;; org-babel-ditaa-java-cmd "" ; default is "java". set to "" because system ditaa executable includes java
|
||||||
|
;; org-babel-default-header-args:ditaa ; default is ((:results . "file") (:exports . "results") (:java . "-Dfile.encoding=UTF-8"))
|
||||||
|
;; '((:results . "file")
|
||||||
|
;; (:exports . "results"))
|
||||||
|
;; org-ditaa-jar-option "" ; default is "-jar". set to "" because system ditaa executable includes -jar
|
||||||
|
;; org-ditaa-jar-path (concat "" (executable-find "ditaa"))
|
||||||
|
;; TODO: find file e.g. (shell-command "cat `which ditaa`") or (shell-command "ls /usr/share/java/ditaa")
|
||||||
|
(setq org-ditaa-jar-path "/usr/share/java/ditaa/ditaa-0.11.jar"))
|
||||||
|
|
||||||
(use-package ob-gnuplot
|
(use-package ob-gnuplot
|
||||||
:defer t
|
:defer t
|
||||||
:config
|
:config
|
||||||
@@ -643,26 +739,6 @@ usage: #+HEADER: :prologue (mpl-prologue)
|
|||||||
(article-latex "")
|
(article-latex "")
|
||||||
(t "import matplotlib.pyplot as plt;plt.style.use('dark_background');"))))
|
(t "import matplotlib.pyplot as plt;plt.style.use('dark_background');"))))
|
||||||
|
|
||||||
(use-package ob-ditaa
|
|
||||||
:defer t
|
|
||||||
:config
|
|
||||||
;; org-ditaa-jar-path (car (directory-files "/usr/share/java/ditaa" 'full "[.]*.jar" #'file-newer-than-file-p))
|
|
||||||
;; config to change from a ditaa.jar file to a ditaa executable file
|
|
||||||
;; org-babel-ditaa-java-cmd "" ; default is "java". set to "" because system ditaa executable includes java
|
|
||||||
;; org-babel-default-header-args:ditaa ; default is ((:results . "file") (:exports . "results") (:java . "-Dfile.encoding=UTF-8"))
|
|
||||||
;; '((:results . "file")
|
|
||||||
;; (:exports . "results"))
|
|
||||||
;; org-ditaa-jar-option "" ; default is "-jar". set to "" because system ditaa executable includes -jar
|
|
||||||
;; org-ditaa-jar-path (concat "" (executable-find "ditaa"))
|
|
||||||
;; TODO: find file e.g. (shell-command "cat `which ditaa`") or (shell-command "ls /usr/share/java/ditaa")
|
|
||||||
(setq org-ditaa-jar-path "/usr/share/java/ditaa/ditaa-0.11.jar"))
|
|
||||||
|
|
||||||
(use-package ob-csharp
|
|
||||||
:after (org))
|
|
||||||
|
|
||||||
(use-package ob-async ;; https://melpa.org/#/ob-async execute src blocks async, insert in block header (without argument) :async
|
|
||||||
:after (org))
|
|
||||||
|
|
||||||
(use-package ol-notmuch
|
(use-package ol-notmuch
|
||||||
:after (org))
|
:after (org))
|
||||||
|
|
||||||
@@ -804,87 +880,6 @@ usage: #+HEADER: :prologue (mpl-prologue)
|
|||||||
src=\"%PATH\"></script>")
|
src=\"%PATH\"></script>")
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package ox-tufte ;; https://melpa.org/#/ox-tufte
|
|
||||||
:defer t ;; will be loaded via `org-export-backends' see above inside `org'
|
|
||||||
:config
|
|
||||||
(defun my-org-tufte-export-to-file (&optional async subtreep visible-only)
|
|
||||||
"Like `org-tufte-export-to-file' but with additional notification."
|
|
||||||
(interactive)
|
|
||||||
(let ((outfile (org-export-output-file-name ".html" subtreep))
|
|
||||||
;; need to bind this because tufte treats footnotes specially, so we
|
|
||||||
;; don't want to display them at the bottom
|
|
||||||
(org-html-footnotes-section (if org-tufte-include-footnotes-at-bottom
|
|
||||||
org-html-footnotes-section
|
|
||||||
"<!-- %s --><!-- %s -->")))
|
|
||||||
(org-export-to-file 'tufte-html outfile
|
|
||||||
async subtreep visible-only nil nil
|
|
||||||
(lambda (file) ;; is called with FILE and has to return a file name.
|
|
||||||
(progn
|
|
||||||
(when my-dbusp
|
|
||||||
(use-package notifications)
|
|
||||||
(notifications-notify
|
|
||||||
:title "Emacs Org Tufte (HTML) Export to File"
|
|
||||||
:body "Export <b>done</b>."
|
|
||||||
:timeout 60000
|
|
||||||
:urgency 'normal
|
|
||||||
:category "transfer"))
|
|
||||||
file))))) ;; is needed for the asynchronous task
|
|
||||||
|
|
||||||
(defun my-org-export-html (&optional async)
|
|
||||||
(interactive)
|
|
||||||
(save-buffer)
|
|
||||||
(when (get-buffer "*gnuplot*")
|
|
||||||
(kill-buffer "*gnuplot*")) ;; to get a new session
|
|
||||||
(my-org-tufte-export-to-file async))
|
|
||||||
|
|
||||||
(defun my-org-export-html-async ()
|
|
||||||
(interactive)
|
|
||||||
(my-org-export-html t))
|
|
||||||
|
|
||||||
(org-defkey org-mode-map [f5] 'my-org-export-html)
|
|
||||||
(org-defkey org-mode-map [C-f5] 'my-org-export-html-async)
|
|
||||||
|
|
||||||
(defun org-tufte-src-block (src-block _contents info)
|
|
||||||
"Transcode a SRC-BLOCK element from Org to HTML.
|
|
||||||
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
||||||
contextual information."
|
|
||||||
(if (org-export-read-attribute :attr_html src-block :textarea)
|
|
||||||
(org-html--textarea-block src-block)
|
|
||||||
(let* ((lang (org-element-property :language src-block))
|
|
||||||
(code (org-html-format-code src-block info))
|
|
||||||
(label (let ((lbl (and (org-element-property :name src-block)
|
|
||||||
(org-export-get-reference src-block info))))
|
|
||||||
(if lbl (format " id=\"%s\"" lbl) "")))
|
|
||||||
(klipsify (and (plist-get info :html-klipsify-src)
|
|
||||||
(member lang '("javascript" "js"
|
|
||||||
"ruby" "scheme" "clojure" "php" "html")))))
|
|
||||||
(if (not lang) (format "<pre class=\"example\"%s>\n%s</pre>" label code)
|
|
||||||
(format "<div class=\"org-src-container\">\n%s%s\n</div>"
|
|
||||||
;; Build caption.
|
|
||||||
(let ((caption (org-export-get-caption src-block)))
|
|
||||||
(if (not caption) ""
|
|
||||||
(let ((listing-number
|
|
||||||
(format
|
|
||||||
"<span class=\"listing-number\">%s </span>"
|
|
||||||
(format
|
|
||||||
(org-html--translate "Listing %d:" info)
|
|
||||||
(org-export-get-ordinal
|
|
||||||
src-block info nil #'org-html--has-caption-p)))))
|
|
||||||
(format "<label class=\"org-src-name\">%s%s</label>"
|
|
||||||
listing-number
|
|
||||||
(org-trim (org-export-data caption info))))))
|
|
||||||
;; Contents.
|
|
||||||
(if klipsify
|
|
||||||
(format "<pre><code class=\"src src-%s\"%s%s>%s</code></pre>"
|
|
||||||
lang
|
|
||||||
label
|
|
||||||
(if (string= lang "html")
|
|
||||||
" data-editor-type=\"html\""
|
|
||||||
"")
|
|
||||||
code)
|
|
||||||
(format "<pre class=\"src src-%s\"%s>%s</pre>"
|
|
||||||
lang label code))))))))
|
|
||||||
|
|
||||||
(use-package ox-latex
|
(use-package ox-latex
|
||||||
:defer t ;; will be loaded via `org-export-backends' see above inside `org'
|
:defer t ;; will be loaded via `org-export-backends' see above inside `org'
|
||||||
:config
|
:config
|
||||||
@@ -1207,64 +1202,86 @@ used as a communication channel."
|
|||||||
;; No plugins, return empty string
|
;; No plugins, return empty string
|
||||||
(cons nil nil)))))
|
(cons nil nil)))))
|
||||||
|
|
||||||
(use-package org-drill ;; requires persist https://elpa.gnu.org/packages/persist.html
|
(use-package ox-tufte ;; https://melpa.org/#/ox-tufte
|
||||||
:commands org-drill)
|
:defer t ;; will be loaded via `org-export-backends' see above inside `org'
|
||||||
|
|
||||||
(use-package org-brain ;; uses org-id If you find that org-brain is missing entries, or list entries which doesn’t exist, try using M-x org-brain-update-id-locations, which syncs the org-brain entries with the org-id caching system.
|
|
||||||
:commands (org-brain-visualize)
|
|
||||||
:init
|
|
||||||
(setq org-brain-path my-org-brain-path)
|
|
||||||
:config
|
:config
|
||||||
(require 'org-capture)
|
(defun my-org-tufte-export-to-file (&optional async subtreep visible-only)
|
||||||
;; make org-brain commands more accessable if you edit entries from org-mode
|
"Like `org-tufte-export-to-file' but with additional notification."
|
||||||
(bind-key "C-c B" 'org-brain-prefix-map org-mode-map)
|
|
||||||
;; org-brain use org-id in order to speed things up. Because of
|
|
||||||
;; this, the variable org-id-track-globally should be t (which it
|
|
||||||
;; already is by default). You may want to modify
|
|
||||||
;; org-id-locations-file too. If you add entries to org-brain
|
|
||||||
;; directly from org-mode you must assign headliens an ID. A
|
|
||||||
;; comfortable way to do this is with the command
|
|
||||||
;; org-brain-ensure-ids-in-buffer. Even more comfortable is to add
|
|
||||||
;; that to before-save-hook, so that it runs when saving.
|
|
||||||
(add-hook 'before-save-hook #'org-brain-ensure-ids-in-buffer)
|
|
||||||
;; to add information at the end of an entry, without visiting the file.
|
|
||||||
(push '("b" "Brain" plain (function org-brain-goto-end)
|
|
||||||
"* %i%?" :empty-lines 1)
|
|
||||||
org-capture-templates)
|
|
||||||
;; (setq org-brain-visualize-default-choices 'all)
|
|
||||||
;; (setq org-brain-show-resources t)
|
|
||||||
;; (setq org-brain-show-text t)
|
|
||||||
;; (setq org-brain-title-max-length 12)
|
|
||||||
;; Some users find it confusing having both headline entries and
|
|
||||||
;; file entries (see below). It may be preferable to only use
|
|
||||||
;; headline entries, by setting org-brain-include-file-entries to
|
|
||||||
;; nil. If doing this, you should probably also set
|
|
||||||
;; org-brain-file-entries-use-title to nil. Another possibility is
|
|
||||||
;; if you’re only using file entries, in which case you can set
|
|
||||||
;; org-brain-scan-for-header-entries to nil.
|
|
||||||
;; (setq org-brain-include-file-entries nil)
|
|
||||||
;; (setq org-brain-file-entries-use-title nil)
|
|
||||||
|
|
||||||
(require 'deft)
|
|
||||||
(defun org-brain-deft ()
|
|
||||||
"Use `deft' for files in `org-brain-path'."
|
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((deft-directory org-brain-path)
|
(let ((outfile (org-export-output-file-name ".html" subtreep))
|
||||||
(deft-recursive t)
|
;; need to bind this because tufte treats footnotes specially, so we
|
||||||
(deft-extensions '("org")))
|
;; don't want to display them at the bottom
|
||||||
(deft)))
|
(org-html-footnotes-section (if org-tufte-include-footnotes-at-bottom
|
||||||
|
org-html-footnotes-section
|
||||||
|
"<!-- %s --><!-- %s -->")))
|
||||||
|
(org-export-to-file 'tufte-html outfile
|
||||||
|
async subtreep visible-only nil nil
|
||||||
|
(lambda (file) ;; is called with FILE and has to return a file name.
|
||||||
|
(progn
|
||||||
|
(when my-dbusp
|
||||||
|
(use-package notifications)
|
||||||
|
(notifications-notify
|
||||||
|
:title "Emacs Org Tufte (HTML) Export to File"
|
||||||
|
:body "Export <b>done</b>."
|
||||||
|
:timeout 60000
|
||||||
|
:urgency 'normal
|
||||||
|
:category "transfer"))
|
||||||
|
file))))) ;; is needed for the asynchronous task
|
||||||
|
|
||||||
(require 'org-cliplink)
|
(defun my-org-export-html (&optional async)
|
||||||
(defun org-brain-cliplink-resource ()
|
|
||||||
"Add a URL from the clipboard as an org-brain resource.
|
|
||||||
Suggest the URL title as a description for resource."
|
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((url (org-cliplink-clipboard-content)))
|
(save-buffer)
|
||||||
(org-brain-add-resource
|
(when (get-buffer "*gnuplot*")
|
||||||
url
|
(kill-buffer "*gnuplot*")) ;; to get a new session
|
||||||
(org-cliplink-retrieve-title-synchronously url)
|
(my-org-tufte-export-to-file async))
|
||||||
t)))
|
|
||||||
(define-key org-brain-visualize-mode-map (kbd "L") #'org-brain-cliplink-resource))
|
(defun my-org-export-html-async ()
|
||||||
|
(interactive)
|
||||||
|
(my-org-export-html t))
|
||||||
|
|
||||||
|
(org-defkey org-mode-map [f5] 'my-org-export-html)
|
||||||
|
(org-defkey org-mode-map [C-f5] 'my-org-export-html-async)
|
||||||
|
|
||||||
|
(defun org-tufte-src-block (src-block _contents info)
|
||||||
|
"Transcode a SRC-BLOCK element from Org to HTML.
|
||||||
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
||||||
|
contextual information."
|
||||||
|
(if (org-export-read-attribute :attr_html src-block :textarea)
|
||||||
|
(org-html--textarea-block src-block)
|
||||||
|
(let* ((lang (org-element-property :language src-block))
|
||||||
|
(code (org-html-format-code src-block info))
|
||||||
|
(label (let ((lbl (and (org-element-property :name src-block)
|
||||||
|
(org-export-get-reference src-block info))))
|
||||||
|
(if lbl (format " id=\"%s\"" lbl) "")))
|
||||||
|
(klipsify (and (plist-get info :html-klipsify-src)
|
||||||
|
(member lang '("javascript" "js"
|
||||||
|
"ruby" "scheme" "clojure" "php" "html")))))
|
||||||
|
(if (not lang) (format "<pre class=\"example\"%s>\n%s</pre>" label code)
|
||||||
|
(format "<div class=\"org-src-container\">\n%s%s\n</div>"
|
||||||
|
;; Build caption.
|
||||||
|
(let ((caption (org-export-get-caption src-block)))
|
||||||
|
(if (not caption) ""
|
||||||
|
(let ((listing-number
|
||||||
|
(format
|
||||||
|
"<span class=\"listing-number\">%s </span>"
|
||||||
|
(format
|
||||||
|
(org-html--translate "Listing %d:" info)
|
||||||
|
(org-export-get-ordinal
|
||||||
|
src-block info nil #'org-html--has-caption-p)))))
|
||||||
|
(format "<label class=\"org-src-name\">%s%s</label>"
|
||||||
|
listing-number
|
||||||
|
(org-trim (org-export-data caption info))))))
|
||||||
|
;; Contents.
|
||||||
|
(if klipsify
|
||||||
|
(format "<pre><code class=\"src src-%s\"%s%s>%s</code></pre>"
|
||||||
|
lang
|
||||||
|
label
|
||||||
|
(if (string= lang "html")
|
||||||
|
" data-editor-type=\"html\""
|
||||||
|
"")
|
||||||
|
code)
|
||||||
|
(format "<pre class=\"src src-%s\"%s>%s</pre>"
|
||||||
|
lang label code))))))))
|
||||||
|
|
||||||
;; Allows you to edit entries directly from org-brain-visualize
|
;; Allows you to edit entries directly from org-brain-visualize
|
||||||
(use-package polymode
|
(use-package polymode
|
||||||
|
|||||||
Reference in New Issue
Block a user