dm_html Module

HyperText Markup Language (HTML) generator procedures for (mostly) classless HTML5 syntax.


Uses

  • module~~dm_html~~UsesGraph module~dm_html dm_html module~dm_ascii dm_ascii module~dm_html->module~dm_ascii module~dm_error dm_error module~dm_html->module~dm_error module~dm_kind dm_kind module~dm_html->module~dm_kind module~dm_string dm_string module~dm_html->module~dm_string module~dm_util dm_util module~dm_html->module~dm_util module~dm_version dm_version module~dm_html->module~dm_version module~dm_error->module~dm_ascii module~dm_error->module~dm_kind iso_fortran_env iso_fortran_env module~dm_kind->iso_fortran_env module~dm_string->module~dm_error module~dm_string->module~dm_kind module~dm_util->module~dm_error module~dm_util->module~dm_kind

Used by

  • module~~dm_html~~UsedByGraph module~dm_html dm_html module~dm_atom dm_atom module~dm_atom->module~dm_html module~dmpack dmpack module~dmpack->module~dm_html module~dmpack->module~dm_atom

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: HTML_BUTTON_TYPE_BUTTON = 1

Default button.

integer, public, parameter :: HTML_BUTTON_TYPE_RESET = 2

Reset button.

integer, public, parameter :: HTML_BUTTON_TYPE_SUBMIT = 3

Submit button.

integer, public, parameter :: HTML_INPUT_TYPE_BUTTON = 1

Button.

integer, public, parameter :: HTML_INPUT_TYPE_CHECKBOX = 2

Checkbox.

integer, public, parameter :: HTML_INPUT_TYPE_COLOR = 3

Color.

integer, public, parameter :: HTML_INPUT_TYPE_DATE = 4

Date.

integer, public, parameter :: HTML_INPUT_TYPE_DATETIME_LOCAL = 5

Date and time.

integer, public, parameter :: HTML_INPUT_TYPE_EMAIL = 6

E-mail.

integer, public, parameter :: HTML_INPUT_TYPE_FILE = 7

File.

integer, public, parameter :: HTML_INPUT_TYPE_HIDDEN = 8

Hidden.

integer, public, parameter :: HTML_INPUT_TYPE_IMAGE = 9

Image.

integer, public, parameter :: HTML_INPUT_TYPE_MONTH = 10

Month.

integer, public, parameter :: HTML_INPUT_TYPE_NUMBER = 11

Number.

integer, public, parameter :: HTML_INPUT_TYPE_PASSWORD = 12

Password.

integer, public, parameter :: HTML_INPUT_TYPE_RADIO = 13

Radio button.

integer, public, parameter :: HTML_INPUT_TYPE_RANGE = 14

Range selector.

integer, public, parameter :: HTML_INPUT_TYPE_RESET = 15

Reset.

integer, public, parameter :: HTML_INPUT_TYPE_SEARCH = 16

Search.

integer, public, parameter :: HTML_INPUT_TYPE_SUBMIT = 17

Submit.

integer, public, parameter :: HTML_INPUT_TYPE_TEL = 18

Phone.

integer, public, parameter :: HTML_INPUT_TYPE_TEXT = 19

Text.

integer, public, parameter :: HTML_INPUT_TYPE_TIME = 20

Time.

integer, public, parameter :: HTML_INPUT_TYPE_URL = 21

URL.

integer, public, parameter :: HTML_INPUT_TYPE_WEEK = 22

Week.

