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. By default, Reahl merely includes the correct versions of the front-end libraries it needs.
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
and configure your site to use it.
LibraryIndex¶
- 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 anyHTML5Page
.Libraries in a LibraryIndex are included on a page in the order that they appear in the LibraryIndex.
- Parameters:
libraries –
Library
instances (in order) to initialise this LibraryIndex with.
- clear()¶
Removes all Libraries from the list.
- add(library)¶
Adds a Library to the end of the list.
- __contains__(name)¶
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.
Library¶
- 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¶
The unique name of this Library
- egg_name¶
The component (egg) that contains the files of this library
- shipped_in_package¶
The package that contains the files of this library
- files¶
The JavaScript and CSS files that form part of this library (relative to the shipped_in_package)
Reahl¶
- class reahl.web.libraries.Reahl¶
JavaScript and CSS that is part of Reahl itself.
JQuery¶
- class reahl.web.libraries.JQuery¶
Version 3.6.1 of JQuery.
This Library also includes a number of plugins we use internally:
Plugin
Version
jquery.validate
1.19.5 (a heavily modified version) (https://github.com/jquery-validation/jquery-validation/releases/tag/1.19.5)
jquery.ba-bbq
1.3pre
jquery.blockUI
jquery.form
Bootstrap4¶
ReahlBootstrap4Additions¶
- class reahl.web.libraries.ReahlBootstrap4Additions¶
Reahl specific JavaScript and CSS for use with
Bootstrap4
.
HTML5Shiv¶
IE9¶
Holder¶
Popper¶
JQueryUI¶
- class reahl.web.libraries.JQueryUI¶
A heavily customised subset of version 1.13.2 of JQuery UI.
Only contains the Widget Factory and :tabbable, :focusable Selector.