GithubHelp home page GithubHelp logo

websemantics / file-icons Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 3.0 292 KB

File specific icons for PHP. A port of Atom File-icons, https://github.com/file-icons/atom

CSS 30.22% PHP 69.78%
php icons fontawesome octicons mfizz devicons

file-icons's Introduction

╭──────┬─╮                       ╭─────╮
│        │                       │     │
│      ╭─╯╭───╮╭───╮ ╭──────╮    ├─────┤╭──────╮╭──────╮╭────┬─╮╭──────╮
│      ╰─╮├───┤│   │ │  ──  │    │     ││   ╭──╯│   ╭╮ ││      ││  ────┤
│      ╭─╯│   ││   │ │      │    │     ││   ╰──╮│   ││ ││   ╭╮ ││      │
│      │  │   ││   │ │  ────┤    │     ││      ││   ╰╯ ││   ││ │├────  │
╰──────╯  ╰───╯╰───╯ ╰──────╯    ╰─────╯╰──────╯╰──────╯╰───╯╰─╯╰──────╯
╭─╮ ╭─╮ ┬─╮    ╭─╮ ┬ ┬ ╭─╮   ╭─╮ ╭─╮ ╭─╮ ┬   ┬ ╭─╮ ╭─╮ ╭┬╮ ┬ ╭─╮ ╭╮╭ ╭─╮
├┤  │ │ ├┬╯    ├─╯ ├─┤ ├─╯   ├─┤ ├─╯ ├─╯ │   │ │   ├─┤  │  │ │ │ │││ ╰─╮
┴   ╰─╯ ┴╰─    ┴   ┴ ┴ ┴     ┴ ┴ ┴   ┴   ┴─╯ ┴ ╰─╯ ┴ ┴  ┴  ┴ ╰─╯ ╯╰╯ ╰─╯

File specific icons for PHP. A port of Atom File-icons, https://github.com/file-icons/atom

Icon previews

Install

1- Use Composer to install as follows,

composer require websemantics/file-icons

Getting Started

Create an instance of FileIcons class.

use Websemantics\FileIcons\FileIcons;

$icons = new FileIcons();

Include css styles in the header of an html document. This will generate a link tag that points to the package stylesheet.

FileIcons::includeCss();

Get the class name of the icon that represent a filename, for example text-icon.

$filename = 'src/index.php';
$class_name = $icons->getClass($filename);

You can also get a class name of the associated icon color.

$filename = 'README.md';
$class_name = $icons->getClassWithColor($filename);

Use the class name to generate html, for example

echo "<a><i class='$class_name'></i>$filename</a>";

Check out - Markdown Browser Plus to see implementation details.

Resources

Support

Need help or have a question? post at StackOverflow.

Please don't use the issue trackers for support/questions.

Star if you find this project useful, to show support or simply for being awesome :)

Contribution

Contributions to this project are accepted in the form of feedback, bugs reports and even better - pull requests.

License

MIT license Copyright (c) Web Semantics, Inc.

file-icons's People

Contributors

websemantics avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ilias-sp shemgp

file-icons's Issues

icon for .txt files is not showing up

hi and thanks for your library!

i noticed that when using your library, the .txt files are not getting their file icon displayed. i believe it has to do with the mapping you used "icon-file-text" in icondb.php, which doesnt exist in the css.

what i did to overcome the issue is replace in that file the "icon-file-text" with "text-icon" which does exist in the css file.

if you are interested for a pull request to fix that, plz let me know and will do it.

thanks

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.