Skip to main content

Adds CSS classes to html tags in Pelican documents

Project description

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.

Project details


Download files

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

Files for pelican-add-css-classes, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size pelican_add_css_classes-1.0.4-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pelican-add-css-classes-1.0.4.tar.gz (4.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page