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

Can't import (multiline) text within a template #17

Open
0cv opened this issue Jan 18, 2023 · 0 comments
Open

Can't import (multiline) text within a template #17

0cv opened this issue Jan 18, 2023 · 0 comments

Comments

@0cv
Copy link

0cv commented Jan 18, 2023

I'm using the syntax !? $import('name_of_the_file.yaml') to import a yaml file into my (yaml) template. Except that I'd like that this imported file be treated as text rather than yaml:

template.yaml

Key1: Val1
Key2: !? $import('related.yaml')

related.yaml

a:
  b: 10

Once compiled:

Key1: Val1
Key2: 
  a:
    b: 10

Whereas I'd like:

Key1: Val1
Key2: |
  a:
    b: 10

I've tried various options such as:
1- adding a simple pipe | and wrapping the import

Key1: Val1
Key2: |
   !? $import('related.yaml')

But this ends up as

Key1: Val1
Key2: "!? $import('related.yaml')\n"

2- Trying to indent more or less !? $import('related.yaml') result in an error

I'd not mind adding this pipe manually through some Yglu syntax, but I couldn't figure out how to do it (whether it's possible?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant