Comments (9)
Sorry for the delay, I was finishing up a term of school. Adding (add-hook 'dashboard-mode 'svg-tag-mode)
seems to make it work just fine.
from svg-tag-mode.
Thanks for the report. I don't quite understand why svg-tag-mode would mess with image display. Is it loaded before or after the dashboard?
from svg-tag-mode.
I tried putting dashboard at the beginning and end on my init and it didn't change anything.
Also, it doesn't seem to interrupt any image display in org mode when use org-display-image-inline.
from svg-tag-mode.
Do you know what is the mode of the dashboard ? (org-mode? text-mode? dashboard-mode?)
from svg-tag-mode.
I believe it's dashboard-mode.
from svg-tag-mode.
What are the tags that you define?
from svg-tag-mode.
Here is my svg-tag setuo.
(use-package svg-tag-mode
:config
(plist-put svg-lib-style-default :font-family "Iosevka Nerd Font")
(plist-put svg-lib-style-default :font-size 13))
(defconst date-re "[0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}")
(defconst time-re "[0-9]\\{2\\}:[0-9]\\{2\\}")
(defconst day-re "[A-Za-z]\\{3\\}")
(defconst day-time-re (format "\\(%s\\)? ?\\(%s\\)?" day-re time-re))
(defun svg-progress-percent (value)
(svg-image (svg-lib-concat
(svg-lib-progress-bar (/ (string-to-number value) 100.0)
nil :margin 0 :stroke 2 :radius 3 :padding 2 :width 11)
(svg-lib-tag (concat value "%")
nil :stroke 0 :margin 0)) :ascent 'center))
(defun svg-progress-count (value)
(let* ((seq (mapcar #'string-to-number (split-string value "/")))
(count (float (car seq)))
(total (float (cadr seq))))
(svg-image (svg-lib-concat
(svg-lib-progress-bar (/ count total) nil
:margin 0 :stroke 2 :radius 3 :padding 2 :width 11)
(svg-lib-tag value nil
:stroke 0 :margin 0)) :ascent 'center)))
;Setting my own face
;(defface myface '((t (:inherit org-todo) :height 1.0 :background "#957DAD")) "Face for todo")
(defface pastelpurple '((t (:inherit org-todo :height 2.0 :foreground "#957DAD"))) "Face for todo")
(defface pastelgreen '((t (:inherit org-todo :height 2.0 :foreground "#B0EB93"))) "Face for WIP")
(defface pastelblue '((t (:inherit org-todo :height 2.0 :foreground "#B3E3DA"))) "Face for DONE")
(defface pastelred '((t (:inherit org-todo :height 2.0 :foreground "#F98284"))) "Face for tags")
(defface pastelpink '((t (:inherit org-todo :height 2.0 :foreground "#FEAAE4"))) "Face for Date")
(defface cyan '((t (:inherit org-todo :height 2.0 :foreground "#00b3b3"))) "Face for Code")
(defface cobolt '((t (:inherit org-todo :height 2.0 :foreground "#0047ab"))) "Face for Verbatim")
(setq svg-tag-tags
`(
;; Task priority [#a]
("\\[#[a-zA-Z]\\]" . ( (lambda (tag)
(svg-tag-make tag :face 'org-priority
:beg 2 :end -1 :margin 0 :inverse t))))
;; Progress [1/3] or [45%]
("\\(\\[[0-9]\\{1,3\\}%\\]\\)" . ((lambda (tag)
(svg-progress-percent (substring tag 1 -2)))))
("\\(\\[[0-9]+/[0-9]+\\]\\)" . ((lambda (tag)
(svg-progress-count (substring tag 1 -1)))))
;; Tags that allow spaces
;; :FIXME: This needs to be fixed
;; :HACK:Fix this regexp
;; :FIX:TJere os more regexp
;; :HACK:Insert text here
("\\([:]\\{1,3\\}\\W?[FIXME|Fixme]*:.*\\)" . ((lambda (tag) (svg-tag-make tag
:face 'cyan
:inverse t
:crop-left t
:beg 7))))
("\\([:]\\{1,3\\}\\W?[FIX|Fix]*:.*\\)" . ((lambda (tag) (svg-tag-make tag
:face 'cyan
:inverse t
:crop-left t
:beg 5))))
("\\([:]\\{1,3\\}\\W?[HACK|PERF|MARK|Hack|NOTE]*:.*\\)" . ((lambda (tag) (svg-tag-make tag
:face 'cyan
:inverse t
:crop-left t
:beg 6))))
("\\([:]\\{1,3\\}\\W?[HACK|Hack|PERF|FIXME|Fixme|FIX|Fix|MARK|NOTE]*:\\)" . ((lambda (tag) (svg-tag-make tag
:face 'cyan
:inverse nil
:margin 0
:crop-right t
:beg 1
:end -1))))
;; Org TAGS
(":TODO:" . ((lambda (tag) (svg-tag-make "TODO" :inverse t :face 'pastelpurple))))
(":WIP:" . ((lambda (tag) (svg-tag-make "WIP" :inverse t :face 'pastelgreen))))
(":DONE:" . ((lambda (tag) (svg-tag-make "DONE" :inverse t :face 'pastelblue))))
(":NOTE:" . ((lambda (tag) (svg-tag-make "NOTE"))))
("SCHEDULED:" . ((lambda (tag) (svg-tag-make "SCHEDULED" :inverse t :face 'cobolt))))
("DEADLINE:" . ((lambda (tag) (svg-tag-make "DEADLINE" :inverse t :face 'cobolt))))
("elisp" . ((lambda (tag) (svg-tag-make "elisp" :face 'cyan))))
("+BEGIN_SRC" . ((lambda (tag) (svg-tag-make "BEGIN" :inverse t :face 'cyan))))
("+END_SRC" . ((lambda (tag) (svg-tag-make "END" :face 'cyan))))
("+RESULTS:" . ((lambda (tag) (svg-tag-make "RESULTS" :inverse t :face 'cobolt))))
("+title" . ((lambda (tag) (svg-tag-make "TITLE" :face 'cobolt))))
("+date" . ((lambda (tag) (svg-tag-make "DATE" :face 'cobolt))))
("+author" . ((lambda (tag) (svg-tag-make "AUTHOR" :face 'cobolt))))
("+OPTIONS" . ((lambda (tag) (svg-tag-make "OPTIONS" :face 'cobolt))))
("+PROPERTY" . ((lambda (tag) (svg-tag-make "PROPERTY" :face 'cobolt))))
("+STARTUP" . ((lambda (tag) (svg-tag-make "STARTUP" :inverse t :face 'cobolt))))
("+BEGIN:" . ((lambda (tag) (svg-tag-make "BEGIN" :inverse t :face 'org-tag))))
("+CAPTION:" . ((lambda (tag) (svg-tag-make "CAPTION" :inverse t :face 'cobolt))))
("+NAME:" . ((lambda (tag) (svg-tag-make "NAME" :face 'cobolt))))
("+END:" . ((lambda (tag) (svg-tag-make "END" :inverse t :face 'org-warning))))
(":X" . ((lambda (tag) (svg-tag-make "[X]" :inverse t :face 'org-checkbox-statistics-done))))
(":-" . ((lambda (tag) (svg-tag-make "[-]" :inverse t :face 'org-checkbox-statistics-todo))))
;; Citation of the form [cite:@Knuth:1984]
("\\(\\[cite:@[A-Za-z]+:\\)" . ((lambda (tag)
(svg-tag-make tag
:inverse t
:beg 7 :end -1
:crop-right t))))
("\\[cite:@[A-Za-z]+:\\([0-9]+\\]\\)" . ((lambda (tag)
(svg-tag-make tag
:end -1
:crop-left t))))
;;; Works for stuff like :XXX|YYY:
("\\(:[A-Z]+\\)\|[a-zA-Z#0-9]+:" . ((lambda (tag)
(svg-tag-make tag :beg 1 :inverse t
:margin 0 :crop-right t))))
(":[A-Z]+\\(\|[a-zA-Z#0-9]+:\\)" . ((lambda (tag)
(svg-tag-make tag :beg 1 :end -1
:margin 0 :crop-left t))))
;; Active date (with or without day name, with or without time)
;; <2023-04-03 Sun 17:45>
(,(format "\\(<%s>\\)" date-re) .
((lambda (tag)
(svg-tag-make tag :beg 1 :end -1 :margin 0))))
(,(format "\\(<%s \\)%s>" date-re day-time-re) .
((lambda (tag)
(svg-tag-make tag :beg 1 :inverse t :crop-right t :margin 0 :face 'org-agenda-date))))
(,(format "<%s \\(%s>\\)" date-re day-time-re) .
((lambda (tag)
(svg-tag-make tag :end -1 :inverse nil :crop-left t :margin 0 :face 'org-agenda-date))))))
(require 'svg-tag-mode)
;(global-svg-tag-mode 1)
(add-hook 'prog-mode-hook 'svg-tag-mode)
(add-hook 'org-mode-hook 'svg-tag-mode)
(use-package svg-lib)
from svg-tag-mode.
Sorry for delay. Can you try adding svg-tag-mode to the dashboar-mode ? Also, if the dashboard-mode does not use font-lock-mode, you'll need to activate it.
from svg-tag-mode.
I just hit this as well. Not sure that the hook mentioned above is the correct fix.
However, the fix in #27 is working in dashboard-mode too 🎉
(add-hook 'dashboard-mode-hook #'eli-org-agenda-show-svg)
As this is affecting more than org-mode, maybe this function should be added to svg-tag-mode? What do you think @rougier?
from svg-tag-mode.
Related Issues (20)
- Only progress bars work HOT 4
- How to change SVG Colors HOT 6
- [Feature Request] Disable tags inside org src blocks HOT 10
- Font size messed up HOT 13
- left mouse clicks on svg tags not working as expected (doom emacs / org-mode) HOT 7
- Does not work if tree-sitter is enabled HOT 2
- Question: How to enable in minibuffer? HOT 3
- Change font family with svg-tag-default-face HOT 2
- Question: Tags with spaces between characters HOT 2
- destructive influence of possible recent updates of either org-mode or svg-tag-mode HOT 1
- svg-tag for begin_src destroy the font lock in emacs 29 HOT 23
- Minibuffer constantly has "SVG tag mode on", hides other messages
- svg-tag-mode causing issue with src block on Emacs 29 HOT 1
- Progress bar not working HOT 14
- Strange shift error HOT 1
- Add cache for SVG tags? HOT 2
- Problem with active/inactive date (from example 2) HOT 4
- Square Brackets not matching Correctly HOT 1
- Problem while editing time and date tags in org mode HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg-tag-mode.