-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Add support for dot notation #43
Comments
I am looking to add this to the rust template benchmark but I think dot notation is required to do it properly. |
It shouldn't be too hard to do, I've commented on this in previous issue. @Th3Whit3Wolf I assume this is mostly for repeated sections? |
@maciejhirsz yeah I have something like this #[derive(Content)]
struct BigTable {
table: Vec<Vec<usize>>,
}
static BIG_TABLE_TEMPLATE: &'static str = "<table>\
{{#table}}\
<tr>{{#.}}<td>{{.}}</td>{{/.}}</tr>\
{{/table}}\
</table>";
pub fn big_table(b: &mut criterion::Bencher<'_>, size: &usize) {
let mut table = Vec::with_capacity(*size);
for _ in 0..*size {
let mut inner = Vec::with_capacity(*size);
for i in 0..*size {
inner.push(Value::Scalar((i as i32).into()));
}
table.push(Value::Array(inner));
}
let big_table_data = BigTable {
table
};
let template = Template::new(BIG_TABLE_TEMPLATE).unwrap();
b.iter(|| template.render(&big_table_data {
}));
} Where I need to access the value of a |
Is there a way to do something like |
For example,
The text was updated successfully, but these errors were encountered: