Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
MoinMoin.formatter.text_gedit.Formatter Class Reference
Inheritance diagram for MoinMoin.formatter.text_gedit.Formatter:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.formatter.text_gedit.Formatter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def heading
def pagelink
def interwikilink
def attachment_inlined
def attachment_link
def attachment_image
def attachment_drawing
def icon
def nowikiword
def macro
def parser
def table
def comment
def strong
def emphasis
def underline
def line_anchordef
def line_anchorlink
def span
def smiley
def startContent
def startContent
def endContent
def endContent
def lang
def url
def url
def anchordef
def anchorlink
def attachment_link
def highlight
def sup
def sub
def strike
def code
def small
def big
def preformatted
def code_area
def code_area
def code_line
def code_token
def linebreak
def paragraph
def rule
def image
def transclusion
def transclusion_param
def number_list
def bullet_list
def listitem
def definition_list
def definition_term
def definition_term
def definition_desc
def table_row
def table_cell
def text
def escapedText
def rawHTML
def sysmsg
def div
def sanitize_to_id
def set_highlight_re
def setPage
def startDocument
def endDocument
def make_id_unique
def qualify_id

Public Attributes

 pagelink_preclosed
 request
 cfg
 no_magic
 pagelinks
 in_p
 in_pre
 page

Static Public Attributes

 smiley = icon
dictionary style2attribute
string hardspace = ' '
string indentspace = ' '

Private Member Functions

def _style_to_attributes
def _checkTableAttr

Private Attributes

 _base_depth

Static Private Attributes

dictionary _allowed_table_attrs

Detailed Description

Send HTML data for the GUI editor 

Definition at line 17 of file text_gedit.py.


Member Function Documentation

def MoinMoin.formatter.text_gedit.Formatter._checkTableAttr (   self,
  attrs,
  prefix 
) [private]
Check table attributes

Convert from wikitable attributes to html 4 attributes.

@param attrs: attribute dict
@param prefix: used in wiki table attributes
@rtype: dict
@return: valid table attributes

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 170 of file text_gedit.py.

00170 
00171     def _checkTableAttr(self, attrs, prefix):
00172         #logging.debug(repr(attrs))
00173         attrs = text_html.Formatter._checkTableAttr(self, attrs, prefix)
00174         #logging.debug(repr(attrs))
00175         attrs = self._style_to_attributes(attrs)
00176         #logging.debug(repr(attrs))
00177         return attrs

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.formatter.text_gedit.Formatter._style_to_attributes (   self,
  attrs 
) [private]

Definition at line 149 of file text_gedit.py.

00149 
00150     def _style_to_attributes(self, attrs):
00151         if 'style' not in attrs:
00152             return attrs
00153         unknown = []
00154         for entry in attrs['style'].split(';'):
00155             try:
00156                 key, value = entry.split(':')
00157             except ValueError:
00158                 unknown.append(entry)
00159                 continue
00160             key, value = key.strip(), value.strip()
00161             if key in self.style2attribute:
00162                 attrs[self.style2attribute[key]] = value
00163             else:
00164                 unknown.append("%s:%s" % (key, value))
00165         if unknown:
00166             attrs['style'] = ';'.join(unknown)
00167         else:
00168             del attrs['style']
00169         return attrs

Here is the caller graph for this function:

def MoinMoin.formatter.text_html.Formatter.anchordef (   self,
  id 
) [inherited]
Inserts an invisible element used as a link target.

Inserts an empty <span> element with an id attribute, used as an anchor
for link references.  We use <span></span> rather than <span/>
for browser portability.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 551 of file text_html.py.

00551 
00552     def anchordef(self, id):
00553         """Inserts an invisible element used as a link target.
00554 
00555         Inserts an empty <span> element with an id attribute, used as an anchor
00556         for link references.  We use <span></span> rather than <span/>
00557         for browser portability.
00558         """
00559         # Don't add newlines, \n, as it will break pre and
00560         # line-numbered code sections (from line_achordef() method).
00561         #return '<a id="%s"></a>' % (id, ) # do not use - this breaks PRE sections for IE
00562         id = self.make_id_unique(id)
00563         id = self.qualify_id(id)
00564         return '<span class="anchor" id="%s"></span>' % id

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.anchorlink (   self,
  on,
  name = '',
  kw 
) [inherited]
Insert an <a> link pointing to an anchor on the same page.

Call once with on=1 to start the link, and a second time with
on=0 to end it.  No other arguments are needed on the second
call.

The name argument should be the same as the id provided to the
anchordef() method, or some other elment.  It should NOT start
with '#' as that will be added automatically.

The id argument, if provided, is instead the id of this link
itself and not of the target element the link references.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 571 of file text_html.py.

00571 
00572     def anchorlink(self, on, name='', **kw):
00573         """Insert an <a> link pointing to an anchor on the same page.
00574 
00575         Call once with on=1 to start the link, and a second time with
00576         on=0 to end it.  No other arguments are needed on the second
00577         call.
00578 
00579         The name argument should be the same as the id provided to the
00580         anchordef() method, or some other elment.  It should NOT start
00581         with '#' as that will be added automatically.
00582 
00583         The id argument, if provided, is instead the id of this link
00584         itself and not of the target element the link references.
00585         """
00586         attrs = self._langAttr()
00587         if name:
00588             name = self.sanitize_to_id(name)
00589             attrs['href'] = '#' + self.qualify_id(name)
00590         if 'href' in kw:
00591             del kw['href']
00592         if on:
00593             str = self._open('a', attr=attrs, **kw)
00594         else:
00595             str = self._close('a')
00596         return str

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.attachment_drawing (   self,
  url,
  text,
  kw 
)

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 95 of file text_gedit.py.

00095 
00096     def attachment_drawing(self, url, text, **kw):
00097         # Todo get it to start the drawing editor on a click
00098         try:
00099             drawing_action = AttachFile.get_action(self.request, url, do='modify')
00100             assert drawing_action is not None
00101             attachment_drawing = wikiutil.importPlugin(self.request.cfg, 'action',
00102                                               drawing_action, 'gedit_drawing')
00103             return attachment_drawing(self, url, text, **kw)
00104         except (wikiutil.PluginMissingError, wikiutil.PluginAttributeError, AssertionError):
00105             return url

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 84 of file text_gedit.py.

