We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, when creating a Template object with multiple parameters, users need to call template.add() separately for each name-value pair.
Template
template.add()
param_dict = { 'foo': 'bar', 'eggs': 'spam', } template = mwparserfromhell.nodes.template.Template('name') for k, v in param_dict.items(): template.add(k, v)
This process can be tedious and less efficient, especially when dealing with a large number of parameters.
Proposed solutions:
param_dict = { 'foo': 'bar', 'eggs': 'spam', } template = mwparserfromhell.nodes.template.Template('name', params=param_dict)
add_all()
**kwargs
param_dict = { 'foo': 'bar', 'eggs': 'spam', } template = mwparserfromhell.nodes.template.Template('name') template.add_all(**param_dict)
Benefits:
I'd be happy to start working on a PR for this, but wanted to get feedback from the community first before proceeding to implementation.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, when creating a
Template
object with multiple parameters, users need to calltemplate.add()
separately for each name-value pair.This process can be tedious and less efficient, especially when dealing with a large number of parameters.
Proposed solutions:
Allow users to pass the parameters as a dict directly when creating a
Template
object.Introduce a new method in
Template
, such asadd_all()
, to allow adding multiple parameters at once using**kwargs
.Benefits:
Template
objectsI'd be happy to start working on a PR for this, but wanted to get feedback from the community first before proceeding to implementation.
The text was updated successfully, but these errors were encountered: