|
|
|
@ -7,6 +7,8 @@ import html5lib
|
|
|
|
|
from functions import Colors
|
|
|
|
|
import argparse
|
|
|
|
|
from xml.etree import ElementTree as ET
|
|
|
|
|
from urllib.parse import quote as urlquote, unquote as urlunquote
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p = argparse.ArgumentParser(description="Dump wiki files to html",
|
|
|
|
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
|
|
|
@ -37,9 +39,11 @@ def filenameforpage(p):
|
|
|
|
|
return f
|
|
|
|
|
|
|
|
|
|
def filenameforlink(href):
|
|
|
|
|
href = urlunquote(href)
|
|
|
|
|
if href.startswith("/sandbox/itchwiki/index.php/"):
|
|
|
|
|
href = href[len("/sandbox/itchwiki/index.php/"):]
|
|
|
|
|
return href.replace(' ','_').replace('/', SLASH) + '.html'
|
|
|
|
|
href = href.replace(' ','_').replace('/', SLASH) + '.html'
|
|
|
|
|
href = urlquote(href)
|
|
|
|
|
return href
|
|
|
|
|
|
|
|
|
|
def rewritelinks (html):
|
|
|
|
|