00084 
00085     def attachment_image(self, url, **kw):
00086         _ = self.request.getText
00087         # we force the title here, needed later for html>wiki converter
00088         kw['title'] = "attachment:%s" % wikiutil.quoteWikinameURL(url)
00089         pagename = self.page.page_name
00090         if '/' in url:
00091             pagename, target = AttachFile.absoluteName(url, pagename)
00092             url = url.split('/')[-1]
00093         kw['src'] = AttachFile.getAttachUrl(pagename, url, self.request, addts=1)
00094         return self.image(**kw)

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.attachment_inlined (   self,
  url,
  text,
  kw 
)

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 62 of file text_gedit.py.

00062 
00063     def attachment_inlined(self, url, text, **kw):
00064         url = wikiutil.escape(url)
00065         text = wikiutil.escape(text)
00066         if url == text:
00067             return '<span style="background-color:#ffff11">{{attachment:%s}}</span>' % url
00068         else:
00069             return '<span style="background-color:#ffff11">{{attachment:%s|%s}}</span>' % (url, text)

def MoinMoin.formatter.text_gedit.Formatter.attachment_link (   self,
  on,
  url = None,
  kw 
)

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 70 of file text_gedit.py.

00070 
00071     def attachment_link(self, on, url=None, **kw):
00072         assert on in (0, 1, False, True) # make sure we get called the new way, not like the 1.5 api was
00073         _ = self.request.getText
00074         querystr = kw.get('querystr', {})
00075         assert isinstance(querystr, dict) # new in 1.6, only support dicts
00076         if 'do' not in querystr:
00077             querystr['do'] = 'view'
00078         if on:
00079             pagename = self.page.page_name
00080             target = AttachFile.getAttachUrl(pagename, url, self.request, do=querystr['do'])
00081             return self.url(on, target, title="attachment:%s" % wikiutil.quoteWikinameURL(url))
00082         else:
00083             return self.url(on)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.attachment_link (   self,
  on,
  url = None,
  querystr = None,
  kw 
) [inherited]
Link to an attachment.

    @param on: 1/True=start link, 0/False=end link
    @param url: filename.ext or PageName/filename.ext

Definition at line 605 of file text_html.py.

00605 
00606     def attachment_link(self, on, url=None, querystr=None, **kw):
00607         """ Link to an attachment.
00608 
00609             @param on: 1/True=start link, 0/False=end link
00610             @param url: filename.ext or PageName/filename.ext
00611         """
00612         assert on in (0, 1, False, True) # make sure we get called the new way, not like the 1.5 api was
00613         _ = self.request.getText
00614         if querystr is None:
00615             querystr = {}
00616         assert isinstance(querystr, dict) # new in 1.6, only support dicts
00617         if 'do' not in querystr:
00618             querystr['do'] = 'view'
00619         if on:
00620             pagename, filename = AttachFile.absoluteName(url, self.page.page_name)
00621             #logging.debug("attachment_link: url %s pagename %s filename %s" % (url, pagename, filename))
00622             fname = wikiutil.taintfilename(filename)
00623             if AttachFile.exists(self.request, pagename, fname):
00624                 target = AttachFile.getAttachUrl(pagename, fname, self.request, do=querystr['do'])
00625                 if not 'title' in kw:
00626                     kw['title'] = "attachment:%s" % url
00627                 kw['css'] = 'attachment'
00628             else:
00629                 target = AttachFile.getAttachUrl(pagename, fname, self.request, do='upload_form')
00630                 kw['title'] = _('Upload new attachment "%(filename)s"') % {'filename': fname}
00631                 kw['css'] = 'attachment nonexistent'
00632             return self.url(on, target, **kw)
00633         else:
00634             return self.url(on)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.big (   self,
  on,
  kw 
) [inherited]
Creates a <big> element for larger font.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 783 of file text_html.py.

00783 
00784     def big(self, on, **kw):
00785         """Creates a <big> element for larger font.
00786 
00787         Call once with on=1 to start the region, and a second time
00788         with on=0 to end it.
00789         """
00790         tag = 'big'
00791         if on:
00792             return self._open(tag, allowed_attrs=[], **kw)
00793         return self._close(tag)
00794 

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.bullet_list (   self,
  on,
  kw 
) [inherited]
Creates an HTML ordered list, <ul> element.

The 'type' if specified can be any legal unnumbered
list-style-type, such as 'disc','square', etc.

Call once with on=1 to start the list, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1063 of file text_html.py.

01063 
01064     def bullet_list(self, on, **kw):
01065         """Creates an HTML ordered list, <ul> element.
01066 
01067         The 'type' if specified can be any legal unnumbered
01068         list-style-type, such as 'disc','square', etc.
01069 
01070         Call once with on=1 to start the list, and a second time
01071         with on=0 to end it.
01072         """
01073         tag = 'ul'
01074         if on:
01075             tagstr = self._open(tag, newline=1, **kw)
01076         else:
01077             tagstr = self._close(tag, newline=1)
01078         return tagstr

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.code (   self,
  on,
  kw 
) [inherited]
Creates a <tt> element for inline code or monospaced text.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Any text within this section will have spaces converted to
non-break spaces.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 757 of file text_html.py.

00757 
00758     def code(self, on, **kw):
00759         """Creates a <tt> element for inline code or monospaced text.
00760 
00761         Call once with on=1 to start the region, and a second time
00762         with on=0 to end it.
00763 
00764         Any text within this section will have spaces converted to
00765         non-break spaces.
00766         """
00767         tag = 'tt'
00768         self._in_code = on
00769         if on:
00770             return self._open(tag, allowed_attrs=[], **kw)
00771         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.FormatterBase.code_area (   self,
  on,
  code_id,
  kw 
) [inherited]

Definition at line 248 of file __init__.py.

00248 
00249     def code_area(self, on, code_id, **kw):
00250         raise NotImplementedError

def MoinMoin.formatter.text_html.Formatter.code_area (   self,
  on,
  code_id,
  code_type = 'code',
  show = 0,
  start = -1,
  step = -1,
  msg = None 
) [inherited]
Creates a formatted code region, with line numbering.

