1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-09-28 11:17:47 +00:00

Merge pull request #1 from boxgaming/master

Updated to use github.com/QB64Official wiki content
This commit is contained in:
Cory Smith 2022-06-14 16:37:23 -05:00 committed by GitHub
commit 09bf6c886f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 23 deletions

View file

@ -218,7 +218,7 @@ IF result = 0 OR idedebuginfo <> 1 THEN
END IF END IF
Include_GDB_Debugging_Info = idedebuginfo Include_GDB_Debugging_Info = idedebuginfo
wikiBaseAddress$ = "https://wiki.qb64.org" wikiBaseAddress$ = "https://github.com/QB64Official/qb64/wiki"
IF ReadConfigSetting(generalSettingsSection$, "WikiBaseAddress", value$) THEN IF ReadConfigSetting(generalSettingsSection$, "WikiBaseAddress", value$) THEN
wikiBaseAddress$ = value$ wikiBaseAddress$ = value$
ELSE WriteConfigSetting generalSettingsSection$, "WikiBaseAddress", wikiBaseAddress$ ELSE WriteConfigSetting generalSettingsSection$, "WikiBaseAddress", wikiBaseAddress$

View file

@ -2270,7 +2270,7 @@ FUNCTION ide2 (ignore)
IF mCLICK THEN IF mCLICK THEN
IF (mY = idewy AND (mX >= idewx - 17 AND mX <= idewx - 4)) THEN 'view on wiki IF (mY = idewy AND (mX >= idewx - 17 AND mX <= idewx - 4)) THEN 'view on wiki
launchWiki: launchWiki:
url$ = StrReplace$(wikiBaseAddress$ + "/index.php?title=" + Back$(Help_Back_Pos), " ", "%20") url$ = StrReplace$(wikiBaseAddress$ + "/" + Back$(Help_Back_Pos), " ", "%20")
IF INSTR(_OS$, "WIN") = 0 THEN IF INSTR(_OS$, "WIN") = 0 THEN
url$ = StrReplace$(url$, "$", "\$") url$ = StrReplace$(url$, "$", "\$")
url$ = StrReplace$(url$, "&", "\&") url$ = StrReplace$(url$, "&", "\&")

View file

@ -67,34 +67,16 @@ FUNCTION Wiki$ (PageName$)
PCOPY 3, 0 PCOPY 3, 0
END IF END IF
url$ = CHR$(34) + wikiBaseAddress$ + "/index.php?title=" + PageName2$ + "&action=edit" + CHR$(34) url$ = CHR$(34) + wikiBaseAddress$ + "/" + PageName2$ + ".md" + CHR$(34)
outputFile$ = Cache_Folder$ + "/" + PageName2$ + ".txt" outputFile$ = Cache_Folder$ + "/" + PageName2$ + ".txt"
'wiki text delimiters: SHELL _HIDE "curl -L -o " + CHR$(34) + outputFile$ + CHR$(34) + " " + url$
s1$ = "name=" + CHR$(34) + "wpTextbox1" + CHR$(34) + ">"
s2$ = "</textarea>"
SHELL _HIDE "curl -o " + CHR$(34) + outputFile$ + CHR$(34) + " " + url$
fh = FREEFILE fh = FREEFILE
OPEN outputFile$ FOR BINARY AS #fh 'get new content OPEN outputFile$ FOR BINARY AS #fh 'get new content
a$ = SPACE$(LOF(fh)) a$ = SPACE$(LOF(fh))
GET #fh, 1, a$ GET #fh, 1, a$
CLOSE #fh CLOSE #fh
s1 = INSTR(a$, s1$)
IF s1 > 0 THEN
'clean up downloaded contents
a$ = MID$(a$, s1 + LEN(s1$))
s2 = INSTR(a$, s2$)
IF s2 > 0 THEN
a$ = LEFT$(a$, s2)
END IF
OPEN outputFile$ FOR OUTPUT AS #fh 'clear old content
PRINT #fh, a$ 'save clean content
CLOSE #fh
END IF
Wiki$ = a$ Wiki$ = a$
EXIT FUNCTION EXIT FUNCTION
END FUNCTION END FUNCTION
@ -221,7 +203,6 @@ FUNCTION Help_Col 'helps to calculate the default color
END FUNCTION END FUNCTION
SUB WikiParse (a$) SUB WikiParse (a$)
'PRINT "Parsing...": _DISPLAY 'PRINT "Parsing...": _DISPLAY