Module reahl.web.libraries

New in version 3.2.

Reahl uses CSS and JavaScript from other projects. The CSS and JavaScript world has its own ecosystem of tools that allow you to do various things, for example:

  • Compile your own customised CSS using a CSS preprocessor like Sass.
  • Manage the versions and interdependencies of such projects.
  • Some code is hosted on Content Delivery Networks (CDNs).
  • Some code is minified.

This module is a start towards supporting such “front-end frameworks” which Reahl depends upon. Currently, Reahl merely includes the correct versions of the front-end libraries it needs and a user is not able to customise these in any way. In the future we hope to extend this infrastructure to be able to make use of everything the JavaScript / CSS tool ecosystem offers.

Reahl also contains its own JavaScript and CSS code. Where we do this, our own code is also managed using this same infrastructure.

If you write your own Widgets that make use of CSS or JavaScript, creating a Library is the way to do it going forward.


class reahl.web.libraries.LibraryIndex(*libraries)

An ordered collection of Library instances.

A LibraryIndex instance is available in the configuration as web.config.frontend_libraries. All the Library instances contained in web.config.frontend_libraries are included on any HTML5Page.

Libraries in a LibraryIndex are included on a page in the order that they appear in the LibraryIndex.

Parameters:librariesLibrary instances (in order) to initialise this LibraryIndex with.

Removes all Libraries from the list.


Adds a Library to the end of the list.


An implementation of the in operator, so that one can ask whether a library with given name is in this index.

Parameters:name – The unique name of the Library to check for.


class reahl.web.libraries.Library(name)

A frontend-library: a collection of CSS and JavaScript code that can be used with Reahl.

To create your own Library, subclass from this class and set its attributes to indicate which files to include as part of it and where to find them.

To use a library, add it to the web.config.frontend_libraries config setting. The CSS and JavaScript files of all such configured libraries are automatically included in any HTML5Page.

Parameters:name – A unique name for this Library.
name = None

The unique name of this Library

egg_name = None

The component (egg) that contains the files of this library

shipped_in_directory = None

The directory that contains the files of this library (relative to the egg root)

files = None

The JavaScript and CSS files that form part of this library (relative to the shipped_in_directory)


class reahl.web.libraries.Reahl

JavaScript and CSS that is part of Reahl itself.


class reahl.web.libraries.JQuery

Version 3.3.1 of JQuery.

This Library also includes a number of plugins we use internally:

Plugin Version
jquery.cookie 1.0
jquery.validate 1.17.0 (a heavily modified version) 1.3pre
jquery.blockUI 2.70.0
jquery.form 4.2.2


class reahl.web.libraries.Bootstrap4

Version 4.1.1 of Bootstrap.


class reahl.web.libraries.ReahlBootstrap4Additions

Reahl specific JavaScript and CSS for use with Bootstrap4.


class reahl.web.libraries.HTML5Shiv

Version 3.7.3 of html5shiv.


class reahl.web.libraries.IE9

Version 2.1(beta4) of IE9.js.


class reahl.web.libraries.Holder

Version 2.9.0 of Holder.


class reahl.web.libraries.Popper

Version 1.12.9 (umd) of Popper.


class reahl.web.libraries.JQueryUI

A heavily customised subset of version 1.12.1 of JQuery UI.

Only contains the Widget Factory.