This region is formatted as a <div> with a <pre> inside it.  The
code_id argument is assigned to the 'id' of the div element, and
must be unique within the document.  The show, start, and step are
used for line numbering.

Note this is not like most formatter methods, it can not take any
extra keyword arguments.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

the msg string is not escaped

Definition at line 862 of file text_html.py.

00862 
00863     def code_area(self, on, code_id, code_type='code', show=0, start=-1, step=-1, msg=None):
00864         """Creates a formatted code region, with line numbering.
00865 
00866         This region is formatted as a <div> with a <pre> inside it.  The
00867         code_id argument is assigned to the 'id' of the div element, and
00868         must be unique within the document.  The show, start, and step are
00869         used for line numbering.
00870 
00871         Note this is not like most formatter methods, it can not take any
00872         extra keyword arguments.
00873 
00874         Call once with on=1 to start the region, and a second time
00875         with on=0 to end it.
00876 
00877         the msg string is not escaped
00878         """
00879         _ = self.request.getText
00880         res = []
00881         if on:
00882             code_id = self.sanitize_to_id('CA-%s' % code_id)
00883             ci = self.qualify_id(self.make_id_unique(code_id))
00884 
00885             # Open a code area
00886             self._in_code_area = 1
00887             self._in_code_line = 0
00888             # id in here no longer used
00889             self._code_area_state = [None, show, start, step, start]
00890 
00891             if msg:
00892                 attr = {'class': 'codemsg'}
00893                 res.append(self._open('div', attr={'class': 'codemsg'}))
00894                 res.append(msg)
00895                 res.append(self._close('div'))
00896 
00897             # Open the code div - using left to right always!
00898             attr = {'class': 'codearea', 'lang': 'en', 'dir': 'ltr'}
00899             res.append(self._open('div', attr=attr))
00900 
00901             # Add the script only in the first code area on the page
00902             if self._code_area_js == 0 and self._code_area_state[1] >= 0:
00903                 res.append(self._toggleLineNumbersScript)
00904                 self._code_area_js = 1
00905 
00906             # Add line number link, but only for JavaScript enabled browsers.
00907             if self._code_area_state[1] >= 0:
00908                 toggleLineNumbersLink = r'''
00909 <script type="text/javascript">
00910 document.write('<a href="#" onclick="return togglenumber(\'%s\', %d, %d);" \
00911                 class="codenumbers">%s<\/a>');
00912 </script>
00913 ''' % (ci, self._code_area_state[2], self._code_area_state[3],
00914        _("Toggle line numbers"))
00915                 res.append(toggleLineNumbersLink)
00916 
00917             # Open pre - using left to right always!
00918             attr = {'id': ci, 'lang': 'en', 'dir': 'ltr'}
00919             res.append(self._open('pre', newline=True, attr=attr, is_unique=True))
00920         else:
00921             # Close code area
00922             res = []
00923             if self._in_code_line:
00924                 res.append(self.code_line(0))
00925             res.append(self._close('pre'))
00926             res.append(self._close('div'))
00927 
00928             # Update state
00929             self._in_code_area = 0
00930 
00931         return ''.join(res)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.code_line (   self,
  on 
) [inherited]

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 932 of file text_html.py.

00932 
00933     def code_line(self, on):
00934         res = ''
00935         if not on or (on and self._in_code_line):
00936             res += '</span>\n'
00937         if on:
00938             res += '<span class="line">'
00939             if self._code_area_state[1] > 0:
00940                 res += '<span class="LineNumber">%4d </span>' % (self._code_area_state[4], )
00941                 self._code_area_state[4] += self._code_area_state[3]
00942         self._in_code_line = on != 0
00943         return res

def MoinMoin.formatter.text_html.Formatter.code_token (   self,
  on,
  tok_type 
) [inherited]

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 944 of file text_html.py.

00944 
00945     def code_token(self, on, tok_type):
00946         return ['<span class="%s">' % tok_type, '</span>'][not on]

def MoinMoin.formatter.text_gedit.Formatter.comment (   self,
  text,
  kw 
)

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 210 of file text_gedit.py.

00210 
00211     def comment(self, text, **kw):
00212         text = text.rstrip() # workaround for growing amount of blanks at EOL
00213         return self.preformatted(1, css_class='comment') + self.text(text) + self.preformatted(0)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.definition_desc (   self,
  on,
  kw 
) [inherited]
Gives the definition to a definition item, HTML element <dd>.

Call once with on=1 to start the definition, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1119 of file text_html.py.

01119 
01120     def definition_desc(self, on, **kw):
01121         """Gives the definition to a definition item, HTML element <dd>.
01122 
01123         Call once with on=1 to start the definition, and a second time
01124         with on=0 to end it.
01125         """
01126         tag = 'dd'
01127         if on:
01128             tagstr = self._open(tag, newline=1, **kw)
01129         else:
01130             tagstr = self._close(tag, newline=0)
01131         return tagstr

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.definition_list (   self,
  on,
  kw 
) [inherited]
Creates an HTML definition list, <dl> element.

Call once with on=1 to start the list, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1093 of file text_html.py.

01093 
01094     def definition_list(self, on, **kw):
01095         """Creates an HTML definition list, <dl> element.
01096 
01097         Call once with on=1 to start the list, and a second time
01098         with on=0 to end it.
01099         """
01100         tag = 'dl'
01101         if on:
01102             tagstr = self._open(tag, newline=1, **kw)
01103         else:
01104             tagstr = self._close(tag, newline=1)
01105         return tagstr

Here is the call graph for this function:

def MoinMoin.formatter.FormatterBase.definition_term (   self,
  on,
  compact = 0,
  kw 
) [inherited]

Reimplemented in MoinMoin.formatter.dom_xml.Formatter, MoinMoin.formatter.text_docbook.Formatter, MoinMoin.formatter.text_plain.Formatter, and MoinMoin.formatter.text_xml.Formatter.

Definition at line 285 of file __init__.py.

00285 
00286     def definition_term(self, on, compact=0, **kw):
00287         raise NotImplementedError

def MoinMoin.formatter.text_html.Formatter.definition_term (   self,
  on,
  kw 
) [inherited]
Adds a new term to a definition list, HTML element <dt>.

Call once with on=1 to start the term, and a second time
with on=0 to end it.

Definition at line 1106 of file text_html.py.

01106 
01107     def definition_term(self, on, **kw):
01108         """Adds a new term to a definition list, HTML element <dt>.
01109 
01110         Call once with on=1 to start the term, and a second time
01111         with on=0 to end it.
01112         """
01113         tag = 'dt'
01114         if on:
01115             tagstr = self._open(tag, newline=1, **kw)
01116         else:
01117             tagstr = self._close(tag, newline=0)
01118         return tagstr

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.div (   self,
  on,
  kw 
) [inherited]
open/close a blocklevel division 

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1314 of file text_html.py.

01314 
01315     def div(self, on, **kw):
01316         css_class = kw.get('css_class')
01317         # the display of comment class divs depends on a user setting:
01318         if css_class and 'comment' in css_class.split():
01319             style = kw.get('style')
01320             display = self.request.user.show_comments and "display:''" or "display:none"
01321             if not style:
01322                 style = display
01323             else:
01324                 style += "; %s" % display
01325             kw['style'] = style
01326         tag = 'div'
01327         if on:
01328             return self._open(tag, **kw)
01329         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.emphasis (   self,
  on,
  kw 
)
Creates an HTML <em> element.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 220 of file text_gedit.py.

00220 
00221     def emphasis(self, on, **kw):
00222         tag = 'i'
00223         if on:
00224             return self._open(tag, allowed_attrs=[], **kw)
00225         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.FormatterBase.endContent (   self) [inherited]

Reimplemented in MoinMoin.formatter.text_docbook.Formatter, and MoinMoin.macro.TableOfContents.TOCFormatter.

Definition at line 80 of file __init__.py.

00080 
00081     def endContent(self):
00082         if self.page:
00083             self.request.uid_generator.end()
00084         return ""

def MoinMoin.formatter.text_html.Formatter.endContent (   self,
  newline = True 
) [inherited]
Close page content div.

A link anchor is provided at the end of the div, with
an id of 'bottom' (modified by the request ID cache).

Definition at line 426 of file text_html.py.

00426 
00427     def endContent(self, newline=True):
00428         """ Close page content div.
00429 
00430         A link anchor is provided at the end of the div, with
00431         an id of 'bottom' (modified by the request ID cache).
00432         """
00433 
00434         result = []
00435         result.append(self.anchordef('bottom'))
00436         result.append(self._close('div', newline=newline))
00437         if hasattr(self, 'page'):
00438             self.request.uid_generator.end()
00439         return ''.join(result)

Here is the call graph for this function:

Reimplemented in MoinMoin.formatter.dom_xml.Formatter, MoinMoin.formatter.text_docbook.Formatter, MoinMoin.formatter.text_xml.Formatter, and MoinMoin.formatter.text_plain.Formatter.

Definition at line 72 of file __init__.py.

00072 
00073     def endDocument(self):
00074         return ""

Here is the caller graph for this function:

def MoinMoin.formatter.text_html.Formatter.escapedText (   self,
  on,
  kw 
) [inherited]
This allows emitting text as-is, anything special will
    be escaped (at least in HTML, some text output format
    would possibly do nothing here)

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1299 of file text_html.py.

01299 
01300     def escapedText(self, text, **kw):
01301         txt = wikiutil.escape(text)
01302         if kw:
01303             return self._open('span', **kw) + txt + self._close('span')
01304         return txt

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.heading (   self,
  on,
  depth,
  kw 
)

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 22 of file text_gedit.py.

00022 
00023     def heading(self, on, depth, **kw):
00024         # remember depth of first heading, and adapt counting depth accordingly
00025         if not self._base_depth:
00026             self._base_depth = depth
00027 
00028         count_depth = max(depth - (self._base_depth - 1), 1)
00029         heading_depth = depth
00030 
00031         # closing tag, with empty line after, to make source more readable
00032         if not on:
00033             return self._close('h%d' % heading_depth)
00034         else:
00035             return self._open('h%d' % heading_depth, **kw)

def MoinMoin.formatter.text_html.Formatter.highlight (   self,
  on,
  kw 
) [inherited]
Creates a text span for highlighting (css class "highlight").

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 711 of file text_html.py.

00711 
00712     def highlight(self, on, **kw):
00713         """Creates a text span for highlighting (css class "highlight").
00714 
00715         Call once with on=1 to start the region, and a second time
00716         with on=0 to end it.
00717         """
00718         tag = 'strong'
00719         if on:
00720             return self._open(tag, attr={'class': 'highlight'}, allowed_attrs=[], **kw)
00721         return self._close(tag)

Here is the call graph for this function:

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 106 of file text_gedit.py.

00106 
00107     def icon(self, type):
00108         return self.request.theme.make_icon(type, title='smiley:%s' % type)

def MoinMoin.formatter.text_html.Formatter.image (   self,
  src = None,
  kw 
) [inherited]
Creates an inline image with an <img> element.

The src argument must be the URL to the image file.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1010 of file text_html.py.

01010 
01011     def image(self, src=None, **kw):
01012         """Creates an inline image with an <img> element.
01013 
01014         The src argument must be the URL to the image file.
01015         """
01016         if src:
01017             kw['src'] = src
01018         return self._open('img', **kw)

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.interwikilink (   self,
  on,
  interwiki = '',
  pagename = '',
  kw 
)
@keyword title: override using the interwiki wikiname as title

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 51 of file text_gedit.py.

00051 
00052     def interwikilink(self, on, interwiki='', pagename='', **kw):
00053         """
00054         @keyword title: override using the interwiki wikiname as title
00055         """
00056         if not on:
00057             return self.url(0) # return '</a>'
00058         html_class = 'badinterwiki' # we use badinterwiki in any case to simplify reverse conversion
00059         href = wikiutil.quoteWikinameURL(pagename) or "/" # FCKeditor behaves strange on empty href
00060         title = kw.get('title', interwiki)
00061         return self.url(1, href, title=title, css=html_class) # interwiki links with pages with umlauts

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.lang (   self,
  on,
  lang_name 
) [inherited]
Insert text with specific lang and direction.

    Enclose within span tag if lang_name is different from
    the current lang

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 440 of file text_html.py.

