在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第三方库


热门话题
java用arraylist中的单词替换txt文件中的单词?   java为ProgressBar提供了一个解决方案。是否接受整数?   java添加鼠标侦听器以删除目标   java删除标点符号的简单程序   java JavaScriptException:(TypeError):无法调用null的方法“getBoundingClientRect”   java我可以在没有对话框的情况下卸载应用程序吗?   执行泛型Java类   如果主线程从不调用线程,那么线程中断的原因是什么。中断()?   导致其他组件不显示的java绘制方法   java ObjectMapper追加文件JSON   Netbeans Java:将我的CSV文件放在哪里?   bouncycastle RSAKeyParameters中的java公钥   java为什么我总是在这个字符串数组中输入a1字符串?   java使用匿名绑定连接到AD并搜索用户DN   从JSP文件向Java应用程序发送socket?