Changeset 287

Show
Ignore:
Timestamp:
07/25/11 11:39:56 (22 months ago)
Author:
mbutscher
Message:

branches/mbutscher/work:
* Table option to set CSS class (Ross' rep.: part of

073653527c0ea0109c762007b27093f28cab2061)

Location:
branches/mbutscher/work/extensions
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/mbutscher/work/extensions/HtmlExporter.py

    r279 r287  
    13721372        self.astNodeStack.append(astNode) 
    13731373 
    1374         self.outAppend(u'<table border="2">\n') 
    1375          
     1374        # Retrieve table appendix values 
     1375        cssClass = u"" 
     1376        tableModeAppendix = astNode.findFlatByName("tableModeAppendix") 
     1377        if tableModeAppendix: 
     1378            # Written this way to keep compatible if user's own parser wasn't 
     1379            # updated properly 
     1380            style = getattr(tableModeAppendix, "cssClass", u"") 
     1381            if style: 
     1382                cssClass = u' class="{0}"'.format(style) 
     1383 
     1384        self.outAppend(u'<table border="2"{0}>\n'.format(cssClass)) 
     1385 
    13761386        for row in astNode.iterFlatByName("tableRow"): 
    13771387            self.outAppend(u"<tr>") 
     
    13811391                self.outAppend(u"</td>") 
    13821392            self.outAppend(u"</tr>\n") 
    1383          
     1393 
    13841394        if self.asIntHtmlPreview: 
    13851395            self.outAppend(u'</table>\n<br />\n') # , eatPostBreak=not self.asIntHtmlPreview) 
  • branches/mbutscher/work/extensions/wikidPadParser/WikidPadParser.py

    r279 r287  
    33 
    44# Official parser plugin for wiki language "WikidPad default 2.0" 
    5 # Last modified (format YYYY-MM-DD): 2011-06-26 
     5# Last modified (format YYYY-MM-DD): 2011-07-21 
    66 
    77 
     
    495495 
    496496def actionTableModeAppendix(s, l, st, t): 
     497    st.dictStack.getNamedDict("table")["table.tabSeparated"] = False 
     498    t.cssClass = None 
    497499    for key, data in t.entries: 
    498500        if key == "t": 
    499501            st.dictStack.getNamedDict("table")["table.tabSeparated"] = True 
    500             return 
    501  
    502     st.dictStack.getNamedDict("table")["table.tabSeparated"] = False 
     502        # Styles are designated by "s=". They will result in the css class 
     503        # s being applied to all table elements. E. g. "s=foo" uses class 
     504        # "foo". The '=' can be omitted, therefore "sfoo" does the same. 
     505        elif key == "s": 
     506            if data.startswith(u"="): 
     507                data = data[1:] 
     508            t.cssClass = data 
    503509 
    504510