00440 
00441     def lang(self, on, lang_name):
00442         """ Insert text with specific lang and direction.
00443 
00444             Enclose within span tag if lang_name is different from
00445             the current lang
00446         """
00447         tag = 'span'
00448         if lang_name != self.request.current_lang:
00449             # Enclose text in span using lang attributes
00450             if on:
00451                 attr = self._langAttr(lang=lang_name)
00452                 return self._open(tag, attr=attr)
00453             return self._close(tag)
00454 
00455         # Direction did not change, no need for span
00456         return ''

Here is the call graph for this function:

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 232 of file text_gedit.py.

00232 
00233     def line_anchordef(self, lineno):
00234         return '' # not needed for gui editor feeding

def MoinMoin.formatter.text_gedit.Formatter.line_anchorlink (   self,
  on,
  lineno = 0 
)

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 235 of file text_gedit.py.

00235 
00236     def line_anchorlink(self, on, lineno=0):
00237         return '' # not needed for gui editor feeding

def MoinMoin.formatter.text_html.Formatter.linebreak (   self,
  preformatted = 1 
) [inherited]
Creates a line break in the HTML output.

If preformatted is true a <br> element is inserted, otherwise
the linebreak will only be visible in the HTML source.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 965 of file text_html.py.

00965 
00966     def linebreak(self, preformatted=1):
00967         """Creates a line break in the HTML output.
00968 
00969         If preformatted is true a <br> element is inserted, otherwise
00970         the linebreak will only be visible in the HTML source.
00971         """
00972         if self._in_code_area:
00973             preformatted = 1
00974         return ['\n', '<br>\n'][not preformatted] + self._indent_spaces()

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.listitem (   self,
  on,
  kw 
) [inherited]
Adds a list item, <li> element, to a previously opened
bullet or number list.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1079 of file text_html.py.

01079 
01080     def listitem(self, on, **kw):
01081         """Adds a list item, <li> element, to a previously opened
01082         bullet or number list.
01083 
01084         Call once with on=1 to start the region, and a second time
01085         with on=0 to end it.
01086         """
01087         tag = 'li'
01088         if on:
01089             tagstr = self._open(tag, newline=1, **kw)
01090         else:
01091             tagstr = self._close(tag, newline=1)
01092         return tagstr

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.macro (   self,
  macro_obj,
  name,
  args,
  markup = None 
)

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 116 of file text_gedit.py.

00116 
00117     def macro(self, macro_obj, name, args, markup=None):
00118         if markup is not None:
00119             result = markup
00120         elif args is not None:
00121             result = "<<%s(%s)>>" % (name, args)
00122         else:
00123             result = "<<%s>>" % name
00124         return '<span style="background-color:#ffff11">%s</span>' % wikiutil.escape(result)

def MoinMoin.formatter.FormatterBase.make_id_unique (   self,
  id 
) [inherited]
Take an ID and make it unique in the current namespace.

Definition at line 406 of file __init__.py.

00406 
00407     def make_id_unique(self, id):
00408         '''
00409         Take an ID and make it unique in the current namespace.
00410         '''
00411         ns = self.request.uid_generator.include_id
00412         if not ns is None:
00413             ns = self.sanitize_to_id(ns)
00414         id = self.sanitize_to_id(id)
00415         id = self.request.uid_generator(id, ns)
00416         return id

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 111 of file text_gedit.py.

00111 
00112     def nowikiword(self, text):
00113         return '<span style="background-color:#ffff11">!</span>' + self.text(text)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.number_list (   self,
  on,
  type = None,
  start = None,
  kw 
) [inherited]
Creates an HTML ordered list, <ol> element.

The 'type' if specified can be any legal numbered
list-style-type, such as 'decimal','lower-roman', etc.

The 'start' argument if specified gives the numeric value of
the first list item (default is 1).

Call once with on=1 to start the list, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1039 of file text_html.py.

01039 
01040     def number_list(self, on, type=None, start=None, **kw):
01041         """Creates an HTML ordered list, <ol> element.
01042 
01043         The 'type' if specified can be any legal numbered
01044         list-style-type, such as 'decimal','lower-roman', etc.
01045 
01046         The 'start' argument if specified gives the numeric value of
01047         the first list item (default is 1).
01048 
01049         Call once with on=1 to start the list, and a second time
01050         with on=0 to end it.
01051         """
01052         tag = 'ol'
01053         if on:
01054             attr = {}
01055             if type is not None:
01056                 attr['type'] = type
01057             if start is not None:
01058                 attr['start'] = start
01059             tagstr = self._open(tag, newline=1, attr=attr, **kw)
01060         else:
01061             tagstr = self._close(tag, newline=1)
01062         return tagstr

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.pagelink (   self,
  on,
  pagename = '',
  page = None,
  kw 
)
Link to a page.

    formatter.text_python will use an optimized call with a page!=None
    parameter. DO NOT USE THIS YOURSELF OR IT WILL BREAK.

    See wikiutil.link_tag() for possible keyword parameters.

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 38 of file text_gedit.py.

00038 
00039     def pagelink(self, on, pagename='', page=None, **kw):
00040         """ Link to a page.
00041 
00042             formatter.text_python will use an optimized call with a page!=None
00043             parameter. DO NOT USE THIS YOURSELF OR IT WILL BREAK.
00044 
00045             See wikiutil.link_tag() for possible keyword parameters.
00046         """
00047         FormatterBase.pagelink(self, on, pagename, page, **kw)
00048         if page is None:
00049             page = Page(self.request, pagename, formatter=self)
00050         return page.link_to(self.request, on=on, **kw)

def MoinMoin.formatter.text_html.Formatter.paragraph (   self,
  on,
  kw 
) [inherited]
Creates a paragraph with a <p> element.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 975 of file text_html.py.

00975 
00976     def paragraph(self, on, **kw):
00977         """Creates a paragraph with a <p> element.
00978 
00979         Call once with on=1 to start the region, and a second time
00980         with on=0 to end it.
00981         """
00982         if self._terse:
00983             return ''
00984         FormatterBase.paragraph(self, on)
00985         tag = 'p'
00986         if on:
00987             tagstr = self._open(tag, **kw)
00988         else:
00989             tagstr = self._close(tag)
00990         return tagstr

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.parser (   self,
  parser_name,
  lines 
)
parser_name MUST be valid!

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 125 of file text_gedit.py.

