From 50f58b1f50ad6159f38df88c13cbbd851c5f3581 Mon Sep 17 00:00:00 2001 From: boxgaming <75969133+boxgaming@users.noreply.github.com> Date: Tue, 14 Jun 2022 15:39:17 -0500 Subject: [PATCH] updated to use github.com/QB64Official wiki content --- source/global/IDEsettings.bas | 2 +- source/ide/ide_methods.bas | 2 +- source/ide/wiki/wiki_methods.bas | 23 ++--------------------- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/source/global/IDEsettings.bas b/source/global/IDEsettings.bas index cecc27dfc..252775bb5 100644 --- a/source/global/IDEsettings.bas +++ b/source/global/IDEsettings.bas @@ -218,7 +218,7 @@ IF result = 0 OR idedebuginfo <> 1 THEN END IF Include_GDB_Debugging_Info = idedebuginfo -wikiBaseAddress$ = "https://wiki.qb64.org" +wikiBaseAddress$ = "https://github.com/QB64Official/qb64/wiki" IF ReadConfigSetting(generalSettingsSection$, "WikiBaseAddress", value$) THEN wikiBaseAddress$ = value$ ELSE WriteConfigSetting generalSettingsSection$, "WikiBaseAddress", wikiBaseAddress$ diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 32a250965..69bc2b506 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -2270,7 +2270,7 @@ FUNCTION ide2 (ignore) IF mCLICK THEN IF (mY = idewy AND (mX >= idewx - 17 AND mX <= idewx - 4)) THEN 'view on wiki 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 url$ = StrReplace$(url$, "$", "\$") url$ = StrReplace$(url$, "&", "\&") diff --git a/source/ide/wiki/wiki_methods.bas b/source/ide/wiki/wiki_methods.bas index 6ae2977a2..1ae9e06bd 100644 --- a/source/ide/wiki/wiki_methods.bas +++ b/source/ide/wiki/wiki_methods.bas @@ -67,34 +67,16 @@ FUNCTION Wiki$ (PageName$) PCOPY 3, 0 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" - 'wiki text delimiters: - s1$ = "name=" + CHR$(34) + "wpTextbox1" + CHR$(34) + ">" - s2$ = "" - - SHELL _HIDE "curl -o " + CHR$(34) + outputFile$ + CHR$(34) + " " + url$ + SHELL _HIDE "curl -L -o " + CHR$(34) + outputFile$ + CHR$(34) + " " + url$ fh = FREEFILE OPEN outputFile$ FOR BINARY AS #fh 'get new content a$ = SPACE$(LOF(fh)) GET #fh, 1, a$ 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$ EXIT FUNCTION END FUNCTION @@ -221,7 +203,6 @@ FUNCTION Help_Col 'helps to calculate the default color END FUNCTION - SUB WikiParse (a$) 'PRINT "Parsing...": _DISPLAY