Not sure if this will be helpful to you. There is a Bookchef gem that allows you to generate a book (with links and footnotes) from an xml file. This is convenient if you want to use only your favorite code editor and version control system.
But this has nothing to do with link formatting.