add views to tab bar and into menu and dashboard and move view functions to own file

add commentary function for org-mode with list function to create strings
This commit is contained in:
2021-01-27 01:57:52 +01:00
parent 15ee156a36
commit d8336fbbae
7 changed files with 831 additions and 119 deletions

View File

@@ -1,15 +1,102 @@
;;; org-settings.el --- Org settings -*- lexical-binding: t -*-
;;; Commentary:
;; Package-Requires: ((emacs) (org-mode) (org-bullets) (org-cliplink))
;; This file is not part of GNU Emacs.
;; direct LaTeX (not org)
;; hyphen via AUCTeX (not installed)
;; https://tex.stackexchange.com/questions/282448/why-does-emacs-or-auctex-turns-into
;; Requirements:
;; org-mode https://orgmode.org/
;; org-bullets
;; org-cliplink https://melpa.org/#/org-cliplink
;;; Commentary:
;; * Overview of modes and commands
;; --------------------------------
;; ** Export `ox-reveal'
;; ---------------------
;; (org-export-get-all-options 'reveal)
;;
;; *** KEYWORDs
;; ------------
;; *Note*: Using an option which is also set in the configuration will
;; overwrite it.
;;
;; #+REVEAL_ROOT:
;; - path to reveal.js root directory, can be used once
;; - is defined in the configuration, see `org-reveal-root'
;;
;; #+REVEAL_EXTRA_CSS:
;; - path to css file, can be used multiple times
;; - is defined in the configuration, see `org-reveal-extra-css'
;;
;; #+REVEAL_POSTAMBLE:
;; - postamble content, can be used once
;; - is defined in the configuration, see `org-reveal-postamble'
;;
;; #+REVEAL_HLEVEL:
;; - can be configured, see `org-reveal-hlevel'
;;
;; #+REVEAL: split
;; #+REVEAL: split:t
;;
;; #+REVEAL_THEME:
;;
;; #+OPTIONS: reveal_title_slide:auto|"string"|nil
;; #+REVEAL_TITLE_SLIDE:
;; - path to css file, can be used multiple times
;; - can be configured, see `org-reveal-title-slide'
;;
;; #+REVEAL_TITLE_SLIDE_BACKGROUND: #123456|rgb(0,0,0)|./image/path.jpg
;; #+REVEAL_TITLE_SLIDE_BACKGROUND_SIZE: 200px
;; #+REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT: repeat
;; #+REVEAL_TITLE_SLIDE_BACKGROUND_OPACITY: 0.2
;;
;; #+REVEAL_TOC_SLIDE_BACKGROUND: #123456|rgb(0,0,0)|./image/path.jpg
;; #+REVEAL_TOC_SLIDE_BACKGROUND_SIZE: 200px
;; #+REVEAL_TOC_SLIDE_BACKGROUND_REPEAT: repeat
;; #+REVEAL_TOC_SLIDE_BACKGROUND_OPACITY: 0.2
;;
;; #+REVEAL_DEFAULT_SLIDE_BACKGROUND: #123456|rgb(0,0,0)|./image/path.jpg
;; #+REVEAL_DEFAULT_SLIDE_BACKGROUND_SIZE: 200px
;; #+REVEAL_DEFAULT_SLIDE_BACKGROUND_POSITION:
;; #+REVEAL_DEFAULT_SLIDE_BACKGROUND_REPEAT: repeat
;; #+REVEAL_DEFAULT_SLIDE_BACKGROUND_TRANSITION:
;;
;; #+OPTIONS: reveal_width: org-reveal-width
;; #+OPTIONS: reveal_height: org-reveal-height
;; #+REVEAL_MARGIN: org-reveal-margin
;; #+REVEAL_MIN_SCALE: org-reveal-min-scale
;; #+REVEAL_MAX_SCALE: org-reveal-max-scale
;;
;; #+REVEAL_INIT_OPTIONS: slideNumber:true|“h.v”|“h/v”|“c”|“c/t”
;;
;; #+REVEAL_SLIDE_HEADER: css class slide-header
;; #+REVEAL_SLIDE_FOOTER: css class slide-footer
;; #+OPTIONS: reveal_global_header:t reveal_global_footer:t
;;
;; *** Properties
;; --------------
;; see `org-reveal-slide-section-tag' (org-element-property :xxx headline)
;; :PROPERTIES:
;; :reveal_background: #123456|rgb(0,0,0)|./image/path.jpg
;; :reveal_background_trans: slide
;; :reveal_background_size: 200px
;; :reveal_background_repeat: repeat
;; :reveal_background_opacity: 0.2
;; :reveal_background_iframe: https://domain.tld
;; :END:
;;
;; *** Variables
;; -------------
;; - `org-reveal-root' - string
;; - `org-reveal-extra-css' - string - multiple values separated by \n
;; - `org-reveal-postamble' - string - only one line
;; - `org-reveal-single-file' - t|nil
;; - `org-reveal-hlevel'
;;
;; {{(my-list-to-org-table (org-export-get-all-options 'reveal))}}
;;
;;; Code:
(defgroup my-org nil
"My org-mode concept mapping"
@@ -106,6 +193,42 @@ Example defines
(const (expand-file-name "brain" "~/org"))
(const "~/Sync/workspace/emacs/org-brain")))
(defun my-org-commentary ()
"View org documentation in `outline-mode'."
(interactive)
(let ((buf "*Org: Commentary*"))
;; kill buffer if aleady open
(when (buffer-live-p (get-buffer buf))
(kill-buffer buf))
;; Use `finder-commentary' to generate the buffer.
(require 'finder)
(cl-letf (((symbol-function 'finder-summary) #'ignore))
(finder-commentary "org-settings"))
;; change commentary text
(let ((inhibit-read-only t))
;;(insert "org-settings.el\n\n")
;; point under headline
(forward-line 1)
(save-excursion
;; remove --- under headlines
(while (re-search-forward "^-+$" nil :noerror)
(replace-match ""))
;; replace `xxx' with =xxx=
(goto-char (point-min))
(while (re-search-forward (rx (and "`" (group (+? anything)) "'")) nil :noerror)
(replace-match (concat "=" (match-string 1) "=")))
;; find {{xxx}} and eval xxx
(goto-char (point-min))
(while (re-search-forward (rx (and "{{" (group (+? anything)) "}}")) nil :noerror)
(replace-match (eval (my-eval-string (match-string 1)))))
;; align all tables
(org-table-map-tables 'org-table-align)
))
(rename-buffer buf)
;; Enable `org-mode' and `view-mode' for user convenience.
(org-mode)
(view-mode 1)))
;; uses the org version from the org ELPA repository instead of the
;; one shipped with emacs. Therefore, any org related code should not
;; be loaded before, otherwise both versions will be loaded and will
@@ -1083,5 +1206,6 @@ Suggest the URL title as a description for resource."
:config
(add-hook 'org-brain-visualize-mode-hook #'org-brain-polymode))
(provide 'org-settings)
;;; org-settings.el ends here