00125 
00126     def parser(self, parser_name, lines):
00127         """ parser_name MUST be valid!
00128         """
00129         result = [self.preformatted(1)]
00130         for line in lines:
00131             result.append(self.text(line))
00132             result.append(self.linebreak(preformatted=1))
00133         result.append(self.preformatted(0))
00134 
00135         return "".join(result)

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.formatter.text_html.Formatter.preformatted (   self,
  on,
  kw 
) [inherited]
Creates a preformatted text region, with a <pre> element.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 797 of file text_html.py.

00797 
00798     def preformatted(self, on, **kw):
00799         """Creates a preformatted text region, with a <pre> element.
00800 
00801         Call once with on=1 to start the region, and a second time
00802         with on=0 to end it.
00803         """
00804         FormatterBase.preformatted(self, on)
00805         tag = 'pre'
00806         if on:
00807             return self._open(tag, newline=1, **kw)
00808         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.FormatterBase.qualify_id (   self,
  id 
) [inherited]
Take an ID and return a string that is qualified by
the current namespace; this default implementation
is suitable if the dot ('.') is valid in IDs for your
formatter.

Definition at line 417 of file __init__.py.

00417 
00418     def qualify_id(self, id):
00419         '''
00420         Take an ID and return a string that is qualified by
00421         the current namespace; this default implementation
00422         is suitable if the dot ('.') is valid in IDs for your
00423         formatter.
00424         '''
00425         ns = self.request.uid_generator.include_id
00426         if not ns is None:
00427             ns = self.sanitize_to_id(ns)
00428             return '%s.%s' % (ns, id)
00429         return id

Here is the call graph for this function:

Here is the caller graph for this function:

def MoinMoin.formatter.text_html.Formatter.rawHTML (   self,
  markup 
) [inherited]
This allows emitting pre-formatted HTML markup, and should be
    used wisely (i.e. very seldom).

    Using this event while generating content results in unwanted
    effects, like loss of markup or insertion of CDATA sections
    when output goes to XML formats.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1305 of file text_html.py.

01305 
01306     def rawHTML(self, markup):
01307         return markup

def MoinMoin.formatter.text_html.Formatter.rule (   self,
  size = None,
  kw 
) [inherited]
Creates a horizontal rule with an <hr> element.

If size is a number in the range [1..6], the CSS class of the rule
is set to 'hr1' through 'hr6'.  The intent is that the larger the
size number the thicker or bolder the rule will be.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 991 of file text_html.py.

00991 
00992     def rule(self, size=None, **kw):
00993         """Creates a horizontal rule with an <hr> element.
00994 
00995         If size is a number in the range [1..6], the CSS class of the rule
00996         is set to 'hr1' through 'hr6'.  The intent is that the larger the
00997         size number the thicker or bolder the rule will be.
00998         """
00999         if size and 1 <= size <= 6:
01000             # Add hr class: hr1 - hr6
01001             return self._open('hr', newline=1, attr={'class': 'hr%d' % size}, **kw)
01002         return self._open('hr', newline=1, **kw)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.sanitize_to_id (   self,
  text 
) [inherited]
Take 'text' and return something that is a valid ID
for this formatter.
The default returns the first non-space character of the string.

Because of the way this is used, it must be idempotent,
i.e. calling it on an already sanitized id must yield the
original id.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1346 of file text_html.py.

01346 
01347     def sanitize_to_id(self, text):
01348         return wikiutil.anchor_name_from_text(text)
01349 
def MoinMoin.formatter.FormatterBase.set_highlight_re (   self,
  hi_re = None 
) [inherited]
set the highlighting regular expression (e.g. for search terms)

@param hi_re: either a valid re as str/unicode (you may want to use
      re.escape before passing generic strings!) or a compiled
      re object. raises re.error for invalid re.

Definition at line 43 of file __init__.py.

00043 
00044     def set_highlight_re(self, hi_re=None):
00045         """ set the highlighting regular expression (e.g. for search terms)
00046 
00047         @param hi_re: either a valid re as str/unicode (you may want to use
00048                       re.escape before passing generic strings!) or a compiled
00049                       re object. raises re.error for invalid re.
00050         """
00051         if isinstance(hi_re, (str, unicode)):
00052             hi_re = re.compile(hi_re, re.U + re.IGNORECASE)
00053         self._highlight_re = hi_re

def MoinMoin.formatter.FormatterBase.setPage (   self,
  page 
) [inherited]

Reimplemented in MoinMoin.formatter.dom_xml.Formatter.

Definition at line 57 of file __init__.py.

00057 
00058     def setPage(self, page):
00059         self.page = page

def MoinMoin.formatter.text_html.Formatter.small (   self,
  on,
  kw 
) [inherited]
Creates a <small> element for smaller font.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 772 of file text_html.py.

00772 
00773     def small(self, on, **kw):
00774         """Creates a <small> element for smaller font.
00775 
00776         Call once with on=1 to start the region, and a second time
00777         with on=0 to end it.
00778         """
00779         tag = 'small'
00780         if on:
00781             return self._open(tag, allowed_attrs=[], **kw)
00782         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.FormatterBase.smiley (   self,
  text 
) [inherited]

Reimplemented in MoinMoin.formatter.text_docbook.Formatter, MoinMoin.formatter.dom_xml.Formatter, and MoinMoin.formatter.text_plain.Formatter.

Definition at line 181 of file __init__.py.

00181 
00182     def smiley(self, text):
00183         return text

def MoinMoin.formatter.text_gedit.Formatter.span (   self,
  on,
  kw 
)
open/close a inline span 

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 238 of file text_gedit.py.

00238 
00239     def span(self, on, **kw):
00240         previous_state = self.request.user.show_comments
00241         self.request.user.show_comments = True
00242         ret = text_html.Formatter.span(self, on, **kw)
00243         self.request.user.show_comments = previous_state
00244         return ret
def MoinMoin.formatter.FormatterBase.startContent (   self,
  content_id = "content",
  kw 
) [inherited]

Reimplemented in MoinMoin.formatter.text_docbook.Formatter, and MoinMoin.macro.TableOfContents.TOCFormatter.

Definition at line 75 of file __init__.py.

