All Projects → rougier → svg-tag-mode

rougier / svg-tag-mode

Licence: GPL-3.0 license
A minor mode for Emacs that replace keywords with nice SVG labels

Programming Languages

emacs lisp
2029 projects

Projects that are alternatives of or similar to svg-tag-mode

coin-ticker-mode
Emacs minor mode for showing the price of Bitcoin, Ethereum, and other cryptocurrencies.
Stars: ✭ 21 (-93.31%)
Mutual labels:  melpa, minor-mode
emacs2nix
Automatically generate Nix expressions for Emacs packages
Stars: ✭ 23 (-92.68%)
Mutual labels:  melpa
Tags
Exploring usage of custom tags with ScriptableObjects in Unity
Stars: ✭ 77 (-75.48%)
Mutual labels:  tags
tag-picker
Better tags input interaction with JavaScript.
Stars: ✭ 27 (-91.4%)
Mutual labels:  tags
AdvancedHTMLParser
Fast Indexed python HTML parser which builds a DOM node tree, providing common getElementsBy* functions for scraping, testing, modification, and formatting. Also XPath.
Stars: ✭ 90 (-71.34%)
Mutual labels:  tags
wp-tag-order
↕︎ Sort tags manually in individual posts (not site-globally) on WordPress.
Stars: ✭ 16 (-94.9%)
Mutual labels:  tags
SSCTaglistView
Customizable iOS tag list view, in Swift.
Stars: ✭ 54 (-82.8%)
Mutual labels:  tags
bootstrap5-tags
Replace select[multiple] with nices badges for Bootstrap 5
Stars: ✭ 58 (-81.53%)
Mutual labels:  tags
company-flow
No description or website provided.
Stars: ✭ 32 (-89.81%)
Mutual labels:  melpa
ssh-config-mode-el
emacs mode for editing ssh config files.
Stars: ✭ 46 (-85.35%)
Mutual labels:  melpa
tags
A tag manager for Craft 3
Stars: ✭ 23 (-92.68%)
Mutual labels:  tags
psysh.el
PsySH on Emacs, PHP interactive shell (REPL)
Stars: ✭ 27 (-91.4%)
Mutual labels:  melpa
FlowlayoutTags
具有标签功能的流式布局,接口简单。可多选单选,可记住选择状态,状态切换有过渡动画。
Stars: ✭ 78 (-75.16%)
Mutual labels:  tags
react-tags-input
[Not Actively Maintained] An input control that handles tags interaction with copy-paste and custom type support.
Stars: ✭ 26 (-91.72%)
Mutual labels:  tags
FlowLayout
Android流式布局实现热门标签效果
Stars: ✭ 65 (-79.3%)
Mutual labels:  tags
metadata-action
GitHub Action to extract metadata (tags, labels) from Git reference and GitHub events for Docker
Stars: ✭ 492 (+56.69%)
Mutual labels:  tags
cloud-inventory
☁️ ☁️ ☁️ Simple tool to search tagged resources between all AWS resouces
Stars: ✭ 16 (-94.9%)
Mutual labels:  tags
terraform-modules
Terraform Modules by Peak
Stars: ✭ 16 (-94.9%)
Mutual labels:  tags
material-chip-view
Material Chip view. Can be used as tags for categories, contacts or creating text clouds
Stars: ✭ 1,300 (+314.01%)
Mutual labels:  tags
additional tags
Redmine Plugin for adding tags functionality to issues and wiki pages.
Stars: ✭ 25 (-92.04%)
Mutual labels:  tags

svg-tag-mode

A minor mode to replace keywords or regular expression with SVG tags.

Usage example

You need first to set svg-tag-tags that is a list of item here each item has the form (KEYWORD (TAG COMMAND HELP)) where:

  • KEYWORD is a regular expression including a matched group of the form \\(xxx\\). If this is not the case the whole string will be used a the matched group.
  • TAG is either a SVG image that will be displayed using the 'display property or a function that accepts a unique string argument (match-string 1) and returns an SVG image.
  • COMMAND is a command to be executed when user clicks on the tag. It can be nil if no command is associated with the tag.
  • HELP is a string to be displayed when mouse pointer is over the tag. It can be nil if no command is associated with the tag.

then you can invoke mode with M-x svg-tag-mode. Here are some examples:

  1. Replace any occurence of :TODO: with a static SVG tag displaying TODO
(setq svg-tag-tags
      '((":TODO:" . ((lambda (tag) (svg-tag-make "TODO"))))))
  1. Replace any occurence of :HELLO: with a static SVG tag displaying HELLO that can be clicked to execute the specified command. Help message is displayed when the tag is hovered with the pointer.
(setq svg-tag-tags
      '((":HELLO:" .  ((lambda (tag) (svg-tag-make "HELLO"))
                       (lambda () (interactive) (message "Hello world!"))
                       "Print a greeting message"))))
  1. Replace any occurence of :TODO: with a dynamic SVG tag displaying :TODO:
(setq svg-tag-tags
      '((":TODO:" . ((lambda (tag) (svg-tag-make tag))))))
  1. Replace any occurence of :TODO: with a dynamic SVG tag displaying TODO
(setq svg-tag-tags
      '((":TODO:" . ((lambda (tag)
                       (svg-tag-make tag :beg 1 :end -1))))))
  1. Replaces any occurence of :XXX: with a dynamic SVG tag displaying XXX
(setq svg-tag-tags
      '(("\\(:[A-Z]+:\\)" . ((lambda (tag)
                               (svg-tag-make tag :beg 1 :end -1))))))
  1. Replaces any occurence of :XXX|YYY: with two adjacent dynamic SVG tags displaying XXX and YYY
(setq svg-tag-tags
      '(("\\(:[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))))))
  1. This replaces any occurence of :#TAG1:#TAG2:…:$ ($ means end of line) with a dynamic collection of SVG tags. Note the # symbol in front of tags. This is mandatory because Emacs cannot do regex look ahead.
(setq svg-tag-tags
      '(("\\(:#[A-Za-z0-9]+\\)" . ((lambda (tag)
                                     (svg-tag-make tag :beg 2))))
        ("\\(:#[A-Za-z0-9]+:\\)$" . ((lambda (tag)
                                       (svg-tag-make tag :beg 2 :end -1))))))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].