import markdown, urllib2 # # Downloading lua_api.txt # print("Downloading lua_api.txt...") url = "https://raw.githubusercontent.com/minetest/minetest/master/doc/lua_api.txt" text = urllib2.urlopen(url).read() header = """Minetest Lua Modding API Reference 0.4.11 =========================================""" text = text.replace(header, "") # # Generating HTML # print("Generating HTML...") md = markdown.Markdown(extensions=['markdown.extensions.toc']) links = """