Oddmuse:Permanent_Anchors added experimental support for anchored objects.
Example: <include "TextGraveyard"> includes TextGraveyard.
I often times wish I had a public graveyard for the gigantic swaths of text that I regularly throw out of my writing.
This is after the TransClusion. Currently this only works for local permanent anchors, and doesn’t take the various installed markup rules into account.
Wow, thank you, Alex! Is this where you added that?:
=head2 Anchor Objects
224
225 An anchor object is the text that starts after the anchor definition
226 and goes up to the next heading, horizontal line, or the end of the
227 page. By redefining C<GetPageContent> to work on anchor objects we
228 automatically allow internal transclusion.
229
230 =cut
231
232 *OldPermanentAnchorsGetPageContent = *GetPageContent;
233 *GetPageContent = *NewPermanentAnchorsGetPageContent;
234
235 sub NewPermanentAnchorsGetPageContent {
236 my $id = shift;
237 my $result = OldPermanentAnchorsGetPageContent($id);
238 if (not $result and $PermanentAnchors{$id}) {
239 $result = OldPermanentAnchorsGetPageContent($PermanentAnchors{$id});
240 $result =~ s/^(.*\n)*.*\[::$id\]// or return '';
241 $result =~ s/(\n=|\n----|\[::$FreeLinkPattern\])(.*\n)*.*$//o;
242 }
243 return $result;
244 }So, we should use a
----
…if there is no desired presence of “end of page” or next heading.
Uh-oh! I got rid of a weird slash at the end of my entry, saved, and then looked back at this page…
…it isn’t transcluding any more!
Oh wait, … It’s back now.. Ne’er mind!
Really very nice!
@Sam: Yes.