Hosted by Three Crickets

Diligence
Web Framework
For Prudence and MongoDB

Diligence is still under development and incomplete, and some this documentation is wrong. For a more comprehensive but experimental version download the Savory Framework, which was the preview release of Diligence.

Diligence logo: sleeping monkey

HTML Service

This service supports two uses:
  1. Generating structured, internationalized, sanitized HTML code.
  2. Consuming HTML and parsing it using a jQuery-like syntax. For this we rely internally on the jsoup library.

Usage

Make sure to check out the API documentation for Diligence.HTML. Also useful is the API documentation for Sincerity.XML.

From JSON to HTML

The most general API is "build", which accepts a JSON structure and turns it into HTML:
<%
print(Diligence.HTML.build({
	_tag: 'div',
	_children: [
	]
}))
%>
The generated HTML is:
<div>
</div>
All text is properly escaped as appropriate for HTML content and HTML tag attributes. Note that keys beginning with "_" are treated specially, as explained below.
The library also contains shortcuts for simple HTML elements, like so:
<%= Diligence.HTML.img({src: 'http://threecrickets.com/media/three-crickets/prudence-small.png'}) %>
Special Attributes
Internationalization

Parsing HTML

Other Utilities

Sanitizing

The Diligence Manual is provided for you under the terms of the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. The complete manual is available for download as a PDF.

Download manual as PDF Creative Commons License