as Chinese Pythoner, love t2t;-)
from 2004 usage t2t in everywhere
when blogging,i usage PyBlosxom:
    http://blog.zoomquiet.org/pyblosxom
PyBlosxom is a lightweight weblog platform, based on Blosxom and
written in Python.
    http://pyblosxom.sourceforge.net/
    http://blosxom.com/

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/config.py export all site static pages

for blogging,i hacked txt2tags.py v2.4, so share at first, i will try
to merge into v2.5:
    + for make TOC can click,and make TOC anchor unique:
        - http://blog.zoomquiet.org/pyblosxom/utility/Subversion/
        - 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 =
base64.b64encode(base64.b32encode(ret[i][4:-6]))[:9]
                    ret[i] = "<a name='toptop%s'
id='toptop%s'></a>%s"%(XHTML_TOPTOP
                        ,XHTML_TOPTOP
                        ,ret[i]
                        )
                    break
            #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 =
base64.b64encode(base64.b32encode(self._get_full_title_text()))
                label = label or '%s%s%s'%(
                        self.anchor_prefix
                        , 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:
        - 
http://blog.zoomquiet.org/pyblosxom/techic/PyBlosxom/blosxom/croe-hack-file-entry-2006-01-27-23-23.html
        - t2t as
http://blog.zoomquiet.org/pybnodes/techic/PyBlosxom/blosxom/croe-hack-file-entry-2006-01-27-23-23.t2t
        - 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!
        hacking:
        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

-- 
http://zoomquiet.org 人生苦短? 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.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list

Reply via email to