Skip to main content

A Python port of GitHub's Octicons, with Django support

Project description

A Python port of GitHub's Octicons for Django.

Octicons version: v8.0.0

To use, add 'octicons' to your INSTALLED_APPS list; then in your templates:

{% load octicons %}

{% octicon 'check' %}
<br />
{% octicon 'like' width=100 color="blue" class="facebook-like" %}
<br />
{% octicon 'gift' height="10" aria_label='This is a gift for you <3' %}

The first argument is the icon name, or an alias, the remaining arguments must be keyword arguments and they are added as-is(with some exceptions) to the output SVG. The exceptions are:

  • All values are conditionally escaped using Django's built-in conditional_escape function.
  • Any '_'s in the name of a keyword argument will be replaced unconditionally with '-'s
  • Specifying only one of the width or height will fill the other value in maintaining the aspect ratio.
  • Specifying class will cause the classes defined to be added to the two default classes(octicon and octicon-<name> where <name> is the name listed in the data-file; not necessarily the name given).
  • Adding aria-label(keyword argument aria_label) will remove the aria-hidden attribute and set role="img".

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

octicons-0.1.tar.gz (29.6 kB view hashes)

Uploaded Source

Built Distribution

octicons-0.1-py2.py3-none-any.whl (29.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page