diff --git a/fschl-org.el b/fschl-org.el new file mode 100644 index 0000000..0418100 --- /dev/null +++ b/fschl-org.el @@ -0,0 +1,101 @@ +(setq org-roam-directory (file-truename "~/org-roam")) +(org-roam-db-autosync-mode) + +(require 'org-projectile) + +(eval-after-load 'ox '(require 'ox-koma-letter)) +(eval-after-load 'ox-koma-letter + '(progn + (add-to-list 'org-latex-classes + '("Brief-de-modern" + "\\documentclass\[Brief-de-modern\]\{scrlttr2\} + \[DEFAULT-PACKAGES] + \[PACKAGES] + \[EXTRA]")) + + ;; \\usepackage[english]{babel} + ;; \\setkomavar{frombank}{(1234)\\,567\\,890} + + (setq org-koma-letter-default-class "Brief-de-modern"))) + +(setq org-default-notes-file "~/Documents/Org/tasks.org") +(setq org-agenda-files + (quote ("~/Documents/Org/tasks.org" + "~/Documents/Org/journal.org" + "~/Documents/Org/private.org" + "~/Documents/Org/projects.org" + "~/Documents/Org/birthdays.org"))) + +(defun fschl/create-org-letter () + "Create a new letter in ~/Documents/letters/ with filename and date" + (interactive) + (let ((name (read-string "Filename: "))) + (expand-file-name (format "%s.org" name) "~/Documents/letters/") )) + +;; https://orgmode.org/manual/Template-elements.html +;; https://orgmode.org/manual/Template-expansion.html +(setq org-capture-templates + '(("t" "todo list item" entry + (file+olp+datetree "~/Documents/Org/tasks.org") + "* TODO %?\n SCHEDULED: %^T" + :tree-type month + ) + ("T" "todo list item with source" entry + (file+olp+datetree "~/Documents/Org/tasks.org") + "* TODO %?\n %a \n SCHEDULED: %^T \n %^G \n" + :tree-type month + ) + + ("r" "Todo research some website/software" entry + (file+olp+datetree "~/Documents/Org/tasks.org") + "* TODO %?\n SCHEDULED: %^T \n %^L \n" + :tree-type month + ) + ("l" "letter to Documents/letters/" + entry (file fschl/create-org-letter) + "* Preamble :noexport: +# #+TITLE: ? +# #+DATE: + +#+SUBJECT: Betreff des Briefs + +#+LCO: Absender-Frieder +# #+LCO: Absender-Marcelle +# #+LCO: Absender-FamilieSchlesier +#+LCO: Brief-de-modern +#+STARTUP: showall + +* To-address :to: + +# * From :from: + +* Sehr geehrte Damen und Herren, +? + +* Mit freundlichen Grüßen, :closing: + +Frieder Schlesier" + ) + ("m" "Schedule a meeting" entry + (file+headline "~/Documents/Org/tasks.org") + "* MEETING %?\n SCHEDULED: %^T\n %a" + ) + + ("p" "Schedule a phone call" entry + (file+headline "~/Documents/Org/tasks.org") + "* PHONE %?\n SCHEDULED: %^T\\n %a" + ) + + ("a" "Articles: keep notes of online articles" + entry + (file+datetree "~/Documents/Org/journal.org") + "* %? \n%x \n %u\n- $?" + :tree-type month + :kill-buffer t + :empty-lines-before 1) + ) + ) + +(setq org-ref-default-bibliography '("~/Documents/references/references.bib") + org-ref-pdf-directory "~/Documents/references/" + org-ref-bibliography-notes "~/Documents/references/notes.org") diff --git a/fschl-publish.el b/fschl-publish.el new file mode 100644 index 0000000..03bdcc5 --- /dev/null +++ b/fschl-publish.el @@ -0,0 +1,117 @@ +(add-to-list 'package-selected-packages 'org-roam) +(add-to-list 'package-selected-packages 'org-roam-ui) +(add-to-list 'package-selected-packages 'simple-httpd) +(add-to-list 'package-selected-packages 'htmlize) +(add-to-list 'package-selected-packages 'websocket) +(add-to-list 'package-selected-packages 'f) +(package-install-selected-packages :noconfirm) + +(require 'htmlize) +(require 'org-roam) +(require 'org-roam-ui) +(require 'ox-publish) + +(setq org-export-with-broken-links 'mark) +(setq org-export-html-coding-system 'utf-8-unix) +(setq org-html-doctype "html5") +(defvar fschlde-html-head "") +(setq fschlde-html-footer " ") + +;; following two funcs are taken from +;; https://www.orgroam.com/manual.html#How-do-I-publish-my-notes-with-an-Internet_002dfriendly-graph_003f +;; sitemap function for my roam-publish +(defun roam-sitemap (title list) + (concat "#+OPTIONS: ^:nil author:nil html-postamble:nil\n" + "#+SETUPFILE: ./simple_inline.theme\n" + "#+HTML_HEAD_EXTRA: \n" + "#+TITLE: " title "\n\n" + (org-list-to-org list) "\nfile:sitemap.svg")) + +(setq my-publish-time 0) ; see the next section for context + +;; +(defun roam-publication-wrapper (plist filename pubdir) + (org-roam-graph) + (org-html-publish-to-html plist filename pubdir) + (setq my-publish-time (cadr (current-time)))) + +(defun org-roam-custom-link-builder (node) + (let ((file (org-roam-node-file node))) + (concat (file-name-base file) ".html"))) + +(setq org-roam-graph-link-builder 'org-roam-custom-link-builder) + +(add-hook 'org-roam-graph-generation-hook + (lambda (dot svg) (if (< (- (cadr (current-time)) my-publish-time) 5) + (progn (copy-file svg "~/projects/blog-fschlde/pkb/sitemap.svg" 't) + (kill-buffer (file-name-nondirectory svg)) + (setq my-publish-time 0))))) + + +(setq org-publish-project-alist + '(("website" + :components ("org-journal", "project-notes", "org-sites", "blog-rss", "blog-images")) + ("org-journal" + :base-directory "~/Documents/Org/" + :base-extension "org" + :publishing-directory "~/projects/blog-fschlde/reads/" + :recursive nil + :publishing-function org-html-publish-to-html + + :headline-levels 4 + :with-author t + :with-creator nil + :with-date t + + :with-toc t + :with-drawers nil + + :html-link-home "/" + :html-head nil ;; cleans up anything that would have been in there. + ;; :html-head-extra ,my-blog-extra-head + :html-head-include-default-style nil + :html-head-include-scripts nil + + ;; :html-preamble my-blog-header + ;; :html-postamble ,my-blog-footer + ) + ("project-notes" + :base-directory "~/projects/" + :base-extension "org" + :publishing-directory "~/projects/blog-fschlde/projects/" + :recursive nil + :publishing-function org-html-publish-to-html + :headline-levels 4) + ("org-sites" + :base-directory "~/projects/fschlde-static/" + :base-extension "org\\|css\\|js\\|ico\\|png\\|html" + :publishing-directory "~/projects/blog-fschlde/" + :recursive t + :publishing-function org-publish-attachment + + :html-link-home "/" + ;; :html-head ,fschlde-html-head ;; cleans up anything that would have been in there. + :html-head-include-default-style nil + :html-head-include-scripts nil + :with-drawers nil + :with-creator nil + + ;; :html-head-extra fschlde-html-head + ;; :html-postamble fschlde-html-footer + :headline-levels 4) + ("roam" + :base-directory "~/org-roam/" + :auto-sitemap t + :recursive nil + :base-extension "org" + :exclude ".stversions/\\|.stfolder" + :sitemap-function roam-sitemap + :sitemap-title "Roam Notes" + :style "" + :publishing-function roam-publication-wrapper + :publishing-directory "~/projects/fschlde-static/pkb/" + :section-number nil + :table-of-contents t + ) + ) + )