Top Description Constructors Methods
uk.ac.ed.ph.snuggletex

public final Class WebPageOutputOptionsBuilder

extends Object
Class Inheritance
Annotations
@SuppressWarnings:javadoc
Imports
uk.ac.ed.ph.snuggletex.DOMOutputOptions.ErrorOutputOptions, uk.ac.ed.ph.snuggletex.definitions.W3CConstants

Utility class that creates pre-configured and usable WebPageOutputOptions instances for various common scenarios. This replaces WebPageOutputOptionsTemplates, which is now deprecated and will be removed in SnuggleTeX 1.4
Author
David McKain
Since
1.3.0
Version
$Revision$

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static final WebPageOutputOptions
createHTML4Options()

Creates WebPageOutputOptions used to serve up an HTML 4 page, possibly including MathML and other XML islands.

public static final WebPageOutputOptions
createHTML5MathJaxOptions()

Creates WebPageOutputOptions suitable for creating an HTML 5 web page with embedded MathML, using MathJax for cross-browser rendering of the MathML.

public static final WebPageOutputOptions
createHTML5MathJaxOptions(String
custom MathJax URL, which can be used to point to a local installation of MathJax or pass custom configuration details to MathJax.
customMathJaxUrl
)

Creates WebPageOutputOptions suitable for creating an HTML 5 web page with embedded MathML, using MathJax for cross-browser rendering of the MathML.

public static final WebPageOutputOptions
createHTML5Options()

Creates WebPageOutputOptions used to serve up an HTML 5 page, with MathML and any other XML islands "adopted" into HTML 4 by having their namespace details removed.

public static final WebPageOutputOptions
createIEMathPlayerSpecificOptions()

Creates WebPageOutputOptions suitable for deploying solely in Internet Explorer having the MathPlayer plug-in installed.

public static final WebPageOutputOptions
createLegacyCrossBrowserOptions()

Creates WebPageOutputOptions that would previously have been considered "cross-browser" in that it works on both Mozilla (i.e. Firefox) and Internet Explorer 6+ (provided the MathPlayer plugin is installed).

public static final WebPageOutputOptions
createMozillaSpecificOptions()

Creates WebPageOutputOptions suitable for deploying solely in a Mozilla-based browser, such as Firefox, using its native support for MathML.

public static final WebPageOutputOptions
createUniversalStylesheetOptions(String clientStylesheetUrl)

Create "Cross-browser" XHTML + MathML suitable for deploying to Mozilla and Internet Explorer + MathPlayer using a client-side XSLT often called the "Universal StyleSheet".

public static final WebPageOutputOptions
createUniversalStylesheetOptions(String clientStylesheetUrl, String rendererPreference)

public static final WebPageOutputOptions
createXHTMLMathJaxOptions()

Creates WebPageOutputOptions suitable for creating an XHTML + MathML web page, using MathJax for cross-browser rendering of the MathML.

public static final WebPageOutputOptions
createXHTMLMathJaxOptions(String
custom MathJax URL, which can be used to point to a local installation of MathJax or pass custom configuration details to MathJax.
customMathJaxUrl
)

Creates WebPageOutputOptions suitable for creating an XHTML + MathML web page, using MathJax for cross-browser rendering of the MathML.

public static final WebPageOutputOptions
createXHTMLOptions()

Creates WebPageOutputOptions used to serve up an XHTML page, possibly including MathML and other XML islands.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

WebPageOutputOptionsBuilderback to summary
public WebPageOutputOptionsBuilder()

Method Detail

createHTML4Optionsback to summary
public static final WebPageOutputOptions createHTML4Options()

Creates WebPageOutputOptions used to serve up an HTML 4 page, possibly including MathML and other XML islands. These islands would normally need further processing before hitting a browser, so this output is probably not useful on its own.

Technical notes

The JEuclid process hooks in here.
createHTML5MathJaxOptionsback to summary
public static final WebPageOutputOptions createHTML5MathJaxOptions()

Creates WebPageOutputOptions suitable for creating an HTML 5 web page with embedded MathML, using MathJax for cross-browser rendering of the MathML.

This is one of the most effective web page outputs.

See Also
createXHTMLMathJaxOptions()
createHTML5MathJaxOptionsback to summary
public static final WebPageOutputOptions createHTML5MathJaxOptions(String customMathJaxUrl)

Creates WebPageOutputOptions suitable for creating an HTML 5 web page with embedded MathML, using MathJax for cross-browser rendering of the MathML.

This is one of the most effective web page outputs.

Parameters
customMathJaxUrl:String

custom MathJax URL, which can be used to point to a local installation of MathJax or pass custom configuration details to MathJax.

See Also
createXHTMLMathJaxOptions()
createHTML5Optionsback to summary
public static final WebPageOutputOptions createHTML5Options()

Creates WebPageOutputOptions used to serve up an HTML 5 page, with MathML and any other XML islands "adopted" into HTML 4 by having their namespace details removed.

These islands would normally need further processing before hitting a browser, so this output is probably not useful on its own.

Technical notes

The JEuclid process hooks in here.
createIEMathPlayerSpecificOptionsback to summary
public static final WebPageOutputOptions createIEMathPlayerSpecificOptions()

Creates WebPageOutputOptions suitable for deploying solely in Internet Explorer having the MathPlayer plug-in installed.

This is a niche output kept around for legacy purposes. You should look at some of the newer HTML5 + MathJax-related options for better compatibility and easier deployment.

Technical notes

Intended to be served as text/html, containing prefixed MathML islands.

This only works on IE clients with the MathPlayer plug-in preinstalled, but is a good option if that's your target audience.

This will display wrongly on IE6/7 if MathPlayer is not installed.

createLegacyCrossBrowserOptionsback to summary
public static final WebPageOutputOptions createLegacyCrossBrowserOptions()

Creates WebPageOutputOptions that would previously have been considered "cross-browser" in that it works on both Mozilla (i.e. Firefox) and Internet Explorer 6+ (provided the MathPlayer plugin is installed).

This is a niche output kept around for legacy purposes. You should look at some of the newer HTML5 + MathJax-related options for better compatibility and easier deployment.

Technical notes

Output has XML declaration and DOCTYPE declaration consisting of the Public identifier defined in W3CConstants#XHTML_11_MATHML_20_PUBLIC_IDENTIFIER and System identifier defined in W3CConstants#XHTML_11_MATHML_20_SYSTEM_IDENTIFIER. The charset is declared only in the meta element in order to appease MathPlayer.

This is intended to be served as application/xhtml+xml

Works on both Mozilla and IE6/7 (provided MathPlayer has been installed). This will display wrongly on IE6/7 if MathPlayer is not installed.

The main issue with this is that IE will want to download the relevant DTD, which hinders performance slightly.

createMozillaSpecificOptionsback to summary
public static final WebPageOutputOptions createMozillaSpecificOptions()

Creates WebPageOutputOptions suitable for deploying solely in a Mozilla-based browser, such as Firefox, using its native support for MathML.

This is a niche output kept around for legacy purposes. You should look at some of the newer HTML5 + MathJax-related options for better compatibility and easier deployment.

Technical notes

This generates XHTML + MathML; no XML declaration; no DOCTYPE.

This is intended to be served as application/xhtml+xml with encoding declared via HTTP header and meta element.

This will display as an XML tree on IE, which is not useful.

createUniversalStylesheetOptionsback to summary
public static final WebPageOutputOptions createUniversalStylesheetOptions(String clientStylesheetUrl)

Create "Cross-browser" XHTML + MathML suitable for deploying to Mozilla and Internet Explorer + MathPlayer using a client-side XSLT often called the "Universal StyleSheet".

See XSLT Stylesheets for MathML for more details.

You must specify a URL for the client-side XSLT stylesheet that will be referenced in the resulting web page so that it is available to browsers. You will need to take into account security restrictions, such as "same domain", so will probably need to make sure you put the XSLT somewhere that is "local" to where you are serving up your pages.

Note that the SnuggleTeX source distribution contains a slightly fixed version of the USS that works in versions of IE newer than 6, but hasn't been extensively tested.

This is a niche output kept around for legacy purposes. You should look at some of the newer HTML5 + MathJax-related options for better compatibility and easier deployment.

Technical notes

The resulting page is created with an XML declaration but no DOCTYPE declaration.

The pref:renderer attribute on the html element will be set to mathplayer-dl.

createUniversalStylesheetOptionsback to summary
public static final WebPageOutputOptions createUniversalStylesheetOptions(String clientStylesheetUrl, String rendererPreference)
createXHTMLMathJaxOptionsback to summary
public static final WebPageOutputOptions createXHTMLMathJaxOptions()

Creates WebPageOutputOptions suitable for creating an XHTML + MathML web page, using MathJax for cross-browser rendering of the MathML.

This is one of the most effective web page outputs.

See Also
createHTML5MathJaxOptions()
createXHTMLMathJaxOptionsback to summary
public static final WebPageOutputOptions createXHTMLMathJaxOptions(String customMathJaxUrl)

Creates WebPageOutputOptions suitable for creating an XHTML + MathML web page, using MathJax for cross-browser rendering of the MathML.

This is one of the most effective web page outputs.

Parameters
customMathJaxUrl:String

custom MathJax URL, which can be used to point to a local installation of MathJax or pass custom configuration details to MathJax.

See Also
createHTML5MathJaxOptions()
createXHTMLOptionsback to summary
public static final WebPageOutputOptions createXHTMLOptions()

Creates WebPageOutputOptions used to serve up an XHTML page, possibly including MathML and other XML islands. These islands would normally need further processing before hitting a browser, so this output is probably not useful on its own.

Technical notes

The JEuclid process hooks in here.