Split link generation, table of contents, and image functions from the