character(len=*), public, parameter :: H_BLOCKQUOTE = '<blockquote>'
character(len=*), public, parameter :: H_BLOCKQUOTE_END = '</blockquote>'
character(len=*), public, parameter :: H_BODY = '<body>'//NL
character(len=*), public, parameter :: H_BODY_END = '</body>'//NL
character(len=*), public, parameter :: H_BR = '<br>'//NL
character(len=*), public, parameter :: H_CODE = '<code>'
character(len=*), public, parameter :: H_CODE_END = '</code>'
character(len=*), public, parameter :: H_COMMENT = '<!-- '
character(len=*), public, parameter :: H_COMMENT_END = ' //-->'
character(len=*), public, parameter :: H_DETAILS = '<details>'//NL
character(len=*), public, parameter :: H_DETAILS_END = '</details>'//NL
character(len=*), public, parameter :: H_DIV = '<div>'//NL
character(len=*), public, parameter :: H_DIV_COL = '<div class="col">'//NL
character(len=*), public, parameter :: H_DIV_END = '</div>'//NL
character(len=*), public, parameter :: H_DIV_ROW = '<div class="row">'//NL
character(len=*), public, parameter :: H_DOCTYPE = '<!DOCTYPE html>'//NL
character(len=*), public, parameter :: H_EM = '<em>'
character(len=*), public, parameter :: H_EM_END = '</em>'
character(len=*), public, parameter :: H_FIELDSET = '<fieldset>'//NL
character(len=*), public, parameter :: H_FIELDSET_END = '</fieldset>'//NL
character(len=*), public, parameter :: H_FIGCAPTION = '<figcaption>'
character(len=*), public, parameter :: H_FIGCAPTION_END = '</figcaption>'//NL
character(len=*), public, parameter :: H_FIGURE = '<figure>'//NL
character(len=*), public, parameter :: H_FIGURE_END = '</figure>'//NL
character(len=*), public, parameter :: H_FORM = '<form>'//NL
character(len=*), public, parameter :: H_FORM_END = '</form>'//NL
character(len=*), public, parameter :: H_FORM_POST = '<form method="post">'//NL
character(len=*), public, parameter :: H_FOOTER = '<footer>'//NL
character(len=*), public, parameter :: H_FOOTER_END = '</footer>'//NL
character(len=*), public, parameter :: H_H1 = '<h1>'
character(len=*), public, parameter :: H_H1_END = '</h1>'//NL
character(len=*), public, parameter :: H_H2 = '<h2>'
character(len=*), public, parameter :: H_H2_END = '</h2>'//NL
character(len=*), public, parameter :: H_H3 = '<h3>'
character(len=*), public, parameter :: H_H3_END = '</h3>'//NL
character(len=*), public, parameter :: H_H4 = '<h4>'
character(len=*), public, parameter :: H_H4_END = '</h4>'//NL
character(len=*), public, parameter :: H_HEAD = '<head>'//NL
character(len=*), public, parameter :: H_HEAD_END = '</head>'//NL
character(len=*), public, parameter :: H_HEADER = '<header>'//NL
character(len=*), public, parameter :: H_HEADER_END = '</header>'//NL
character(len=*), public, parameter :: H_HR = '<hr>'//NL
character(len=*), public, parameter :: H_HTML = '<html lang="en">'//NL
character(len=*), public, parameter :: H_HTML_END = '</html>'
character(len=*), public, parameter :: H_LI = '<li>'
character(len=*), public, parameter :: H_LI_END = '</li>'//NL
character(len=*), public, parameter :: H_MAIN = '<main>'//NL
character(len=*), public, parameter :: H_MAIN_END = '</main>'//NL
character(len=*), public, parameter :: H_MARK = '<mark>'
character(len=*), public, parameter :: H_MARK_END = '</mark>'
character(len=*), public, parameter :: H_META_CHARSET = '<meta charset="utf-8">'//NL
character(len=*), public, parameter :: H_META_GENERATOR = '<meta name="generator" content="DMPACK '//DM_VERSION_STRING//'">'//NL
character(len=*), public, parameter :: H_META_VIEWPORT = '<meta name="viewport" content="width=device-width, initial-scale=1.0">'//NL
character(len=*), public, parameter :: H_NAV = '<nav>'//NL
character(len=*), public, parameter :: H_NAV_END = '</nav>'//NL
character(len=*), public, parameter :: H_OPTION = '<option>'
character(len=*), public, parameter :: H_OPTION_END = '</option>'
character(len=*), public, parameter :: H_P = '<p>'
character(len=*), public, parameter :: H_P_END = '</p>'//NL
character(len=*), public, parameter :: H_PRE = '<pre>'
character(len=*), public, parameter :: H_PRE_END = '</pre>'
character(len=*), public, parameter :: H_SCRIPT = '<script>'
character(len=*), public, parameter :: H_SCRIPT_END = '</script>'
character(len=*), public, parameter :: H_SECTION = '<section>'//NL
character(len=*), public, parameter :: H_SECTION_END = '</section>'//NL
character(len=*), public, parameter :: H_SMALL = '<small>'
character(len=*), public, parameter :: H_SMALL_END = '</small>'
character(len=*), public, parameter :: H_SPAN = '<small>'
character(len=*), public, parameter :: H_SPAN_END = '</span>'
character(len=*), public, parameter :: H_STRONG = '<strong>'
character(len=*), public, parameter :: H_STRONG_END = '</strong>'
character(len=*), public, parameter :: H_SUMMARY = '<summary>'
character(len=*), public, parameter :: H_SUMMARY_END = '</summary>'//NL
character(len=*), public, parameter :: H_STYLE = '<style>'//NL
character(len=*), public, parameter :: H_STYLE_END = '</style>'//NL
character(len=*), public, parameter :: H_TABLE = '<table>'//NL
character(len=*), public, parameter :: H_TABLE_END = '</table>'//NL
character(len=*), public, parameter :: H_TBODY = '<tbody>'//NL
character(len=*), public, parameter :: H_TBODY_END = '</tbody>'//NL
character(len=*), public, parameter :: H_TD = '<td>'
character(len=*), public, parameter :: H_TD_END = '</td>'
character(len=*), public, parameter :: H_TH = '<th>'
character(len=*), public, parameter :: H_THEAD = '<thead>'//NL
character(len=*), public, parameter :: H_THEAD_END = '</thead>'//NL
character(len=*), public, parameter :: H_TH_END = '</th>'
character(len=*), public, parameter :: H_TIME = '<time>'
character(len=*), public, parameter :: H_TIME_END = '</time>'
character(len=*), public, parameter :: H_TITLE = '<title>'
character(len=*), public, parameter :: H_TITLE_END = '</title>'//NL
character(len=*), public, parameter :: H_TR = '<tr>'
character(len=*), public, parameter :: H_TR_END = '</tr>'//NL
character(len=*), public, parameter :: H_UL = '<ul>'//NL
character(len=*), public, parameter :: H_UL_END = '</ul>'//NL

Derived Types

type, public ::  anchor_type

HTML anchor type. The length of link text and URL are limited to 256 characters.

Components

Type Visibility Attributes Name Initial
character(len=256), public :: link = ' '

URL.

character(len=256), public :: text = ' '

Link text.

type, public ::  select_type

HTML select type. The length if option names and values is limited to 32 characters. Initialise this derived type with subroutine dm_html_select_create(). Free the allocated memory with dm_html_select_destroy().

Components

Type Visibility Attributes Name Initial
character(len=32), public, allocatable :: options(:)

Option names.

character(len=32), public, allocatable :: values(:)

Option values.


Functions

public pure function dm_html_anchor(anchor, encode) result(html)

Returns HTML anchor tag. Address and inner HTML of the anchor element are encoded by default.

Arguments

Type IntentOptional Attributes Name
type(anchor_type), intent(in) :: anchor

Anchor type.

logical, intent(in), optional :: encode

Encode address and inner HTML of anchor element.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_beat(beat, delta, prefix) result(html)

Returns table of single beat in HTML format.

Arguments

Type IntentOptional Attributes Name
type(beat_type), intent(inout) :: beat

Beat type.

integer(kind=i8), intent(in), optional :: delta

Time delta.

character(len=*), intent(in), optional :: prefix

GET argument name.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_beats(beats, deltas, prefix) result(html)

Returns table of heartbeats in HTML format. If argument prefix is passed, the node ids are enclosed in HTML anchors, with the link set to prefix.

