Currently, this is the description at https://wikisource.org/wiki/Wikisource:WS_Export of how the subpages are included:
Could this please be fleshed out to include how subpages are scraped for links too? I am slightly hazy on the exact details, or I would do it myself.