00075 
00076     def startContent(self, content_id="content", **kw):
00077         if self.page:
00078             self.request.uid_generator.begin(self.page.page_name)
00079         return ""

def MoinMoin.formatter.text_html.Formatter.startContent (   self,
  content_id = 'content',
  newline = True,
  kw 
) [inherited]
Start page content div.

A link anchor is provided at the beginning of the div, with
an id of 'top' (modified by the request ID cache).

Definition at line 405 of file text_html.py.

00405 
00406     def startContent(self, content_id='content', newline=True, **kw):
00407         """ Start page content div.
00408 
00409         A link anchor is provided at the beginning of the div, with
00410         an id of 'top' (modified by the request ID cache).
00411         """
00412 
00413         if hasattr(self, 'page'):
00414             self.request.uid_generator.begin(self.page.page_name)
00415 
00416         result = []
00417         # Use the content language
00418         attr = self._langAttr(self.request.content_lang)
00419         attr['id'] = content_id
00420         result.append(self._open('div', newline=False, attr=attr,
00421                                  allowed_attrs=['align'], **kw))
00422         result.append(self.anchordef('top'))
00423         if newline:
00424             result.append('\n')
00425         return ''.join(result)

Here is the call graph for this function:

def MoinMoin.formatter.FormatterBase.startDocument (   self,
  pagename 
) [inherited]

Reimplemented in MoinMoin.formatter.dom_xml.Formatter, MoinMoin.formatter.text_docbook.Formatter, MoinMoin.formatter.text_xml.Formatter, and MoinMoin.formatter.text_plain.Formatter.

Definition at line 69 of file __init__.py.

00069 
00070     def startDocument(self, pagename):
00071         return ""

Here is the caller graph for this function:

def MoinMoin.formatter.text_html.Formatter.strike (   self,
  on,
  kw 
) [inherited]
Creates a text span for line-through (strikeout) text (css class 'strike').

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 744 of file text_html.py.

00744 
00745     def strike(self, on, **kw):
00746         """Creates a text span for line-through (strikeout) text (css class 'strike').
00747 
00748         Call once with on=1 to start the region, and a second time
00749         with on=0 to end it.
00750         """
00751         # This does not use <strike> because has been deprecated in standard HTML.
00752         tag = 'span'
00753         if on:
00754             return self._open(tag, attr={'class': 'strike'},
00755                               allowed_attrs=[], **kw)
00756         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.strong (   self,
  on,
  kw 
)
Creates an HTML <strong> element.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 214 of file text_gedit.py.

00214 
00215     def strong(self, on, **kw):
00216         tag = 'b'
00217         if on:
00218             return self._open(tag, allowed_attrs=[], **kw)
00219         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.sub (   self,
  on,
  kw 
) [inherited]
Creates a <sub> element for subscript text.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 733 of file text_html.py.

00733 
00734     def sub(self, on, **kw):
00735         """Creates a <sub> element for subscript text.
00736 
00737         Call once with on=1 to start the region, and a second time
00738         with on=0 to end it.
00739         """
00740         tag = 'sub'
00741         if on:
00742             return self._open(tag, allowed_attrs=[], **kw)
00743         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.sup (   self,
  on,
  kw 
) [inherited]
Creates a <sup> element for superscript text.

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 722 of file text_html.py.

00722 
00723     def sup(self, on, **kw):
00724         """Creates a <sup> element for superscript text.
00725 
00726         Call once with on=1 to start the region, and a second time
00727         with on=0 to end it.
00728         """
00729         tag = 'sup'
00730         if on:
00731             return self._open(tag, allowed_attrs=[], **kw)
00732         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.sysmsg (   self,
  on,
  kw 
) [inherited]
Emit a system message (embed it into the page).

    Normally used to indicate disabled options, or invalid markup.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1308 of file text_html.py.

01308 
01309     def sysmsg(self, on, **kw):
01310         tag = 'div'
01311         if on:
01312             return self._open(tag, attr={'class': 'message'}, **kw)
01313         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.table (   self,
  on,
  attrs = None,
  kw 
)
Create table

@param on: start table
@param attrs: table attributes
@rtype: string
@return start or end tag of a table

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 184 of file text_gedit.py.

00184 
00185     def table(self, on, attrs=None, **kw):
00186         """ Create table
00187 
00188         @param on: start table
00189         @param attrs: table attributes
00190         @rtype: string
00191         @return start or end tag of a table
00192         """
00193         result = []
00194         if on:
00195             # Open table
00196             if not attrs:
00197                 attrs = {}
00198             else:
00199                 #result.append(self.rawHTML("<!-- ATTRS1: %s -->" % repr(attrs)))
00200                 attrs = self._checkTableAttr(attrs, 'table')
00201                 #result.append(self.rawHTML("<!-- ATTRS2: %s -->" % repr(attrs)))
00202             result.append(self._open('table', newline=1, attr=attrs,
00203                                      allowed_attrs=self._allowed_table_attrs['table'],
00204                                      **kw))
00205         else:
00206             # Close table then div
00207             result.append(self._close('table'))
00208 
00209         return ''.join(result)

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.table_cell (   self,
  on,
  attrs = None,
  kw 
) [inherited]

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1281 of file text_html.py.

01281 
01282     def table_cell(self, on, attrs=None, **kw):
01283         tag = 'td'
01284         if on:
01285             if not attrs:
01286                 attrs = {}
01287             else:
01288                 attrs = self._checkTableAttr(attrs, '')
01289             return '  ' + self._open(tag, attr=attrs,
01290                              allowed_attrs=self._allowed_table_attrs[''],
01291                              **kw)
01292         return self._close(tag) + '\n'

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.table_row (   self,
  on,
  attrs = None,
  kw 
) [inherited]

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1269 of file text_html.py.

01269 
01270     def table_row(self, on, attrs=None, **kw):
01271         tag = 'tr'
01272         if on:
01273             if not attrs:
01274                 attrs = {}
01275             else:
01276                 attrs = self._checkTableAttr(attrs, 'row')
01277             return self._open(tag, newline=1, attr=attrs,
01278                              allowed_attrs=self._allowed_table_attrs['row'],
01279                              **kw)
01280         return self._close(tag) + '\n'

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.text (   self,
  text,
  kw 
) [inherited]

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1293 of file text_html.py.

