Skip to main content

Django middleware for when you want your fonts to get freaky.

Project description

Freaky Funky Fonts Middleware (Django)

For when you feel the funk that freaks you fonts

What it this?

Freaky Funky Fonts Middleware is essentially a Django “font chaos” middleware package with configurable behaviour.

It intercespts the html of Djangos reponses

Usage

  • Install the package
  • Apply the middleare in your Django project settings as middleare
  • (Optional but recommended) Configure in your freakyfunkyfonts.toml (or .ini for versions before python 3.11)

Installing

pip install django-freakyfunkyfonts

Applying

In the project settings

MIDDLEWARE = [
    # ...
    "freakyfunkyfonts.middleware.FreakyFunkyFontsMiddleware",
]

Configs

Example:

[fonts]
# List of fonts to cycle through
pool = [
  "Times New Roman",
  "Georgia",
  "Merriweather",
  "Lora"
]

[inject]
# Extra tags to inject into <head> (Like a link tag to google fonts)
# More than one tag can be applied, just append to the list
# Make sure that the fonts in the pool are convered
tags = [
  '<link href="https://fonts.googleapis.com/css2?family=Merriweather&family=Lora&display=swap" rel="stylesheet">'
]

[behaviour]
# Scopes to operate on: "all" (If it should work on the whole html document), "body", or any tag names (article, main)
scopes = ["body", "article", "main"]

# HTML tags to skip completely
skip_tags = ['head', 'title', 'meta', 'link', 'style', 'script'] 

Dev

Installing

pip install -e .

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_freakyfunkyfonts-1.1.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_freakyfunkyfonts-1.1.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file django_freakyfunkyfonts-1.1.3.tar.gz.

File metadata

  • Download URL: django_freakyfunkyfonts-1.1.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for django_freakyfunkyfonts-1.1.3.tar.gz
Algorithm Hash digest
SHA256 8e78a06773fae0da6a36ac19979a9e78b7085cdbe1176a0be26bfe043d2db3ba
MD5 333595033024483ce335558da928c544
BLAKE2b-256 02de5c685c82359ea45775aa450271a53f9112e2218bb553739819e000e2369f

See more details on using hashes here.

File details

Details for the file django_freakyfunkyfonts-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_freakyfunkyfonts-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 71f4fea09938644398274f0593b16b10939c6b9b2c903fd509f052a0abcf06b4
MD5 2990d9a9e49f90c5c79a0c337a62be20
BLAKE2b-256 a59c973f9a6dd836111a0d2f754d9b2bd1aa08aa33e33ca723cdd44d432cc903

See more details on using hashes here.

Supported by

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