Utilties for HTML output

class, caption=None)[source]

Bases: object

A helpful class of objects that coalesce image links and caption text for fancybox figures.


img : str or FancyPlot

either a filename (including relative or absolute path) or another FancyPlot instance

caption : str

the text to be displayed in a fancybox as this figure’s caption, packagelist=True)[source]

Write a blurb documenting how a page was generated, including the command-line arguments and configuration files used


config : str, list, optional

the absolute path(s) to one or a number of INI files used in this process

packagelist : bool, optional

boolean switch to include (True) or exclude (False) a comprehensive list of system packages


page : page

the HTML page to be inserted into the #main <div>.

Write a channel name as a link to the Channel Information System


channel : str

the name of the channel to link


other HTML parmeters for the <a> tag

html : str, target, **kwargs)[source]

Close an HTML document with markup then write to disk

This method writes the closing markup to complement the opening written by init_page, something like:

    <!-- some stuff -->

page :

the markup object to close

target : str

the output filename for HTML, links, active=None, class_='dropdown-toggle')[source]

Construct a dropdown menu in bootstrap format


text : str

dropdown menu header

links : list

list of (Link text, linkurl) tuples or dict of such tuples for grouped dropdowns

active : int or list of ints, optional

collection of links to make active, default: None

class_ : str, optional

object class of the dropdown menu, default: 'dropdown-toggle'


page : page

HTML element with the following grammar: .. code:: html

<a>text</a> <ul>

<li>link</li> <li>link</li>


Format links within a dropdown menu


page : page

a page object to format in-place

link : page or list

the link(s) to format

active : bool, optional

boolean switch to enable (True) or disable (False) an active link, default: False

class_ : str, optional

object class of the link, default: '', linkparams={}, **params)[source]

Return the markup to embed an <img> in HTML


img : FancyPlot

a FancyPlot object containing the path of the image to embed and its caption to be displayed

linkparams : dict

the HTML attributes for the <a> tag


the HTML attributes for the <img> tag


page : page

the markup object containing fancyplot HTML, cssfiles, jsfiles)[source]

Finalise the necessary CSS and javascript files as URLS.

The method parses the lists of files given, copying any local files into static as necessary to create resolvable URLs to include in the HTML <head>.


static : str

the target directory for the static files, will be created if necessary

cssfiles : list of str

the list of CSS files to include

jsfiles : list of str

the (complete) list of javascript files to include


cssurls : list of str

the finalised list of CSS files

jsurls : list of str

the finalised list of javascript files, name, gps, about=None)[source]

Return a brand for navigation bar formatting


ifo : str

interferometer prefix for color-coding, e.g. 'L1'

name : str

name of the analysis, e.g. 'Scattering'

gps : float

GPS second of the analysis

about : str, optional

relative path to the about page for this analysis, default: None


brand : page

the navbar brand page object

class_ : str

object class of the navbar'bash')[source]

Render the command line invocation used to generate a page


language : str, optional

type of environment the code is run in, default: 'bash'


page : page

fully rendered command-line arguments

Write an HTML <a> tag


href : str

the URL to point to

txt : str

the text for the link

target : str, optional

the target of this link


other HTML parameters for the <a> tag

html : str, class_='navbar navbar-fixed-top', brand=None, collapse=True)[source]

Construct a navigation bar in bootstrap format


links : list

list of either (text, URL) tuples or page objects. Tuples will be written in <a> tags while pages will be copied directly. Both will be enclosed in a <li> element inside the navbar

class_ : str, optional

navbar object class, default: 'navbar navbar-fixed-top'

brand : str or page, optional

branding for the navigation bar, default: None

collapse : bool, optional

whether to toggle all dropdown menus, default: True


page : page

navbar HTML page object'.', lang='en', refresh=False, navbar=None, **kwargs)[source]

Create a new page with custom twitter bootstrap CSS and JS headers


base : str

relative path to the base directory where the page is located

lang : str, optional

language of the page, default: en

refresh : bool, optional

boolean switch to enable periodic page refresh, default: False

navbar : str, optional

HTML enconding of a floating navbar, will be ignored if not given, default: None[source]

Get the list of packages installed alongside this one

Returns a list of dict'Environment', class_='table table-hover table-condensed table-responsive', caption='Table of packages installed in the production environment', id_='package-table')[source]

Write a table listing packages installed in the current environment


h2 : str, None, optional

the header for the HTML section

caption : str, None, optional

the <caption> for the package table


html : str

an HTML table, language)[source]

Render a block of code with syntax highlighting


code : str

a raw block of source code

language : str

language the code is written in, e.g. 'python', channel, plot_durations=[1, 4, 16], scandir='.')[source]

Preview a batch of omega scans in HTML, nperrow=3)[source]

Embed a list of images in a bootstrap scaffold


plot : list of FancyPlot

the list of image paths to embed

nperrow : int

the number of images to place in a row (on a desktop screen)


page : page

the markup object containing the scaffolded HTML, data, caption=None, separator='', id=None, **class_)[source]

Write a <table> with one row of headers and many rows of data


headers : list

list of column header names

data : list of lists

list of column data lists, for m rows and n columns, this should have dimensions m x n

caption : str, optional

content for this table’s <caption>


class attribute declarations for each tag used in the table, any of table, thead, tbody, tr, th, td, caption


table : page

a formatted HTML page object containing the <table>, start, end, flag=None, section='Parameters', info='This analysis used the following parameters:', id_='parameters')[source]

Render an informative section with run parameters in HTML


content: `dict`

a collection of parameters to list

section: `str`

name of the section, will appear as a header with an <h2> tag, span=None, id=0, parent='accordion', context='warning', title=None, plotdir=None, plot_func=<function plot_segments at 0x7f74f281b378>, **kwargs)[source]

Write HTML for data quality flags

Write a <footer> for a bootstrap page


about : str, optional

path of about page to link

link : str, optional

HTML link to software name and version

issues : str, optional

HTML link to issue report page

content : str or page, optional

additional footer content


page : page

the markup object containing the footer HTML, value)[source]

Format a parameter value with HTML