From: Felix W. <Fel...@gm...> - 2006-06-10 16:17:48
|
Hi, is there a reason why we wouldn't want to store the canonical name of a directive in the directive class (on the directives branch)? That would have the advantage that we only need to register the directive class itself, without having to pass a directive name (as in directives.register_directive(name, directive)). In particular, this would enable us to defer the job of registering a directive to a function outside the module that defines the directive (which may be useful once we have plugin/extension support). I cannot however foresee the consequences of either way on the i18n support, since I have no idea yet what i18n will ultimately look like in Docutils. So, any opinions? Felix -- For private mail please ensure that the header contains 'Felix Wiemann'. "the number of contributors [...] is strongly and inversely correlated with the number of hoops each project makes a contributing user go through." -- ESR |
From: David G. <go...@py...> - 2006-06-12 14:52:51
|
On 6/10/06, Felix Wiemann <Fel...@gm...> wrote: > is there a reason why we wouldn't want to store the canonical name of a > directive in the directive class (on the directives branch)? > > That would have the advantage that we only need to register the > directive class itself, without having to pass a directive name (as in > directives.register_directive(name, directive)). We only need to do this for runtime-added directives, correct? Built-in directives would continue to be "registered" via the pre-defined docutils.parsers.rst.directives._directive_registry dict? If the above is correct, then I see no reason not to put the canonical name in the directive class. Go ahead. > I cannot however foresee the consequences of either way on the i18n > support, since I have no idea yet what i18n will ultimately look like in > Docutils. If it changes at all, the i18n translations will still be external to the directive code itself. I don't anticipate any negative consequences. -- David Goodger <http://python.net/~goodger> |