Skip to main content

django-octicons-v10

GitHub .github/workflows/main.yml PyPI PyPI - Python Version Downloads

Octicons cover

Django templatetags for GitHub Octicons v10.0.0+.

Current version v4.1.0 supports Octicons v16.1.0.

This library aims to provide a similar interface to the official JavaScript and Ruby octicon libraries provided by GitHub, but as Django templatetags.

django-octicons is a library that already does this, but currently for an older version of octicons.

Installation

Install the latest version:

pip3 install django-octicons-v10

Place octicons_v10 into your installed apps:

INSTALLED_APPS = [
    # blah, blah, other apps...
    "octicons_v10",
]

Usage

Load the octicons tag library in your Django template:

{% load octicons %}

Use template tags where you want to place an Octicon:

{% octicon "git-branch" %}

Classes

You can pass classes to your shiny new octicon:

<a class="btn">
    {% octicon "git-branch" class="text-purple" %}
    Branches
</a>

Note: The following classes are assigned to the octicon by default:

  • octicon
  • octicon-{ICON_NAME}, for example octicon-git-branch

Sizing

You can pass width or height or both for your desired size:

<a href="#" class="Header-link">
    {% octicon "mark-github" width="32" %}
    GitHub
</a>

If only width or height is passed, then the other scales accordingly.

Note: The default size is 16px by 16px.

16px and 24px variants

The icon variant chosen is dependent on the size specified. If either your width or height is more than 16, then the 24px variant will be chosen.

What if I want to specify a variant regardless of size?

If say, you wanted a 32 width icon, but wanted to use the 16px variant, you can do so by specifying the whole variant name, in the form {ICON_NAME}-{ICON_SIZE}:

{% octicon "alert-16" width="32" %}

Keywords

Octicons provides a list of keywords for each icon. You can get an Octicon instance's keywords by accessing its keywords attribute:

>>> octicon = Octicon("octoface")
>>> octicon.keywords
['octocat', 'brand']

When using the GitHub logos, be sure to follow the GitHub logo guidelines.

Issues

Please use the GitHub issue tracker to track issues.

Contributing

Contributions are welcome. Please send a pull request through and explain the reasoning behind the change.

Building

To automatically pull the latest versions of octicons, run:

python3 scripts/build/build.py build octicons_v10/templatetags

In the root folder of the repository.

Metadata

Release files for django-octicons-v10 4.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-octicons-v10 4.1.0
File Size Uploaded Provenance Actions
django-octicons-v10-4.1.0.tar.gz 72.9 kB Without provenance Details for django-octicons-v10-4.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-octicons-v10 4.1.0
File Interpreter ABI Platform Actions
django_octicons_v10-4.1.0-py3-none-any.whl Python 3 none any Details for django_octicons_v10-4.1.0-py3-none-any.whl

Total release size: 146.2 kB

Release files / django-octicons-v10-4.1.0.tar.gz

Download URL django-octicons-v10-4.1.0.tar.gz
Size 72.9 kB
Tags Source
SHA-256 checksum
How to use checksums
bccd8b6872a11c56df1bc420abc2eb7be36f84c6f5a5acb5f95b3dca2f74b2f4
BLAKE2b-256 checksum
How to use checksums
b119ea4b8fa44d8ed9a4c1eb52a0e4fb6f96361f9a45d4eff266e0ecfd5789a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / django_octicons_v10-4.1.0-py3-none-any.whl

Download URL django_octicons_v10-4.1.0-py3-none-any.whl
Size 73.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0db52b420062f374747fa00a6517abc77ec966766337adea0e48596f10f6517d
BLAKE2b-256 checksum
How to use checksums
75ffe8baae9418dccee35e21982222ce129ec21d0c74a2382757e70e84f0c592
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Security for django-octicons-v10 4.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page