[Moin-user] Managing line anchors from within a parser

Mathieu Champlon m.champlon at free.fr
Wed Feb 13 04:04:06 EST 2008


Hello !

I have been writing a custom parser which basically transforms some 
formatted data into a table.
The output can sometimes be quite huge and spotting the differences 
between page revisions when triggering a 'diff' action can prove really 
cumbersome.
Actually the "official" parsers (text_python.py for instance) have the 
same "issue", see for instance the following 'diff' and notice how the 
line 200 anchor does not refer to the correct location : 
http://moinmo.in/4ct10n/info/FeatureRequests/SecurityRules?action=diff&rev2=34&rev1=33

I have been trying without success to "fix" the line anchors so that 
they appear at the correct locations in the output.
The current implementation seems to stack the anchors on one line (when 
scanning the input lines before calling a custom parser).
Within my parser I can add an anchor by calling :
    formatter.line_anchordef(self.lineno)
However there does not seem to be possible neither to retrieve the start 
line number upon parser invocation nor to prevent the text_moin_wiki 
parser to insert its own anchor for each line it scans.

Have I missed something obvious (I'm fairly new both to python and 
moinmoin coding) ?

Thanks !

MAT.





More information about the Moin-user mailing list