2017-09-29

(sph web shtml)

helpers to create html as sxml

import name

(sph web shtml)

exports

shtml-alist->options

procedure

signature

a ->

((content . string:value/false)/string ...) -> sxml:((option _ ...) ...)

description

create the shtml for multiple <option> elements

shtml-heading

procedure

signature

depth content ... ->

integer sxml -> sxml

description

create a html heading element, for example <h1>, with the given content

shtml-hyperlink

procedure

signature

target title [attributes] ->

string string -> sxml

description

sxml for an html <a>

shtml-include-css

procedure

signature

path ->

string -> sxml

description

create the shtml for including a stylesheet file

shtml-include-javascript

procedure

signature

path [is-async] ->

string boolean -> sxml

description

create the shtml for including a javascript file

shtml-indent

variable

shtml-indent-create

procedure

signature

depth ->

integer -> sxml

description

creates indent with the html entity for the space character so it does not get compressed by the viewer

shtml-list->list

procedure

signature

a [ordered?] ->

(sxml/list:sub-list) boolean -> sxml

description

create the shtml for an unordered or ordered list structure, <ul> or <ol>, with elements.

input list elements that are lists are recursively created as shtml sublists

shtml-list->table

procedure

signature

a ->

((sxml:cell ...) ...) -> sxml

description

create the shtml for a <table> with content

shtml-section

procedure

signature

depth title content attributes ... ->

integer sxml sxml (string/symbol string/symbol) ... -> sxml

description

create the sxml for an html <section> tag with attributes, heading and content in a single html tag.

content is put in a <div> unless it already is contained in single tag or if it is empty.

the single tag is ensured to make accessors for the content area (everything not first heading) simpler

shtml-text->sxml

procedure

signature

a ->

string -> sxml

description

replace newlines with (br)


tags: guile documentation library scheme sph-lib computer sph-web-shtml