mikedingjan-archive / django-svg-icons

Django templatetag library for rendering SVG icons from JSON file
http://django-svg-icons.readthedocs.io/en/latest/
Apache License 2.0
5 stars 2 forks source link

Cannot import other icons #4

Open trianglesis opened 6 years ago

trianglesis commented 6 years ago

Exception traceback: http://127.0.0.1:8000/ 1.11.6 KeyError 'icons' C:\Python34\lib\site-packages\svg_icons\readers\icomoon.py in read_source_file, line 33

C:\Python34\lib\site-packages\svg_icons\readers\icomoon.py in read_source_file

    data = json.load(open(self.source_file, 'r'))
    for icon in data['icons']: ...
        props, icon_data = icon.get('properties'), icon.get('icon')

data | {'alert': {'keywords': ['warning', 'triangle', 'exclamation', 'point']},

Installing from https://octicons.github.com/

Probably because JSON have another key or usual key is absent.

mikedingjan commented 6 years ago

The data.json file doen't contain any SVG Path info, so can be used with django-svg-icons.. However it should be possible to create a new reader class which can read the SVG data from the filesystem icons.