emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org-modern 012679e9b2 1/3: Add custom style to inner li


From: ELPA Syncer
Subject: [elpa] externals/org-modern 012679e9b2 1/3: Add custom style to inner links (#20)
Date: Fri, 3 Jun 2022 09:57:46 -0400 (EDT)

branch: externals/org-modern
commit 012679e9b24ea5ae3a613d9a607d9bdfa230e2d7
Author: Scarlett <82218266+roygbyte@users.noreply.github.com>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Add custom style to inner links (#20)
    
    Co-authored-by: Daniel Mendler <mail@daniel-mendler.de>
---
 example.org   |  6 ++++++
 org-modern.el | 18 ++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/example.org b/example.org
index 6182165e58..a7da047753 100644
--- a/example.org
+++ b/example.org
@@ -93,3 +93,9 @@ TREPEATED: <2022-02-26 Sat 10:00 .+1d/2d>
 | 2 |  4 |  8 | 16 |  1.4142 |     1.1892 |
 | 3 |  9 | 27 | 81 |  1.7321 |     1.3161 |
 |---+----+----+----+---------+------------|
+
+* Internal Links
+
+<<This is an internal link>>
+
+[[This is an internal link]]
diff --git a/org-modern.el b/org-modern.el
index 4b59769daf..6917f1ec5f 100644
--- a/org-modern.el
+++ b/org-modern.el
@@ -168,6 +168,10 @@ If set to a string, e.g., \"‣\", the string is used as 
replacement for #+."
                  (string :tag "Custom replacement")
                  (const :tag "Triangle bullet" "‣")))
 
+(defcustom org-modern-internal-link '(" ↪ " t " ")
+  "Prettify internal links, e.g., <<introduction>>."
+  :type '(choice nil (list string boolean string)))
+
 (defcustom org-modern-statistics t
   "Prettify todo statistics."
   :type 'boolean)
@@ -207,6 +211,13 @@ You can specify a font `:family'. The font families 
`Iosevka', `Hack' and
     (t :foreground "white"))
   "Face used for tag labels.")
 
+(defface org-modern-internal-link
+  '((default :inherit org-modern-label)
+    (((background light))
+     :background "gray35" :foreground "white" :distant-foreground "black")
+    (t :background "gray75" :foreground "black" :distant-foreground "white"))
+  "Face used for internal link.")
+
 (defface org-modern-done
   '((default :inherit org-modern-label)
     (((background light)) :background "gray90" :foreground "black")
@@ -531,6 +542,13 @@ You can specify a font `:family'. The font families 
`Iosevka', `Hack' and
       (when org-modern-tag
         `((,(concat "^\\*+.*?\\( \\)\\(:\\(?:" org-tag-re ":\\)+\\)[ \t]*$")
            (0 (org-modern--tag)))))
+      (when org-modern-internal-link
+        `(("\\(<<\\)\\(.+?\\)\\(>>\\)"
+           (0 '(face org-modern-internal-link) t)
+           (1 '(face nil display ,(car org-modern-internal-link)))
+           ,(unless (cadr org-modern-internal-link)
+              '(2 '(face nil invisible t)))
+           (3 '(face nil display ,(caddr org-modern-internal-link))))))
       (when org-modern-timestamp
         '(("\\(?:<\\|\\[\\)\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\(?: 
[[:word:]]+\\)?\\(?: [.+-]+[0-9ymwdh/]+\\)*\\)\\(\\(?: [0-9:-]+\\)?\\(?: 
[.+-]+[0-9ymwdh/]+\\)*\\)\\(?:>\\|\\]\\)"
            (0 (org-modern--timestamp)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]