示例#1
0
 def xwriteLink(self, obj):  # FIXME (known|unknown)
     obj.url = parse_interwiki_link(obj.target)
     a = ET.Element("a", href=obj.url or "#")
     for attr, value in obj.attributes:
         a.set(attr, value)
     klass = obj.vlist.get('class', javascript_block('pagelink'))
     a.set("class", klass)
     if not obj.children:
         a.text = obj.target
     return a
示例#2
0
 def xwriteSection(self, obj):
     tree = super(MyWriter, self).xwriteSection(obj)
     tree.set('class', javascript_block('section'))
     tree[0].text = tree[0].text.strip()
     return tree
示例#3
0
 def xwriteURL(self, obj):
     a = ET.Element("a", href=obj.caption)
     a.set("class", javascript_block('externallink'))
     if not obj.children:
         a.text = obj.caption
     return a
示例#4
0
    
    def xwriteURL(self, obj):
        a = ET.Element("a", href=obj.caption)
        a.set("class", javascript_block('externallink'))
        if not obj.children:
            a.text = obj.caption
        return a
    
    def xwriteSection(self, obj):
        tree = super(MyWriter, self).xwriteSection(obj)
        tree.set('class', javascript_block('section'))
        tree[0].text = tree[0].text.strip()
        return tree

images_reg = re.compile("<<images\s*([\d,? ?]+)\s*>>")
images_container = "<div class=\"" + javascript_block('page_container_images') + "\">%s</div>"""
image_template = """<div class="%(blockname)s">
<ul class="thumbs noscript">%(images)s</ul>
</div>
<div class="block-page_images__clear_fix"></div>
"""
image_block_template = """<li>
<a class="thumb %(image_block)s" href="%(href)s">
<img src="%(imagesrc)s" alt="%(imagealt)s" /></a>
</li>
"""

"""
def make_images(body):
    def replacer(match):
        ids = match.groups()[0].split(",")