01293 
01294     def text(self, text, **kw):
01295         txt = FormatterBase.text(self, text, **kw)
01296         if kw:
01297             return self._open('span', **kw) + txt + self._close('span')
01298         return txt

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.transclusion (   self,
  on,
  kw 
) [inherited]
Transcludes (includes/embeds) another object.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1019 of file text_html.py.

01019 
01020     def transclusion(self, on, **kw):
01021         """Transcludes (includes/embeds) another object."""
01022         if on:
01023             return self._open('object',
01024                               allowed_attrs=['archive', 'classid', 'codebase',
01025                                              'codetype', 'data', 'declare',
01026                                              'height', 'name', 'standby',
01027                                              'type', 'width', ],
01028                               **kw)
01029         else:
01030             return self._close('object')

Here is the call graph for this function:

def MoinMoin.formatter.text_html.Formatter.transclusion_param (   self,
  kw 
) [inherited]
Give a parameter to a transcluded object.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 1031 of file text_html.py.

01031 
01032     def transclusion_param(self, **kw):
01033         """Give a parameter to a transcluded object."""
01034         return self._open('param',
01035                           allowed_attrs=['name', 'type', 'value', 'valuetype', ],
01036                           **kw)

Here is the call graph for this function:

def MoinMoin.formatter.text_gedit.Formatter.underline (   self,
  on,
  kw 
)
Creates a text span for underlining (css class "u").

Call once with on=1 to start the region, and a second time
with on=0 to end it.

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 226 of file text_gedit.py.

00226 
00227     def underline(self, on, **kw):
00228         tag = 'u'
00229         if on:
00230             return self._open(tag, allowed_attrs=[], **kw)
00231         return self._close(tag)

Here is the call graph for this function:

def MoinMoin.formatter.FormatterBase.url (   self,
  on,
  url = None,
  css = None,
  kw 
) [inherited]

Reimplemented in MoinMoin.formatter.text_docbook.Formatter, MoinMoin.formatter.dom_xml.Formatter, MoinMoin.formatter.text_xml.Formatter, and MoinMoin.formatter.text_plain.Formatter.

Definition at line 111 of file __init__.py.

00111 
00112     def url(self, on, url=None, css=None, **kw):
00113         raise NotImplementedError

Here is the caller graph for this function:

def MoinMoin.formatter.text_html.Formatter.url (   self,
  on,
  url = None,
  css = None,
  do_escape = None,
  kw 
) [inherited]
Inserts an <a> element (you can give any A tag attributes as kw args).

@param on: 1 to start the link, 0 to end the link (no other arguments are needed when on==0).
@param url: the URL to link to; will go through Wiki URL mapping.
@param css: a space-separated list of CSS classes
@param do_escape: DEPRECATED and not used any more, please remove it from your code!
          We will remove this parameter in moin 1.8 (it used to filter url
          param through wikiutil.escape, but text_html formatter's _open
          will do it again, so this just leads to double escaping now).

Definition at line 515 of file text_html.py.

00515 
00516     def url(self, on, url=None, css=None, do_escape=None, **kw):
00517         """
00518         Inserts an <a> element (you can give any A tag attributes as kw args).
00519 
00520         @param on: 1 to start the link, 0 to end the link (no other arguments are needed when on==0).
00521         @param url: the URL to link to; will go through Wiki URL mapping.
00522         @param css: a space-separated list of CSS classes
00523         @param do_escape: DEPRECATED and not used any more, please remove it from your code!
00524                           We will remove this parameter in moin 1.8 (it used to filter url
00525                           param through wikiutil.escape, but text_html formatter's _open
00526                           will do it again, so this just leads to double escaping now).
00527         """
00528         if do_escape is not None:
00529             if do_escape:
00530                 logging.warning("Deprecation warning: MoinMoin.formatter.text_html.url being called with do_escape=1/True parameter, please review caller.")
00531             else:
00532                 logging.warning("Deprecation warning: MoinMoin.formatter.text_html.url being called with do_escape=0/False parameter, please remove it from the caller.")
00533         if on:
00534             attrs = self._langAttr()
00535 
00536             # Handle the URL mapping
00537             if url is None and 'href' in kw:
00538                 url = kw['href']
00539                 del kw['href']
00540             if url is not None:
00541                 url = wikiutil.mapURL(self.request, url)
00542                 attrs['href'] = url
00543 
00544             if css:
00545                 attrs['class'] = css
00546 
00547             markup = self._open('a', attr=attrs, **kw)
00548         else:
00549             markup = self._close('a')
00550         return markup

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Initial value:
{
        'table': ['class', 'id', 'style', 'bgcolor', 'width', 'height', ],
        'row': ['class', 'id', 'style', 'bgcolor', 'width', 'height', ],
        '': ['colspan', 'rowspan', 'class', 'id', 'style', 'bgcolor', 'width', 'height', ],
    }

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 178 of file text_gedit.py.

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 25 of file text_gedit.py.

Definition at line 196 of file text_html.py.

string MoinMoin.formatter.text_html.Formatter.hardspace = '&nbsp;' [static, inherited]

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 180 of file text_html.py.

Definition at line 38 of file __init__.py.

string MoinMoin.formatter.text_html.Formatter.indentspace = ' ' [static, inherited]

Definition at line 181 of file text_html.py.

Definition at line 197 of file text_html.py.

Reimplemented in MoinMoin.formatter.dom_xml.Formatter.

Definition at line 58 of file __init__.py.

Definition at line 193 of file text_html.py.

Definition at line 37 of file __init__.py.

Reimplemented from MoinMoin.formatter.FormatterBase.

Definition at line 195 of file text_html.py.

Reimplemented from MoinMoin.formatter.text_html.Formatter.

Definition at line 109 of file text_gedit.py.

Initial value:
{
        'width': 'width',
        'height': 'height',
        'background': 'bgcolor',
        'background-color': 'bgcolor',
        #if this is used as table style="text-align: right", it doesn't work
        #if it is transformed to align="right":
        #'text-align': 'align',
        #'vertical-align': 'valign'
        }

Definition at line 138 of file text_gedit.py.


The documentation for this class was generated from the following file: