[Moin-user] Linking using # (reference)
bragiba at simi.is
bragiba at simi.is
Tue Oct 23 09:19:11 EDT 2001
In the code below I am making an acronym page which will link an acronym to
an AcronymIndex page and a reference on that page indicated by #.
After updating to the latest MoinMoin version my # get turned into a _23
which is not what I want.
Taking a look at the html source that MoinMoin generates you can see that
the _23 has been replaced for my #.
Do you have any clue how this happened?
<a class="nonexistent" href
="/wiki-moinmoin/moin.cgi/AcronymIndex_23B">ACRONYM</a>
Best Regards,
Bragi
def _macro_Acronym(self, acronym):
"""This macro makes a link out of an acronym"""
first_letter = string.upper(acronym[0])
return Page("AcronymIndex#%s" % first_letter).link_to(acronym)
def _macro_AcronymIndex(self, args):
"""This macro opens the page acronyms.txt. Extracts all the macros
and explanations and
creates an index page similar to a title index"""
index_letters = []
s = ''
page = open('c:/Inetpub/wwwroot/acronyms/acronyms.txt', 'r')
lines = page.readlines()
page.close()
current_letter = None
for line in lines:
split = string.split(line, ';')
try:
acronym = string.strip(split[0])
definition = string.strip(split[1])
except IndexError:
pass
letter = acronym[0]
if letter not in index_letters:
index_letters.append(letter)
if letter <> current_letter:
s = s + '</table>\n<a name="%s"><h3>%s</h3></a>\n<table>' %
(
wikiutil.quoteWikiname(letter), string.replace(letter,
'~', 'Others'))
current_letter = letter
s = s + '\n<tr>\n <td><b>%s</b></td><td>%s</td>\n</tr>\n' %
(acronym, definition)
s = s + '</table>'
return _make_index_key(index_letters, s)
Með kveðju
Bragi Baldursson
GPRS Kerfisverkfræðingur
Sími 550-6308
Gsm 892-6308
Netfang: bragiba at siminn.is
Veffang: http://www.siminn.is
- Síminn auðveldar samskipti -
_______________________________________________________________________
Þessi tölvupóstur og viðhengi hans gætu innihaldið trúnaðarupplýsingar
eingöngu ætlaðar þeim sem hann er stílaður á. Efni tölvupóstsins og
viðhengi er á ábyrgð sendanda ef það tengist ekki starfsemi Símans.
Sjá nánar: http://www.siminn.is/um_okkur/almennt/tolvupostur.asp
This e-mail and its attachments may contain confidential and privileged
information only intended for the person or entity to which it is
addressed.
Further information: http://www.siminn.is/english/about_us/email.asp
_______________________________________________________________________
More information about the Moin-user
mailing list