Split large pages into page + subpages

Hi all

I wonder if there’s a way to split large pages into a page with subpages, based on their headers. I remember that twiki offered that functionality.

It would turn something like

Page 1 (source)

= main page header =
== header 1 ==
=== subheader 1 ===
...

into

Page 1 (result)

= main page header =
[[Header 1]]

Header 1 (result)

= Header 1 =
== Subheader 1 ==

Anything? I searched for “split” and “large page” and stuff, but didn’t find anything similar.

Cheers

André

That’s not built in but everything is doable in XWiki…

You could check the second example on https://www.xwiki.org/xwiki/bin/view/FAQ/How+to+search+and+replace+content+programmatically (the one using Groovy) and use that to extract all SectionBlocks and for each one found create a new document programmatically and set its content.

See also http://platform.xwiki.org/xwiki/bin/view/DevGuide/APIGuide#HCreateanewDocument