Back to index

moin  1.9.0~rc2
Classes | Functions | Variables
MoinMoin.support.pygments.formatters.html Namespace Reference

Classes

class  HtmlFormatter

Functions

def escape_html
def get_random_id
def _get_ttype_class

Variables

list __all__ = ['HtmlFormatter']
string CSSFILE_TEMPLATE
string DOC_HEADER
string DOC_HEADER_EXTERNALCSS
string DOC_FOOTER

Function Documentation

Definition at line 48 of file html.py.

00048 
00049 def _get_ttype_class(ttype):
00050     fname = STANDARD_TYPES.get(ttype)
00051     if fname:
00052         return fname
00053     aname = ''
00054     while fname is None:
00055         aname = '-' + ttype[-1] + aname
00056         ttype = ttype.parent
00057         fname = STANDARD_TYPES.get(ttype)
00058     return fname + aname
00059 

Here is the caller graph for this function:

Escape &, <, > as well as single and double quotes for HTML.

Definition at line 27 of file html.py.

00027 
00028 def escape_html(text):
00029     """Escape &, <, > as well as single and double quotes for HTML."""
00030     return text.replace('&', '&amp;').  \
00031                 replace('<', '&lt;').   \
00032                 replace('>', '&gt;').   \
00033                 replace('"', '&quot;'). \
00034                 replace("'", '&#39;')
00035 

Here is the caller graph for this function:

Return a random id for javascript fields.

Definition at line 36 of file html.py.

00036 
00037 def get_random_id():
00038     """Return a random id for javascript fields."""
00039     from random import random
00040     from time import time
00041     try:
00042         from hashlib import sha1 as sha
00043     except ImportError:
00044         import sha
00045         sha = sha.new
00046     return sha('%s|%s' % (random(), time())).hexdigest()
00047 


Variable Documentation

Definition at line 24 of file html.py.

Initial value:
00001 '''\
00002 td.linenos { background-color: #f0f0f0; padding-right: 10px; }
00003 span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
00004 pre { line-height: 125%%; }
00005 %(styledefs)s
00006 '''

Definition at line 60 of file html.py.

Initial value:
00001 '''\
00002 </body>
00003 </html>
00004 '''

Definition at line 99 of file html.py.

Initial value:
00001 '''\
00002 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
00003    "http://www.w3.org/TR/html4/strict.dtd">
00004 
00005 <html>
00006 <head>
00007   <title>%(title)s</title>
00008   <meta http-equiv="content-type" content="text/html; charset=%(encoding)s">
00009   <style type="text/css">
00010 '''

Definition at line 67 of file html.py.

Initial value:
00001 '''\
00002 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
00003    "http://www.w3.org/TR/html4/strict.dtd">
00004 
00005 <html>
00006 <head>
00007   <title>%(title)s</title>
00008   <meta http-equiv="content-type" content="text/html; charset=%(encoding)s">
00009   <link rel="stylesheet" href="%(cssfile)s" type="text/css">
00010 </head>
00011 <body>
00012 <h2>%(title)s</h2>
00013 
00014 '''

Definition at line 84 of file html.py.