Common stuffs for epub creation implemented in javascript