Skip to content
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 toyaml, fromyaml context methods #1911

Closed
clrcrl opened this issue Nov 8, 2019 · 1 comment
Closed

Add toyaml, fromyaml context methods #1911

clrcrl opened this issue Nov 8, 2019 · 1 comment
Labels
enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors!

Comments

@clrcrl
Copy link
Contributor

clrcrl commented Nov 8, 2019

Describe the feature

Make toyaml and fromyaml methods.
toyaml should have an optional argument, sort_keys=False.
Similar to tojson, fromjson methods.
I'd use this when using a macro to generate schema.yml files.

Describe alternatives you've considered

Here is how I currently do it:

{% set sources_yaml=[] %}

{% do sources_yaml.append('version: 2') %}
{% do sources_yaml.append('') %}
{% do sources_yaml.append('sources:') %}
{% do sources_yaml.append('  - name: ' ~ schema_name | lower) %}
...
@clrcrl clrcrl added enhancement New feature or request triage labels Nov 8, 2019
@drewbanin drewbanin removed the triage label Nov 11, 2019
@drewbanin drewbanin added this to the 0.15.2: Barbara Gittings milestone Nov 11, 2019
@drewbanin drewbanin added the good_first_issue Straightforward + self-contained changes, good for new contributors! label Dec 18, 2019
beckjake added a commit that referenced this issue Jan 10, 2020
@beckjake
Copy link
Contributor

Fixed in #2036

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good_first_issue Straightforward + self-contained changes, good for new contributors!
Projects
None yet
Development

No branches or pull requests

3 participants