Skip to main content

Django templatetags for GitHub's Octicons.

Project description

django-octicons

Build Status

Template tags for Django to use GitHub Octicons.

Installation

Grab it from PyPI using pipenv (or pip):

$ pipenv install django-octicons

Install the app in your project:

# settings.py

INSTALLED_APPS = [
    # other apps
    'octicons',
]

Usage

Load the tag library in your HTML template:

{% load octicons %}

And then, you can use the icons like this:

<a class="btn btn-sm" href="#url" role="button">
  {% octicon "eye" %}
  Watch
</a>

You can also pass any required attributes:

<a class="btn btn-sm" href="#url" role="button">
  {% octicon "thumbsup" height="60" class="large" %}
  Confirm Purchase
</a>

All attributes passed will be added as HTML attributes to the SVG element of the icon.

Styling

You should add the following in your styles:

.octicon {
  display: inline-block;
  vertical-align: text-top;
  fill: currentColor;
}

The class octicon will be present in all icons. You are free to style it however you want.

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

django-octicons-1.0.2.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

django_octicons-1.0.2-py2.py3-none-any.whl (28.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-octicons-1.0.2.tar.gz.

File metadata

  • Download URL: django-octicons-1.0.2.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for django-octicons-1.0.2.tar.gz
Algorithm Hash digest
SHA256 ca6db160a17465d364f153b4e6698435d7c18f1f166cc0d9735b1bb5385dff12
MD5 9faad3ba88457a3dad3238c24cd1bfc4
BLAKE2b-256 42c0e79ab9d3768527fa46e4fa8c0cf06d1abd193b886f54b1db0468354960a1

See more details on using hashes here.

File details

Details for the file django_octicons-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: django_octicons-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 28.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for django_octicons-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7fb395e8fef44df2ccba0a5c39c961d3bcae66276a2374e1954d4b3486d23c62
MD5 f832102e06ef3e6b1c3ebf93337455bf
BLAKE2b-256 b194933c7cffcded9a735dc1bf187f166a7f702eab4bbd1af09d109d5f30bedc

See more details on using hashes here.

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