View Source API Reference zotonic_stdlib v1.26.1
Modules
Conversion functions for all kinds of data types. Changes to Rusty's version: added date conversion, undefined handling and more to_bool cases.
Workarounds for various cover deficiencies.
Utility functions for CSS processing. This sanitizer is used by the HTML sanitizer for processing style attributes. It can also be called independently to sanitize CSS.
Javascript minifier. Based on cssmin.c. Minimizes a Javascript binary by removing comments and unnecessary whitespace.
Check an IP address against the list that are maintained by DNSBL or DNSWL providers (rfc5782). There is a list of default black list providers in dns_blocklist/0 and of white list providers in dns_allowlist/0.
Useful routines for e-mail address handling. Extract emails from a text and check if a text is a valid email address.
Extra file functions to complement the standard library. Rename files between different filesystems, and ensure directories of a path exist. Also escape routines to safely handle filenames as command line arguments.
Utility functions sanitizing, escaping and filtering HTML, and sanitize property lists/maps.
Converts HTML 4 charrefs and entities to codepoints.
Loosely tokenizes and generates parse trees for (X)HTML and XML. Adapted by Maas-Maarten Zeeman Extended for basic XML parsing by Marc Worrell
Misc utility URL functions for zotonic
Javascript minifier. Based on jsmin.c
Useful numeric algorithms for floats that cover some deficiencies in the math module. More interesting is digits/1, which implements the algorithm from: http://www.cs.indiana.edu/~burger/fp/index.html See also "Printing Floating-Point Numbers Quickly and Accurately" in Proceedings of the SIGPLAN '96 Conference on Programming Language Design and Implementation.
String related functions
String normalization, used for search indices. Takes a string, lowercases it and then transliterates to ASCII.
Utility functions for svg processing. Sanitize SVG content to remove potentially harmful elements and attributes. The sanitizer uses a whitelist of allowed elements and attributes.
Simple temporary file handling, deletes the file when the calling process stops or crashes. If a file is created then a watchdog process is started to monitor the calling process. If the calling process is stopped or crashes then the file is deleted.
Misc utility URL functions for Zotonic.
Fetch (part of) the data of an Url, including its headers. Also support decoding 'data:' URLs and streaming fetched data to a device. Uses the httpc OTP library for the actual fetching. The fetch functions are able to unzip partially fetched data.
Discover metadata about an url. Follows redirects and URL shorteners, and then fetches the data at the final URL to inspect for metadata tags, content headers and the first part of the HTML.