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 an expression for reading contents of files #4

Closed
loreanvictor opened this issue Dec 9, 2022 · 2 comments
Closed

Add an expression for reading contents of files #4

loreanvictor opened this issue Dec 9, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@loreanvictor
Copy link
Owner

This can be used to include some files within each other, better yet to conditionally include sections and what not:

# .tmplr.yml
steps:
  - if: some_condition
    read: header
    from file: ./_some_case.md
    else:
      read: header
      from file: ./_some_other_case.md

  - update: README.md
<!-- README.md -->

{{ tmplr.header }}

# Some other stuff

Ha ha ho ho
@loreanvictor loreanvictor added the enhancement New feature or request label Dec 9, 2022
@loreanvictor
Copy link
Owner Author

loreanvictor commented Aug 6, 2023

Similar to the proposed write command, this command could also support reading special values from JSON / YAML files.

read: some_variable
from file: conf.json
at: /path/to/key

@loreanvictor
Copy link
Owner Author

resolved via 8ce8644

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

No branches or pull requests

1 participant