Comments (4)
I would love to support this. Unfortunately yaml-rust2
does not support serde today. serde_yaml2
which uses yaml-rust2
does support serde, but it does not support anchors: https://github.com/zim32/serde_yaml2/blob/06d2d5ecca84c6d3c0d5e2f3cbac75bf2cc97e1e/src/de/mod.rs#L275-L277
So the actual work required here is quite high. Ideally support for this lands in a YAML library that directly supports serde.
from minijinja.
Turns out serde_yml
does support aliases but it only supports a singular merge key. So this would not be supported:
dict1: &dict1_anchor
key1: value1
dict2: &dict2_anchor
key2: value2
dict3:
<<: *dict1_anchor
<<: *dict2_anchor
key3: value3
However this would be:
dict1: &dict1_anchor
key1: value1
dict2: &dict2_anchor
key2: value2
dict3:
<<: [*dict1_anchor, *dict2_anchor]
key3: value3
from minijinja.
Well, the library you mentioned doesn't seem to be well maintained too unfortunately. Also, is it that hard to convert serde_yaml
's Value
into yaml-rust2
's Yaml
(by implementing TryFrom
or something)? Sorry for naive question, I'm a novice in Rust.
from minijinja.
I cannot say because I'm not entirely sure how Alias
is being handled in yaml-rust2
. With buffering it wouldn't be too hard would be my guess but again, I cannot say. In general that is something I would not want to maintain as part of MiniJinja. If functionality lands in a serde compatible crate I would switch to it.
from minijinja.
Related Issues (20)
- Custom time format strings HOT 5
- UndefinedBehavior::Strict and undefined key in mapping HOT 4
- Option to always chomp whitespace HOT 3
- async support for Object trait HOT 1
- Add support for the `*` operator HOT 2
- actix_web使用的时候正确使用示例有吗?
- How can env.add_function call asynchronous functions HOT 3
- Drop Serde Dependency HOT 2
- May I ask how to convert my JSON string into a JSON variable in the template HOT 2
- Cycle error triggered by multiple `include`s of templates that `extend` the same parent template
- Context not passed into state of custom functions when called within macro HOT 7
- How to set the default value for Option<String>variable when it is empty HOT 3
- starlark integration HOT 4
- What are the element types of Macro? HOT 1
- Filter in child template replaces other filter in parent template HOT 3
- Serialized Value cannot Deserialize HOT 4
- Break/continue support HOT 2
- Unable to set an undefined_behavior for a minijinja Enviroment in Python HOT 1
- Support line-based comment. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minijinja.