Arguments

Type IntentOptional Attributes Name
type(beat_type), intent(inout) :: beats(:)

Beat types.

integer(kind=i8), intent(inout), optional :: deltas(:)

Time deltas.

character(len=*), intent(in), optional :: prefix

GET argument name.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_button(type, text, disabled) result(html)

Returns HTML button element. An invalid button type will be replaced with HTML_BUTTON_TYPE_BUTTON. This function does not encode the argument.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: type

Button type enumerator.

character(len=*), intent(in) :: text

Button text.

logical, intent(in), optional :: disabled

Disabled flag.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_cgi_env(env) result(html)

Returns HTML table of CGI environment variables.

Arguments

Type IntentOptional Attributes Name
type(cgi_env_type), intent(inout) :: env

CGI environment variables.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_comment(str) result(html)

Returns HTML comment. The given string is enclosed by <!-- and //-->. This function does not encode the argument.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Comment string.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_data_uri(data, mime) result(uri)

Returns base64-encoded data URI of given data and MIME type.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(inout) :: data

Raw data.

character(len=*), intent(in) :: mime

MIME type.

Return Value character(len=:), allocatable

Data URI.

public pure function dm_html_decode(input) result(output)

Reverses HTML encoding.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: input

String to decode.

Return Value character(len=:), allocatable

Decoded string.

public pure function dm_html_encode(input) result(output)

