-
Notifications
You must be signed in to change notification settings - Fork 55
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
Document template fixes #1894
Document template fixes #1894
Conversation
@@ -201,7 +204,10 @@ impl DocumentTemplate { | |||
let mut env = Environment::new(); | |||
let template = build_template(&mut env, template); | |||
match template.render(NodeTemplateContext::from(node)) { | |||
Ok(document) => Box::new(std::iter::once(document.into())), | |||
Ok(mut document) => { | |||
truncate(&mut document); |
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.
mention this in the docs / try to make this configurable
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.
add helper funtion node.generate_document() to allow debugging
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.
ideally simply use multi documents for big documents
{% for (key, values) in temporal_properties|items %} | ||
{{ key }}: | ||
{% for (time, value) in values %} | ||
- changed to {{ value }} at {{ time|datetimeformat }} |
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.
allow choosing between numbers or timestamps in the API
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.
Pair reviewed with Pedro - tickets being made for spotted issues, but LGTM for now
What changes were proposed in this pull request?
Why are the changes needed?
Having default templates is a first step towards a smart search view on the generic UI
Does this PR introduce any user-facing change? If yes is this documented?
Yes, and the docstrings were updated accordingly
How was this patch tested?
Are there any further changes required?
No