Index: sasmodels/generate.py
===================================================================
--- sasmodels/generate.py	(revision 52ec91efe1982286cb988963ccb41671833fc098)
+++ sasmodels/generate.py	(revision 6592f56e0e7b113bb232ebf8d0cb4c506d37fae4)
@@ -706,5 +706,6 @@
     Iq_units = "The returned value is scaled to units of |cm^-1| |sr^-1|, absolute scale."
     Sq_units = "The returned value is a dimensionless structure factor, $S(q)$."
-    docs = convert_section_titles_to_boldface(model_info.docs)
+    docs = model_info.docs if model_info.docs is not None else ""
+    docs = convert_section_titles_to_boldface(docs)
     pars = make_partable(model_info.parameters.COMMON
                          + model_info.parameters.kernel_parameters)
@@ -718,4 +719,43 @@
 
 
+# TODO: need a single source for rst_prolog; it is also in doc/rst_prolog
+RST_PROLOG = """\
+.. |Ang| unicode:: U+212B
+.. |Ang^-1| replace:: |Ang|\ :sup:`-1`
+.. |Ang^2| replace:: |Ang|\ :sup:`2`
+.. |Ang^-2| replace:: |Ang|\ :sup:`-2`
+.. |1e-6Ang^-2| replace:: 10\ :sup:`-6`\ |Ang|\ :sup:`-2`
+.. |Ang^3| replace:: |Ang|\ :sup:`3`
+.. |Ang^-3| replace:: |Ang|\ :sup:`-3`
+.. |Ang^-4| replace:: |Ang|\ :sup:`-4`
+.. |cm^-1| replace:: cm\ :sup:`-1`
+.. |cm^2| replace:: cm\ :sup:`2`
+.. |cm^-2| replace:: cm\ :sup:`-2`
+.. |cm^3| replace:: cm\ :sup:`3`
+.. |1e15cm^3| replace:: 10\ :sup:`15`\ cm\ :sup:`3`
+.. |cm^-3| replace:: cm\ :sup:`-3`
+.. |sr^-1| replace:: sr\ :sup:`-1`
+.. |P0| replace:: P\ :sub:`0`\
+
+.. |equiv| unicode:: U+2261
+.. |noteql| unicode:: U+2260
+.. |TM| unicode:: U+2122
+
+.. |cdot| unicode:: U+00B7
+.. |deg| unicode:: U+00B0
+.. |g/cm^3| replace:: g\ |cdot|\ cm\ :sup:`-3`
+.. |mg/m^2| replace:: mg\ |cdot|\ m\ :sup:`-2`
+.. |fm^2| replace:: fm\ :sup:`2`
+.. |Ang*cm^-1| replace:: |Ang|\ |cdot|\ cm\ :sup:`-1`
+"""
+
+# TODO: make a better fake reference role
+RST_ROLES = """\
+.. role:: ref
+
+.. role:: numref
+
+"""
+
 def make_html(model_info):
     """
@@ -723,5 +763,15 @@
     """
     from . import rst2html
-    return rst2html.convert(make_doc(model_info))
+
+    rst = make_doc(model_info)
+    return rst2html.rst2html("".join((RST_ROLES, RST_PROLOG, rst)))
+
+def view_html(model_name):
+    from . import rst2html
+    from . import modelinfo
+    kernel_module = load_kernel_module(model_name)
+    info = modelinfo.make_model_info(kernel_module)
+    url = "file://"+dirname(info.filename)+"/"
+    rst2html.wxview(make_html(info), url=url)
 
 def demo_time():
Index: sasmodels/rst2html.py
===================================================================
--- sasmodels/rst2html.py	(revision 40a87fa5096610e24c3ead10299f609e99f093f2)
+++ sasmodels/rst2html.py	(revision 6592f56e0e7b113bb232ebf8d0cb4c506d37fae4)
@@ -10,10 +10,41 @@
 from contextlib import contextmanager
 
+# CRUFT: locale.getlocale() fails on some versions of OS X
+# See https://bugs.python.org/issue18378
+import locale
+if hasattr(locale, '_parse_localename'):
+    try:
+        locale._parse_localename('UTF-8')
+    except ValueError:
+        _old_parse_localename = locale._parse_localename
+        def _parse_localename(localename):
+            code = locale.normalize(localename)
+            if code == 'UTF-8':
+                return None, code
+            else:
+                return _old_parse_localename(localename)
+        locale._parse_localename = _parse_localename
+
 from docutils.core import publish_parts
 from docutils.writers.html4css1 import HTMLTranslator
 from docutils.nodes import SkipNode
 
+def wxview(html, url="", size=(850, 540)):
+    import wx
+    from wx.html2 import WebView
+    frame = wx.Frame(None, -1, size=size)
+    view = WebView.New(frame)
+    view.SetPage(html, url)
+    frame.Show()
+    return frame
 
-def rst2html(rst, part="whole", math_output="html"):
+def view_rst(filename):
+    from os.path import expanduser
+    with open(expanduser(filename)) as fid:
+        rst = fid.read()
+    html = rst2html(rst)
+    wxview(html)
+
+def rst2html(rst, part="whole", math_output="mathjax"):
     r"""
     Convert restructured text into simple html.
@@ -44,4 +75,10 @@
     else:
         settings = {"math-output": math_output}
+
+    # TODO: support stylesheets
+    #html_root = "/full/path/to/_static/"
+    #sheets = [html_root+s for s in ["basic.css","classic.css"]]
+    #settings["embed_styesheet"] = True
+    #settings["stylesheet_path"] = sheets
 
     # math2html and mathml do not support \frac12
