[Moin-user] TableOfContents suggestion
Michael Matthews
mjmatthews1 at rcn.com
Fri Dec 16 07:37:05 EST 2005
Nir Soffer wrote:
>
> On 16 Dec, 2005, at 6:39, Michael Matthews wrote:
>
>> attr =
>> self.macro.formatter.langAttr(self.macro.request.content_lang)
>> attr['id'] = 'table-of-contents'
>> self.result.append(self.macro.formatter.open('div',
>> newline=1, attr=attr))
>>
>> self.process_lines(self.pre_re.sub('',self.macro.parser.raw).split('\n'
>> ),
>> self.macro.formatter.page.page_name)
>> # Close pending lists
>> for i in range(self.baseindent, self.indent):
>> self.result.append(self.macro.formatter.listitem(0))
>> self.result.append(self.macro.formatter.number_list(0))
>> self.result.append(self.macro.formatter.close('div'))
>>
>
> Dont do that! formatter.open and close are private formatter methods,
> and are not part of the formatter public interface, which is all
> methods in formatter/base.py. Using these methods will break with
> AttributeError when using different formatter.
>
> Since there is way to create div currently, you have to do something
> like this:
>
> formatter.rawHTML('<div id="foo">')
> ...
> formatter.rawHTML('</div>')
>
> Non html formatters will ignore raw HTML calls.
>
>
> Best Regards,
>
> Nir Soffer
>
Nir
it doesn't work. I welcome any suggestion as to the proper MM way to do
this.
Do ya'll agree that this is proper html structure?
More information about the Moin-user
mailing list