-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
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
feature: add load() to template context #81
feature: add load() to template context #81
Conversation
Remove the version-specific items from the tox default environment list and rely on using the current python version instead. The CI system will still test the other versions. Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Sort the imports. Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Add a function for loading additional data sources to the template context. Include documentation with an example of how to use it to combine data sources that have different formats. Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
|
||
.. code-block:: rst | ||
|
||
.. datatemplate:csv:: inventory.csv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to only load data with the load() statement?
If so, add an inline example?
.. datatemplate::
{% set data = load('inventory.csv') %}
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good BTW!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be possible to do that using the nodata
loader. https://github.com/sphinx-contrib/datatemplates/blob/master/doc/source/nodata.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I woke up thinking about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This meets all my criteria.
Thank You @dhellmann
@janbrohl do you have any thoughts or concerns about this? |
This feature is included in release 0.8.1. |
Add a function for loading additional data sources to the template context.
Include documentation with an example of how to use it to combine data
sources that have different formats.
Closes #80