HTML construction

Almost all the command-line tools bundled with GWDetChar are designed to produce nicely-formatted HTML output with custom CSS style formatting based on Twitter Bootstrap. The output pages are constructed programatically using MarkupPy and a collection of custom python tools.

The module provides the following classes and functions:

io.html.FancyPlot(img[, caption]) A helpful class of objects that coalesce image links and caption text for fancybox figures.
io.html.new_bootstrap_page([base, lang, …]) Create a new page with custom twitter bootstrap CSS and JS headers
io.html.navbar(links[, class_, brand, collapse]) Construct a navigation bar in bootstrap format
io.html.get_brand(ifo, name, gps[, about]) Return a brand for navigation bar formatting
io.html.about_this_page(config[, packagelist]) Write a blurb documenting how a page was generated, including the command-line arguments and configuration files used
io.html.get_command_line([language]) Render the command line invocation used to generate a page
io.html.fancybox_img(img[, linkparams]) Return the markup to embed an <img> in HTML
io.html.scaffold_plots(plots[, nperrow]) Embed a list of images in a bootstrap scaffold
io.html.table(headers, data[, caption, …]) Write a <table> with one row of headers and many rows of data
io.html.write_flag_html(flag[, span, id, …]) Write HTML for data quality flags
io.html.write_footer([about, link, issues, …]) Write a <footer> for a bootstrap page
io.html.close_page(page, target, \*\*kwargs) Close an HTML document with markup then write to disk

All output pages feature basic contextual information for that analysis, including the full command-line needed to reproduce it. For analyses that require configuration files (e.g., omega scans), a separate ‘about’ page is written that displays each configuration file used as well as a table of package versions installed in the environment at runtime.

The module also provides functions specific to omega scan output pages:

omega.html.wrap_html(func) Decorator to wrap a function with init_page and close_page calls This allows inner HTML methods to be written with minimal arguments and content, hopefully making things simpler
omega.html.toggle_link(plottype, channel, …) Create a Bootstrap button object that toggles between plot types.
omega.html.write_summary_table(blocks, …) Write a summary table in various formats for users to download
omega.html.write_summary(ifo, gpstime[, …]) Write the Qscan analysis summary HTML
omega.html.write_ranking(toc, primary[, …]) Write a table of channels ranked by their similarity to the primary
omega.html.write_block(blockkey, block, context) Write the HTML summary for a specific block of channels
omega.html.write_qscan_page(blocks, context) Write the Qscan results to HTML

For more information, please refer to these individual modules.