Open luc-j-bourhis opened 1 year ago
I like that idea!
I’ll move it to the nanoc/features
repository, where I collect ideas for features and improvements.
If you want to and feel up for it, you can open up a PR. The Capturing helper has a test suite that hopefully should be pretty easy to adjust too.
Current behaviour
In its current incarnation, the capturing helper is cut-and-paste. That is to say that the following
will output
If one wants the captured text where it was written, one has to paste it right after cutting it
Or course
<%= content_for(..., :summary) %>
would be used elsewhere!Desired behavior
But I have a use case where a paragraph is used as an introduction on several different pages. It would be nice to have an option to avoid typing
<%= content_for(@item, :summary) %>
just after the capturing context. Maybe something like.which would result in
as well as capturing the paragraph to be reused elsewhere. I.e. copy-and-paste.