Skip to content

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

@0cv

Description

@0cv

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions