A `Django`_ app to deploy wefonts from `Icomoon`_ and display them
Project description
A Django app to deploy downloaded wefonts from Icomoon and display them in a gallery.
Links
Download his PyPi package;
Clone it on his Github repository;
Requires
Django >= 1.4;
django-braces >= 1.2.0,<1.4;
Install
First install the package
pip install django-icomoon
Add it to your installed Django apps in settings :
INSTALLED_APPS = ( ... 'icomoon', ... )
Import default app settings:
from icomoon.settings import *
Default behavior require users to be authenticated to view the gallery, if you want to open it for anonymous define the following setting:
ICOMOON_PRIVATE = False
Webfonts and manifests
Now you must define at least one webfont in your project settings like this:
ICOMOON_MANIFEST_FILEPATH = { 'Default': { 'fontdir_path': '/home/work/myproject/webapp_statics/fonts/default', 'csspart_path': '/home/work/myproject/webapp_statics/css/icomoon_icons.scss' }, }
Each website entry is a dict containing the following values:
- fontdir_path
(Required) Absolute path to the webfont directory.
- csspart_path
(Optional) Absolute path where will be written the css part containing webfont icons.
Urls
Just mount its urls in your main urls.py :
urlpatterns = patterns('', ... (r'^icomoon/', include('icomoon.urls', namespace='icomoon')), ... )
Templates
This at your responsability to load the webfont into your website templates, this app won’t do it for you.
Note that shipped templates in templates/icomoon/ are written using Foundation5 components and inherits from a templates/skeleton.html that you have to create yourself. You better gives an eye to this app templates to correctly integrate them into your project.
Usage
Gallery
When it’s installed you could reach the webfont gallery from /icomoon/.
The gallery display all defined icons in the manifest, giving the CSS classname, the unicode codepoint and the UTF-8 code.
Deployment
Put the downloaded ZIP archive on your server then simply use the command line:
./manage.py icomoon_deploy Default icomoon.zip
The first argument is the webfont key name (defined in your settings, see Webfonts and manifests) to use and the second argument is the path to your downloaded archive to deploy:
./manage.py icomoon_deploy [Webfont name] [Zip archive path]
The tool will validate the archive content structure then if all requirements are meets (a JSON manifest and at least one supported font format) it will deploy the archive content to defined path (fontdir_path) in webfont settings.
Optionaly, if a path (csspart_path) is defined for, the manifest will be used to build a css file where all icon selectors are defined, so you can import it to directly use your icons.
Finally the manifest is installed in the same directory than font files.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-icomoon-0.3.0.tar.gz
.
File metadata
- Download URL: django-icomoon-0.3.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f85217e3595ccf1da4ea7131a33b2be5e6f5a79f227ef85c1eb4cdc4d3fdaddc |
|
MD5 | 01590705a5d5af3b57d323de2cdc1f13 |
|
BLAKE2b-256 | e33ec6f31ec97cd92567d2651e405c00b2af1902c8888c6a8ac846334426c46f |