Skip to main content

Add css classes: A Plugin for Pelican

Adds CSS classes to html tags in Pelican documents

Motivation

When we want to create a page or article we often use Markdown or RST. This allows us to write content very fast, but it gives us little to no control over the styling of our page.

That is why I created this plugin for Pelican so we can add classes to HTML elements inside pelicanconf.py.

Usage

Both pages and articles

To set css classes that should be added to elements in both pages and articles you can use ADD_CSS_CLASSES.

You can also set which css classes should be added to elements on pages with ADD_CSS_CLASSES_TO_PAGE.

And this can also be done with articles using ADD_CSS_CLASSES_TO_ARTICLE.

Example

Let's say you want to configure all tables to use Bootstrap, show black tables on pages and red headers on articles.

ADD_CSS_CLASSES = {
    "table": ["table"]
}

ADD_CSS_CLASSES_TO_PAGE = {
    "table": ["table", "table-dark"]
}

ADD_CSS_CLASSES_TO_ARTICLE = {
    "h1": ["text-danger"]
}

Installation

This plugin can be installed via:

pip install pelican-add-css-classes

Contributing

Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.

To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.

Release files for pelican-add-css-classes 1.0.4

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

Source distribution (sdist)

Source distribution for pelican-add-css-classes 1.0.4
File Size Uploaded
pelican-add-css-classes-1.0.4.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pelican-add-css-classes 1.0.4
File Interpreter ABI Platform
pelican_add_css_classes-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / pelican-add-css-classes-1.0.4.tar.gz

Download URL pelican-add-css-classes-1.0.4.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d021fd293323d68fd53bb00e7a14f25674d77b6d14efef514ea57482a8d95fda
BLAKE2b-256 checksum
How to use checksums
020ebb2dfd93873d12d8edad29f30098342255646975f8ed2408a113aff07004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.17 CPython/3.7.5 Darwin/18.7.0

Release files / pelican_add_css_classes-1.0.4-py3-none-any.whl

Download URL pelican_add_css_classes-1.0.4-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64e51645880638207b402c6fd08a8286bf0db8f5a055bf0561b2d19ce79445a9
BLAKE2b-256 checksum
How to use checksums
036815f96fa04d2c649fff945289a8a447da261d14e287274536c858e82184fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.17 CPython/3.7.5 Darwin/18.7.0

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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