Code Monkey home page Code Monkey logo

kirbytag-svg's Introduction

SVG Kirbytag

A kirbytag for outputting SVG images inline with a number of customizable attributes.

Requirements

Compatibility

  • Kirby 3.5+
  • Kirby 4+

Installation

kirby plugin:install scottboms/kirbytag-svg

Git Submodule

$ git submodule add https://github.com/scottboms/kirbytag-svg.git site/plugins/kirbytag-svg

Copy and Paste

  1. Download the contents of this repository as a Zip file.
  2. Rename the extracted folder to kirbytag-svg and copy it into the site/plugins/ directory in your Kirby project.

Usage

(svg: yourfile.svg)

Optionally, you can specify a custom wrapper element to wrap the SVG along with class and role attributes that will be applied to that element. If class or role attributes are included but no wrapper element, a 'figure' element will be used.

Optional Tag Attributes

  • wrapper: A wrapper element to surround the SVG when output in your template [optional]
  • class: A CSS class/classes to append to the wrapper element [optional]
  • role: A role attribute appended to the wrapper element [optional]

Example usage:

(svg: /img/deke.svg)
(svg: lerxst.svg wrapper: figure class: svg role: img)
(svg: /assets/icons/pratt.svg wrapper: div class: icon)

Configuration Options

You can add a default wrapper element to SVGs using the provided config option that can be added to your config.php file as shown.

'scottboms.kirbytag-svg.wrapper' => 'div',

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

You are prohibited from using this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

License

MIT

kirbytag-svg's People

Contributors

scottboms avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

kirbytag-svg's Issues

Pic for textarea button.

Add pic showing it in button bar.
Perhaps add ability to add attributes in modal? That'd be amazing but probably not important.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.