I'm using a kind of half-assed translator program, but it could surely be improved upon.
SetVirtualResolution(1536, 768)
SetPrintSize(20)
` navigate to the AGK help files,
` and load the command you want
f$ = ChooseRawFile("*.htm;*.html")
OpenToRead(1, f$)
while FileEOF(1) <> 1
c$ = ReadLine(1)
endwhile
CloseFile(1)
for p = 1 to len(c$)
if mid(c$, p, 1) = chr(34)
a$ = a$ + "'"
else
a$ = a$ + mid(c$, p, 1)
endif
next p
lastChar = len(a$)
i = 1
b$ = ""
b$ = b$ + "=[[Home]]=" + chr(10)
b$ = b$ + "=Return to [[Index of commands]]=" + chr(10)
` this should be customized for each category
b$ = b$ + "=[[Sprites|Sprite Commands]]=" + chr(10) + chr(10)
while i <= lastChar
ti = i
gosub check
if i = ti
b$ = b$ + mid(a$, i, 1)
i = i + 1
endif
endwhile
` the text in this file should be copied and pasted into the
` wiki page for this command - make sure you are in the wikitext
` edit mode. Then you copy the command syntax into the line above
` it, replacing the word "code"
OpenToWrite(1, "wiki.txt")
WriteString(1, b$)
CloseFile(1)
do
Print(b$)
Sync()
loop
check:
if mid(a$, i, 15) = "Definition</h2>"
b$ = b$ + "Definition==" + chr(10)
b$ = b$ + "|| tier || type || command and parameters ||" + chr(10)
i = i + 15
return
endif
if mid(a$, i, 3) = "<p>"
b$ = b$ + chr(10)
i = i + 3
return
endif
if mid(a$, i, 4) = "</p>"
b$ = b$ + chr(10)
i = i + 4
return
endif
if mid(a$, i, 4) = "<h1>"
b$ = b$ + "="
i = i + 4
return
endif
if mid(a$, i, 5) = "</h1>"
b$ = b$ + "=" + chr(10)
i = i + 5
return
endif
if mid(a$, i, 4) = "<h2>"
b$ = b$ + "=="
i = i + 4
return
endif
if mid(a$, i, 5) = "</h2>"
b$ = b$ + "==" + chr(10)
i = i + 5
return
endif
if mid(a$, i, 3) = "<i>"
b$ = b$ + "//"
i = i + 3
return
endif
if mid(a$, i, 4) = "</i>"
b$ = b$ + "//"
i = i + 4
return
endif
if mid(a$, i, 6) = "</div>"
b$ = b$ + chr(10)
i = i + 6
return
endif
if mid(a$, i, 4) = "<ul>"
i = i + 4
return
endif
if mid(a$, i, 5) = "</ul>"
i = i + 5
return
endif
if mid(a$, i, 4) = "<li>"
b$ = b$ + "* "
i = i + 4
return
endif
if mid(a$, i, 5) = "</li>"
b$ = b$ + chr(10)
i = i + 5
return
endif
if mid(a$, i, 9) = "<br><br> "
b$ = b$ + chr(10)
i = i + 9
return
endif
if mid(a$, i, 8) = "<br><br>"
b$ = b$ + chr(10)
i = i + 8
return
endif
if mid(a$, i, 47) = "<div id='basicCodeBlock1' class='basiccode'><p>"
b$ = b$ + "||**<span style=" + chr(34) + "color: #0000ff;" + chr(34)
b$ = b$ + ">Tier 1</span>**"
b$ = b$ + "||**<span style=" + chr(34) + "color: #0000ff;" + chr(34)
b$ = b$ + ">integer</span>**"
b$ = b$ + "||**<span style=" + chr(34) + "color: #0000ff;" + chr(34)
b$ = b$ + ">code</span>**||" + chr(10)
i = i + 47
return
endif
if mid(a$, i, 47) = "<div id='basicCodeBlock3' class='basiccode'><p>"
b$ = b$ + "||**<span style=" + chr(34) + "color: #0000ff;" + chr(34)
b$ = b$ + ">Tier 1</span>**"
b$ = b$ + "||**<span style=" + chr(34) + "color: #0000ff;" + chr(34)
b$ = b$ + ">integer</span>**"
b$ = b$ + "||**<span style=" + chr(34) + "color: #0000ff;" + chr(34)
b$ = b$ + ">code</span>**||" + chr(10)
i = i + 47
return
endif
if mid(a$, i, 64) = "<div id='cppCodeBlock2' style='display:none' class='cppcode'><p>"
b$ = b$ + "||**<span style=" + chr(34) + "color: #008000;" + chr(34)
b$ = b$ + ">Tier 2</span>**"
b$ = b$ + "||**<span style=" + chr(34) + "color: #008000;" + chr(34)
b$ = b$ + ">int</span>**"
b$ = b$ + "||**<span style=" + chr(34) + "color: #008000;" + chr(34)
b$ = b$ + ">code</span>**||" + chr(10)
i = i + 64
return
endif
if mid(a$, i, 64) = "<div id='cppCodeBlock4' style='display:none' class='cppcode'><p>"
b$ = b$ + "||**<span style=" + chr(34) + "color: #008000;" + chr(34)
b$ = b$ + ">Tier 2</span>**"
b$ = b$ + "||**<span style=" + chr(34) + "color: #008000;" + chr(34)
b$ = b$ + ">int</span>**"
b$ = b$ + "||**<span style=" + chr(34) + "color: #008000;" + chr(34)
b$ = b$ + ">code</span>**||" + chr(10)
i = i + 64
return
endif
if mid(a$, i, 18) = "<div class='footer"
i = lastChar + 1
endif
return
EDITED to improve the code, less fine-tuning required with this version.