pecr
Version, currently main branch1 version
- main branchlatestFeb 23, 2024
github.com/xendk/pecr.cr
Partial template rendering for ECR
Installation
# Add this to your shard.yml
dependencies:
pecr:
github: xendk/pecr.cr
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.11.2- License
- MIT
- Author
- Thomas Fini Hansen
Dependencies
This version declares no dependencies.
README
PECR
PECR is an extension of ECR templates that supports partial
rendering.
PECR should be a drop-in replacement of ECR (please file an issue if you discover this is not the case).
<% #partial my-partial -%>: Start of partial named "my-partial"<% #end -%>: End of the current partial
These should be lines of their own, as the partial is currently defined as starting on the line following the start tag, and ending on the line before the end tag. The dashes in "-%>" are optional, but suppresses any newlines when rendering the full template.
Rendering a partial is done by appending a hash and the name of the partial to the file name:
PECR.render("file.ecr#partial")
Installation
-
Add the dependency to your
shard.yml:dependencies: pecr: github: xendk/pecr -
Run
shards install
Usage
require "pecr"
PECR.render("file.ecr#partial")
Contributing
- Fork it (https://github.com/xendk/pecr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Thomas Fini Hansen - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Feb 23, 2024
- Crystal
1.11.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/xendk/pecr.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1