websemantics / file-icons
PHP特定图标。Atom File-icons的移植版本,https://github.com/file-icons/atom
1.0.1
2017-03-26 21:35 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-20 19:50:34 UTC
README
╭──────┬─╮ ╭─────╮
│ │ │ │
│ ╭─╯╭───╮╭───╮ ╭──────╮ ├─────┤╭──────╮╭──────╮╭────┬─╮╭──────╮
│ ╰─╮├───┤│ │ │ ── │ │ ││ ╭──╯│ ╭╮ ││ ││ ────┤
│ ╭─╯│ ││ │ │ │ │ ││ ╰──╮│ ││ ││ ╭╮ ││ │
│ │ │ ││ │ │ ────┤ │ ││ ││ ╰╯ ││ ││ │├──── │
╰──────╯ ╰───╯╰───╯ ╰──────╯ ╰─────╯╰──────╯╰──────╯╰───╯╰─╯╰──────╯
╭─╮ ╭─╮ ┬─╮ ╭─╮ ┬ ┬ ╭─╮ ╭─╮ ╭─╮ ╭─╮ ┬ ┬ ╭─╮ ╭─╮ ╭┬╮ ┬ ╭─╮ ╭╮╭ ╭─╮
├┤ │ │ ├┬╯ ├─╯ ├─┤ ├─╯ ├─┤ ├─╯ ├─╯ │ │ │ ├─┤ │ │ │ │ │││ ╰─╮
┴ ╰─╯ ┴╰─ ┴ ┴ ┴ ┴ ┴ ┴ ┴ ┴ ┴─╯ ┴ ╰─╯ ┴ ┴ ┴ ┴ ╰─╯ ╯╰╯ ╰─╯
PHP特定图标。Atom File-icons的移植版本,https://github.com/file-icons/atom
安装
1- 使用Composer
按以下方式安装,
composer require websemantics/file-icons
入门指南
创建FileIcons
类的实例。
use Websemantics\FileIcons\FileIcons; $icons = new FileIcons();
在html文档的头部包含css
样式。这将生成一个指向包样式的link
标签。
FileIcons::includeCss();
获取表示文件名的图标的类名,例如text-icon
。
$filename = 'src/index.php'; $class_name = $icons->getClass($filename);
您还可以获取关联图标的颜色类名。
$filename = 'README.md'; $class_name = $icons->getClassWithColor($filename);
使用类名生成html,例如
echo "<a><i class='$class_name'></i>$filename</a>";
查看实现细节 - Markdown Browser Plus。
资源
- Atom File Icons,用于改进视觉grep的文件特定图标。
- Markdown Browser Plus,用于查看markdown文档文件的本地文件浏览器。
支持
需要帮助或有疑问?请在StackOverflow上发帖。
请不要使用问题跟踪器进行支持/提问。
如果您觉得这个项目有用,请星标以表示支持或仅仅因为它是如此出色 :)
贡献
本项目接受以下形式的贡献:反馈、错误报告以及更好的是 - 提交请求。
许可
MIT许可 版权所有 (c) Web Semantics, Inc.