GithubHelp home page GithubHelp logo

Comments (3)

Caraczan avatar Caraczan commented on May 29, 2024

I didn't see that there already is icon for license. Didn't know since it doesn't show up for me.
In project I have license file with just LICENSE name.
image

I saw in tmPreference scope it doesn't seem to have such rule implemented. So i tried locally to add another rule, added LICENSE, as shown below

...
<key>scope</key>
    <string>text.plain.license, text.html.markdown.license, LICENSE</string>
...

But it didn't work. I searched in documentation but didn't see anywhere, for this rule to assign icon by fixed name.

from fileicons.

braver avatar braver commented on May 29, 2024

Licenses are just plain text files. There are no packages in package control that make syntaxes specifically for licenses. There are also no recognizable characteristics of these files to make a syntax work for them automatically. Therefore it's impossible to make specific icons for them (as far as I know).

from fileicons.

jwortmann avatar jwortmann commented on May 29, 2024

@braver You already have an icon for license files in this package: https://github.com/braver/FileIcons/blob/master/theme/file_type_license.png, and also the corresponding preferences file: https://github.com/braver/FileIcons/blob/master/preferences/file_type_license.tmPreferences

The only missing part is, that it's not applied due to the missing syntax. You could add one into the https://github.com/braver/FileIcons/tree/master/syntaxes folder, like this:

%YAML 1.2
---
# https://www.sublimetext.com/docs/syntax.html
name: Plain Text (License)
file_extensions:
  - LICENSE
  - LICENSE.txt
scope: text.plain.license
hidden: true

contexts:
  main:
    - include: scope:text.plain#prototype
    - include: scope:text.plain

And possibly another one for files named LICENSE.md, by adjusting name to Markdown (License), file_extensions to - LICENSE.md and deriving from the Markdown syntax.

There are also no recognizable characteristics of these files to make a syntax work for them automatically

License files are usually characterized by a standardized file name, either plain LICENSE, or sometimes LICENSE.md or LICENSE.txt. The file_extensions key name in Sublime syntax definitions might be a bit misleading, but it does work for full filenames (see example above).


Edit: reading through some other issues, it appears that providing syntax aliases for non-binary files in this repository is unwanted. So a quick solution for users would be, to place such a file containing the code block above into e.g. the Packages/User folder themselves. It must be saved with .sublime-syntax extension. And here is another variant which would enable the icon for LICENSE.md files:

%YAML 1.2
---
# https://www.sublimetext.com/docs/syntax.html
name: Markdown (License)
file_extensions:
  - LICENSE.md
scope: text.html.markdown.license
hidden: true

contexts:
  main:
    - include: scope:text.html.markdown#prototype
    - include: scope:text.html.markdown

from fileicons.

Related Issues (20)

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.