On 2009-11-13, David Goodger wrote:
> On Wed, Nov 11, 2009 at 06:58, <milde@...> wrote:
>> New function filter_settings_spec
>> Return a copy of `settings_spec` excluding the specified settings.
> What is the purpose of this new function?
Enable code inheritance.
Up to now, a writer inheriting from another one (like the S5/HTML
Slideshow Writer, can replace the parents `settings_spec` or append to it
but not modify it:
append:
-1 settings without effect keep turning up in the --help output.
replace:
-1 code duplication.
modify:
! settings_spec is a tuple of tuples,
! settings_spec is *very* compact an complex.
With the new function, it is possible to specify a modified version of
the parent's settings_spec:
Return a copy of `settings_spec` excluding/replacing some settings.
`settings_spec` is a tuple of configuration settings with a structure
described for docutils.SettingsSpec.settings_spec.
Optional positional arguments are names of to-be-excluded settings.
Keyword arguments are option specification replacements.
(See the html4strict writer for an example.)
> Why did you add it?
To make it easier for Docutils users and developers to create writer
variants based on the writers that ship with Docutils.
There is a concrete usage case for the html4strict writer (in the
sandbox) and intended use for the upcoming "xelatex" writer (support for
the Unicode-aware LaTeX variant XeLaTeX).
Please advise, if there is a more suitable place for this functionality.
Thanks,
Günter
|