as Chinese Pythoner, love t2t;-)
from 2004 usage t2t in everywhere
when blogging,i usage PyBlosxom:
PyBlosxom is a lightweight weblog platform, based on Blosxom and
written in Python.

so my blogging flow is:
    + write t2t in local, of course test export
    + through svn/hg checkin some version repository
    + in server crontab action,auto:
        + check out t2t files
        + usgae t2t export .xhtml
        + usage pyblosxom-cmd  staticrender --config
/path/2/my/ export all site static pages

for blogging,i hacked v2.4, so share at first, i will try
to merge into v2.5:
    + for make TOC can click,and make TOC anchor unique:
        - in this page include several t2t export xhtml body
        - include several TOC guider list
        - with my hacked,every TOC list can click jump to that chapter
        - and every chapter can click back the right entry top
        hacking: appended one global ver as
        XHTML_TOPTOP = ""
        # hacked for generate unique top anchor seed
        def doHeader(headers, config):
            #100419:zoomq for toc fixed in multipages
            global XHTML_TOPTOP
            ret =  string.split(template, '\n')
            #   zoomq:100419 for toc in multi pages
            for i in range(len(ret)):
                if "<h1>" in ret[i]:
                    #print ret[i][4:-5]
                    XHTML_TOPTOP =
                    ret[i] = "<a name='toptop%s'
            #return string.split(template, '\n')
            return ret

        class TitleMaster:
            import base64

            # hacked for generate unique anchor seed for every TOC title
            def _get_tagged_anchor(self):
                if CONF['toc'] and self.level <= CONF['toc-level']:
                self.anchor_count = self.anchor_count + 1
                # zoomq:100414 fixed link as unique str
                unique =
                label = label or '%s%s%s'%(
                        , self.anchor_count
                        , unique[:9]
            # hacked for plugin jump back the top link usage
XHTML_TOPTOP as unique anchor seed
            def get(self):
                global XHTML_TOPTOP
                full_title = "<A href='#toptop%s'> %s </A>"
%(XHTML_TOPTOP, self._get_full_title_text())
            # hacked for generate every TOC title jump into unique anchor
            def dump_marked_toc(self, max_level=99):
                    for level, count_id, txt, label in self.toc:
                        # zoomq:100414 fixed link as unique str
                        tocStr = "%s %s%s"%(count_id,txt, label)
                        uniqueStr = base64.b64encode(base64.b32encode(tocStr))
                        if level > max_level: continue   # ignore
                        indent = '  '*level
                        id_txt = string.lstrip('%s %s'%(count_id, txt))
                        label = label or self.anchor_prefix+`toc_count`
                        label += uniqueStr[:9]

    + for uage SyntaxHighLighter
        - effect as:
        - t2t as
        - when i writing just add one line as:
::brush: py
#147 line...
        self['entryext'] = ext
        self['filebasename'] = file_basename
        - so hacked class BlockMaster can auto generate include right
Syntax support code area!
        BlockMaster->def verb(self):
            #100420:zoomq   appended for usage SyntaxHighlighter
            if "::brush:" in result[1]:
                #print result[1][2:]
                result[0] = '<PRE class="%s">'%result[1][2:]
                result[1] = ""
                #print result[0]
            #TODO maybe use if not TAGS['blockVerbClose']

that all!
t2t and PyBlosxom is all K.I.S.S;
so we can easy hacking them to working for u style ;-)
thanx for all

-- 人生苦短? Pythonic!

Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
txt2tags-list mailing list

Reply via email to