From: Yuri T. <qar...@gm...> - 2008-10-17 17:52:39
|
> One thing that *might* be related to toc generation is more of a "tag > cloud" generation thing... Heres a description of what I mean: What may be useful for us to think about is how / whether both TOC and some sort of tagcloud extension would work with multiple files. I would assume that tagcloud would usually be more useful when it covers multiple pages. TOC would _usually_ be used with a single page. However, a multi-page TOC may be useful in some cases. Up to now, the extensions has been allowed to be sticky by default. I haven't tested it recently, but the footnote extension is really supposed to allow you to run multiple files collecting the footnote info and then dump the actual footnotes into a third. If you want to forget what footnotes you've seen in earlier files, you need to call Markdown.reset(). Two issues with this. First, I've been wondering if this is a good default solution. Perhaps it would be best to default to a clean-slate processing. Instead of convert() and reset(), we could have convert() and convertMore(), with convert() always resetting the state completely. So, your usage would be: m = Markdown(extensions=["tagcloud"]) for x in pages: m.convertMore(x) tagcloud = m.convertMore("[TagCloud]") Second, however, for this to be useful, extensions need to be able to somehow keep track of what is coming from what file. So, convert() and convertMore() would need to take some sort of ID parameter. In other words, m.convertMore(page_source, id) would let the tagcloud extension collect the tags knowing where those tags are coming from and then generate proper links. So, we would get something like: m = Markdown(extensions=["tagcloud"]) for id in page_ids: converted[id] = m.convertMore(raw_pages[id], id) tagcloud = m.convertMore("[TagCloud]") - yuri -- http://sputnik.freewisdom.org/ |