gwsumm.html.bootstrap module

Helper functions for twitter-bootstrap HTML constructs.

gwsumm.html.bootstrap.banner(title, subtitle=None, titleclass=None, subtitleclass=None)[source]

Construct a banner heading in bootstrap format

Parameters:
titlestr

name of page (<h1>)

subtitlestr, optional

description of page (<p>)

titleclassstr, optional

class option for <h1>

subtitleclassstr, optional

class option for <p>

Returns:
banner~MarkupPy.markup.page

markup.py page instance

gwsumm.html.bootstrap.base_map_dropdown(this, id_=None, bases={})[source]

Construct a dropdown menu that links to a version of the current page on another server, based on a new base.

gwsumm.html.bootstrap.calendar(date, tag='a', class_='nav-link dropdown-toggle', id_='calendar', dateformat=None, mode=None)[source]

Construct a bootstrap-datepicker calendar.

Parameters:
date:class:`datetime.datetime`, :class:`datetime.date`

active date for the calendar

tagstr

type of enclosing HTML tag, default: <a>

Returns:
calendarlist

a list of three oneliner strings of HTML containing the calendar text and a triggering dropdown

gwsumm.html.bootstrap.state_switcher(states, default=0)[source]

Build a state switch button, including all of the given states, with the default selected by index

gwsumm.html.bootstrap.wrap_content(page)[source]

Utility to wrap some HTML into the relevant <div>s for the main body of a page in bootstrap format

Parameters:
page:class:`~MarkupPy.markup.page`, str

HTML content to be wrapped

spanint

column span of content, default: ‘full’ (12)

Returns:
wrappedpage:class:`~MarkupPy.markup.page`

A new page with the input content wrapped as

<div class="container">
</div>