Returns encoded input string, with some HTML special characters replaced (", &, ', <, >).

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: input

Input string.

Return Value character(len=:), allocatable

Encoded string.

public pure function dm_html_error(error_code, message) result(html)

Returns HTML of (encoded) error description.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: error_code

DMPACK error code.

character(len=*), intent(in), optional :: message

Error message.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_figure(content, caption) result(html)

Returns HTML figure. The content should end with a newline. The caption will be HTML encoded.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: content

Figure content.

character(len=*), intent(in), optional :: caption

Figure caption.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_footer(content) result(html)

Returns HTML footer. The content will not be HTML encoded.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: content

Optional footer content.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_header(title, subtitle, brand, inline_style, styles, nav, nav_mask) result(html)

Returns HTML header with DOCTYPE and optional CSS. Links to the style sheet files and internal CSS can be added.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: title

HTML page title and first heading.

character(len=*), intent(in), optional :: subtitle

Subtitle.

character(len=*), intent(in), optional :: brand

Brand title.

character(len=*), intent(in), optional :: inline_style

Inline CSS.

type(string_type), intent(inout), optional :: styles(:)

Array of CSS file paths.

type(anchor_type), intent(inout), optional :: nav(:)

Navigation anchors.

logical, intent(inout), optional :: nav_mask(:)

Navigation anchors mask.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_heading(level, str, small) result(html)

Returns HTML heading of given level level and string str, with optional <small> child in small.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: level

Heading level.

character(len=*), intent(in) :: str

Heading string.

character(len=*), intent(in), optional :: small

Sub-heading string.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_image(src, alt) result(html)

Returns HTML image tag. This function does not encode the arguments.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: src

Image source.

character(len=*), intent(in) :: alt

Image alt tag.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_input(type, checked, disabled, id, max, max_length, min, min_length, name, pattern, placeholder, read_only, required, size, value) result(html)

Returns HTML input element.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: type

HTML input type.

logical, intent(in), optional :: checked

Input is checked.

logical, intent(in), optional :: disabled

Input is disabled.

character(len=*), intent(in), optional :: id

Input id.

integer, intent(in), optional :: max

Input max. value.

integer, intent(in), optional :: max_length

Input max. length.

integer, intent(in), optional :: min

Input min. value.

integer, intent(in), optional :: min_length

Input min. length.

character(len=*), intent(in), optional :: name

Input name.

character(len=*), intent(in), optional :: pattern

Input regular expression pattern.

character(len=*), intent(in), optional :: placeholder

Input placeholder.

logical, intent(in), optional :: read_only

Input is read-only.

logical, intent(in), optional :: required

Input is required.

integer, intent(in), optional :: size

Input size.

character(len=*), intent(in), optional :: value

Input value.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_label(str, for) result(html)

Returns HTML label element. This function does not encode the arguments.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Label string.

character(len=*), intent(in), optional :: for

Label for attribute.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_link(rel, href) result(html)

Returns link element. Link address and text will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: rel

The rel attribute.

character(len=*), intent(in) :: href

The href attribute.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_log(log, prefix_node, prefix_sensor, prefix_target, prefix_observ) result(html)

Returns log as HTML table. The input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(log_type), intent(inout) :: log

Log type.

character(len=*), intent(in), optional :: prefix_node

Node link prefix.

character(len=*), intent(in), optional :: prefix_sensor

Sensor link prefix.

character(len=*), intent(in), optional :: prefix_target

Target link prefix.

character(len=*), intent(in), optional :: prefix_observ

Observation link prefix.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_logs(logs, prefix, node, max_len) result(html)

Returns table of logs in HTML format. If argument prefix is passed, the log timestamps are enclosed in HTML anchors, with the link set to prefix. By default, a node id column is added to the table. Optionally, a maximum log message length can be set. The input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(log_type), intent(inout) :: logs(:)

Log types.

character(len=*), intent(in), optional :: prefix

Link address prefix.

logical, intent(in), optional :: node

Show node id column.

integer, intent(in), optional :: max_len

Max. log message length.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_mark(str, class) result(html)

Returns <mark> element of optional class, with encoded str enclosed. This function encodes the passed string.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Element content.

character(len=*), intent(in), optional :: class

Element class.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_nav(anchors, mask) result(html)

Returns HTML navigation element with unordered list of links. If optional array mask is passed, anchors are added according to their mask state.

Arguments

Type IntentOptional Attributes Name
type(anchor_type), intent(inout) :: anchors(:)

Anchor types.

logical, intent(inout), optional :: mask(:)

Mask.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_node(node) result(html)

Returns sensor node as HTML table. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(node_type), intent(inout) :: node

Node type.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_nodes(nodes, prefix) result(html)

Returns sensor nodes as HTML table. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(node_type), intent(inout) :: nodes(:)

Node types.

character(len=*), intent(in), optional :: prefix

Link address prefix.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_observ(observ, prefix_node, prefix_sensor, prefix_target) result(html)

Returns observation as HTML table. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(inout) :: observ

Observation type.

character(len=*), intent(in), optional :: prefix_node

Node link prefix.

character(len=*), intent(in), optional :: prefix_sensor

Sensor link prefix.

character(len=*), intent(in), optional :: prefix_target

Target link prefix.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_observs(observs, prefix, id, node_id, sensor_id, target_id, name, source, error) result(html)

Returns table of observs in HTML format. If argument prefix is passed, the observation names are enclosed in HTML anchors, with the link set to prefix. The table always contains index and timestamp. The columns id, node id, sensor id, target id, name, and error are optional. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(observ_type), intent(inout) :: observs(:)

Observation types.

character(len=*), intent(in), optional :: prefix

Link address prefix.

logical, intent(in), optional :: id

Show observation ids.

logical, intent(in), optional :: node_id

Show node ids.

logical, intent(in), optional :: sensor_id

Show sensor ids.

logical, intent(in), optional :: target_id

Show target ids.

logical, intent(in), optional :: name

Show observation names.

logical, intent(in), optional :: source

Show observation source.

logical, intent(in), optional :: error

Show erros.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_p(str, encode) result(html)

Returns HTML paragraph. This function does not encode the argument str unless encode is .true..

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Paragraph string.

logical, intent(in), optional :: encode

HTML-encode string.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_pre(str, code) result(html)

Returns HTML preformatted text, with optional <code> tag. This function does not encode the argument str.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Content string.

logical, intent(in), optional :: code

Additional code tag?

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_request(request) result(html)

Returns request as HTML table. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(request_type), intent(inout) :: request

Observation request type.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_responses(responses) result(html)

Returns responses as HTML table. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(response_type), intent(inout) :: responses(:)

Observation response type.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_script(source) result(html)

Returns <script> element with URL source to JavaScript file. The source will be encoded.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: source

URL to JS script.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_select(select, id, name, selected, disabled) result(html)

Returns HTML select element with option values. This function does not encode or trim the arguments.

Arguments

Type IntentOptional Attributes Name
type(select_type), intent(inout) :: select

HTML select type.

character(len=*), intent(in) :: id

Select id.

character(len=*), intent(in) :: name

Select name.

character(len=*), intent(in) :: selected

Element selected by default.

logical, intent(in), optional :: disabled

Disable element.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_sensor(sensor) result(html)

Returns sensor as HTML table. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(sensor_type), intent(inout) :: sensor

Sensor type.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_sensors(sensors, prefix) result(html)

Returns table of sensors in HTML format. If argument prefix is passed, the sensor names are enclosed in HTML anchors, with the link set to prefix. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(sensor_type), intent(inout) :: sensors(:)

Sensor types.

character(len=*), intent(in), optional :: prefix

Link address prefix.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_small(str) result(html)

Returns <small> element with encoded str enclosed.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Element content.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_span(str, class) result(html)

Returns <span> element of optional class, with encoded str enclosed.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Element content.

character(len=*), intent(in), optional :: class

Element CSS class.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_target(target) result(html)

Returns target as HTML table.

Arguments

Type IntentOptional Attributes Name
type(target_type), intent(inout) :: target

Target type.

Return Value character(len=:), allocatable

Generated HTML.

public function dm_html_targets(targets, prefix) result(html)

Returns table of targets in HTML format. If argument prefix is passed, the target names are enclosed in HTML anchors, with the link set to prefix. Input data will be trimmed and encoded.

Arguments

Type IntentOptional Attributes Name
type(target_type), intent(inout) :: targets(:)

Target types.

character(len=*), intent(in), optional :: prefix

Link address prefix.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_td(str, col_span, row_span) result(html)

Returns str enclosed by <td> tag, with optional column or row span. The passed string will not be encoded or trimmed.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

integer, intent(in), optional :: col_span

Column span.

integer, intent(in), optional :: row_span

Row span.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_th(str, col_span, row_span) result(html)

Returns str enclosed by <th> tag, with optional column or row span. The passed string will not be encoded or trimmed.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Input string.

integer, intent(in), optional :: col_span

Column span.

integer, intent(in), optional :: row_span

Row span.

Return Value character(len=:), allocatable

Generated HTML.

public pure function dm_html_time(time, human) result(html)

Returns <time> element with datetime attribute, and the encoded ISO 8601 time stamp time enclosed. This function does not validate or encode the passed time stamp. The value of the datetime attribute is extracted from the time stamp and converted according to the HTML specification (with microseconds stripped).

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: time

ISO 8601 time stamp.

logical, intent(in), optional :: human

Turn time stamp into human-readable format.

Return Value character(len=:), allocatable

Generated HTML.


Subroutines

public pure subroutine dm_html_select_create(select, size, error)

Allocates memory for arrays in select type. Returns E_ALLOC on error.

Arguments

Type IntentOptional Attributes Name
type(select_type), intent(out) :: select

Select type.

integer, intent(in) :: size

Array size.

integer, intent(out), optional :: error

Error code.

public subroutine dm_html_select_destroy(select)

Deallocates arrays in select type.

Arguments

Type IntentOptional Attributes Name
type(select_type), intent(inout) :: select

Select type.

public subroutine dm_html_select_set(select, index, option, value, error)

Sets option name and value in select type.

Arguments

Type IntentOptional Attributes Name
type(select_type), intent(inout) :: select

Select type.

integer, intent(in) :: index

Array index.

character(len=*), intent(in) :: option

Option name.

character(len=*), intent(in) :: value

Option value.

integer, intent(out), optional :: error

Error code.