rjbs / Pod-Weaver

recombine pod documents into awesomer pod documents
26 stars 28 forks source link

keep =for and =begin sections together with the =head1 they were found under #45

Open karenetheridge opened 7 years ago

karenetheridge commented 7 years ago

This means that elements such as stopwords and lists will get moved along with the head1 sections they were declared under, when that section is moved to another position in the document.

karenetheridge commented 7 years ago

note to self: when this is released, I can merge waiting/h1-nester in Dist-Zilla-PluginBundle-Author-ETHER.

rjbs commented 7 years ago

I'm not sure that this should be an unconditional change. There are different kinds of regions. Some of them represent top-level content, and others are just shorthand for Pod. Clearly a :list region should stay under its H1.

If this was already not happening, I'd think something was really weird. I use :list all the time, and they don't wander around the document. That's because :list is generally applied by the Pod::Weaver::Plugin::Transformer plugin, which is a Dialect, meaning it runs before H1Nester.

So, then we're at things like stopwords, which I'm not comfortable saying should always be contained by the leading head1. Where does it matter?

What if instead, H1Nester took an option of regions_to_collect?

karenetheridge commented 7 years ago

To think about it in the reverse direction -- when would we have a =for or =begin that both isn't Transformed before H1Nester runs, and we don't want to get moved along with its preceding head1? I can't think of any -- stopwords and html are content that should stay grouped.

karenetheridge commented 7 years ago

..but I have no objection to configuring which regions to collect, as that's easy to set and forget in a weaver bundle.