在django中实现羽毛图标的简单标记

django-feather的Python项目详细描述


django羽毛

在django中实现Feather Icons的简单标记({% icon "name" %})。

安装

使用pip安装django-feather,并将其放入INSTALLED_APPS

pip install django-feather

settings.py

INSTALLED_APPS=[# ...'django_feather',# ...]

用法

安装后,可以像使用任何其他标记一样使用标记:

{% load icon %}

<p>Using a string {% icon "coffee" class="css-class" height="8" width="8" %}</p>
<p>Using a variable {% icon self.icon class="css-class" height="8" width="8" %}</p>

标记icon将简单地从feather项目中获取svg源代码, 应用其他属性并返回svg标记。

性能

django-feather不会在每次呈现图标时读取.svg文件。 相反,所有的图标在构建时都会写入到一个.py文件中,就像javascript一样 图书馆。
但是,除了javascript库之外,图标是在服务器端呈现的。 这样可以避免在页面加载后调用feather.replace()

许可证

羽毛是根据MIT License授权的。

django-feather在apache许可下获得许可,版本2.0:

Copyright 2019 Jonas Drotleff <j.drotleff@desk-lab.de>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
maven通过pom文件增加最大java堆大小   java如何在Kojo IDE输出窗格中打印到同一行?   如何使用特定的JRE交付Java应用程序?   java Cordova插件调用日志找不到符号   Java上Redis哈希中的spring列表   java ThreadSafeClientConnManager不是多线程   java如何在激活器中获取IEclipseContext   java如何通过编程更改除法器偏差   在中找不到maven Java/Mvn本地资源。罐包装   JOptionPane的java用户输入验证。showInputDialog   java编辑:如何更改日期对象的日期格式?   文件编写器Java;如何覆盖   一行中包含多个值的java读取属性   java如何在安卓中使用截击上传视频