From c689ddf47907a1cd30b05896088d11f6d8097cda Mon Sep 17 00:00:00 2001 From: Cory Smith Date: Fri, 24 Jun 2022 14:00:44 -0500 Subject: [PATCH] Updating Wiki Functionality (still more to do). --- build.bat | 3 + source/global/IDEsettings.bas | 8 +- source/ide/ide_methods.bas | 8 +- source/ide/wiki/wiki_methods.bas | 543 ++++++++++++++++++++----------- 4 files changed, 367 insertions(+), 195 deletions(-) create mode 100644 build.bat diff --git a/build.bat b/build.bat new file mode 100644 index 000000000..1f2401fb8 --- /dev/null +++ b/build.bat @@ -0,0 +1,3 @@ +@echo off +qb64.exe -x source\qb64.bas -o qb64-dev.exe +qb64-dev.exe \ No newline at end of file diff --git a/source/global/IDEsettings.bas b/source/global/IDEsettings.bas index 252775bb5..40fffbc17 100644 --- a/source/global/IDEsettings.bas +++ b/source/global/IDEsettings.bas @@ -220,11 +220,15 @@ Include_GDB_Debugging_Info = idedebuginfo wikiBaseAddress$ = "https://github.com/QB64Official/qb64/wiki" IF ReadConfigSetting(generalSettingsSection$, "WikiBaseAddress", value$) THEN + IF value$ = "https://wiki.qb64.org" THEN + WriteConfigSetting generalSettingsSection$, "WikiBaseAddress", wikiBaseAddress$ + ELSE wikiBaseAddress$ = value$ -ELSE WriteConfigSetting generalSettingsSection$, "WikiBaseAddress", wikiBaseAddress$ + END IF +ELSE + WriteConfigSetting generalSettingsSection$, "WikiBaseAddress", wikiBaseAddress$ END IF - 'Mouse settings --------------------------------------------------------------- result = ReadConfigSetting(mouseSettingsSection$, "SwapMouseButton", value$) IF UCASE$(value$) = "TRUE" OR VAL(value$) = -1 THEN diff --git a/source/ide/ide_methods.bas b/source/ide/ide_methods.bas index 69bc2b506..52a4a924f 100644 --- a/source/ide/ide_methods.bas +++ b/source/ide/ide_methods.bas @@ -5276,12 +5276,12 @@ FUNCTION ide2 (ignore) END IF IF menu$(m, s) = "Keyword #Index" THEN PCOPY 3, 0: SCREEN , , 3, 0 - lnk$ = "Keyword Reference - Alphabetical" + lnk$ = "Keyword Reference (Alphabetical)" GOTO OpenHelpLnk END IF IF menu$(m, s) = "#Keywords by Usage" THEN PCOPY 3, 0: SCREEN , , 3, 0 - lnk$ = "Keyword Reference - By usage" + lnk$ = "Keyword Reference (Usage)" GOTO OpenHelpLnk END IF @@ -18791,7 +18791,7 @@ SUB ideupdatehelpbox IF LEN(f$) = 2 THEN f$ = CHR$(0) 'Prepend core pages to list - f$ = CHR$(0) + "Keyword_Reference_-_By_usage.txt" + f$ + f$ = CHR$(0) + "Keyword-Reference---(Usage).txt" + f$ f$ = CHR$(0) + "QB64_Help_Menu.txt" + f$ f$ = CHR$(0) + "QB64_FAQ.txt" + f$ UpdateStep = UpdateStep + 1 @@ -18801,7 +18801,7 @@ SUB ideupdatehelpbox 'Download and PARSE alphabetical index to build required F1 help links FullMessage$(1) = "Regenerating keyword list..." Help_Recaching = 1: Help_IgnoreCache = 1 - a$ = Wiki$("Keyword Reference - Alphabetical") + a$ = Wiki$("Keyword Reference (Alphabetical)") Help_Recaching = 0: Help_IgnoreCache = 0 WikiParse a$ UpdateStep = UpdateStep + 1 diff --git a/source/ide/wiki/wiki_methods.bas b/source/ide/wiki/wiki_methods.bas index 1ae9e06bd..f2604b50a 100644 --- a/source/ide/wiki/wiki_methods.bas +++ b/source/ide/wiki/wiki_methods.bas @@ -1,6 +1,6 @@ FUNCTION Back2BackName$ (a$) - IF a$ = "Keyword Reference - Alphabetical" THEN Back2BackName$ = "Alphabetical": EXIT FUNCTION - IF a$ = "Keyword Reference - By usage" THEN Back2BackName$ = "By Usage": EXIT FUNCTION + IF a$ = "Keyword Reference (Alphabetical)" THEN Back2BackName$ = "Alphabetical": EXIT FUNCTION + IF a$ = "Keyword Reference (Usage)" THEN Back2BackName$ = "By Usage": EXIT FUNCTION IF a$ = "QB64 Help Menu" THEN Back2BackName$ = "Help": EXIT FUNCTION IF a$ = "QB64 FAQ" THEN Back2BackName$ = "FAQ": EXIT FUNCTION Back2BackName$ = a$ @@ -10,8 +10,24 @@ FUNCTION Wiki$ (PageName$) Help_PageLoaded$ = PageName$ PageName2$ = PageName$ + ' FOR x = 2 TO LEN(PageName2$) + ' ' Change all underscores to dashes, except for the first character. + ' IF ASC(PageName2$, x) = 95 THEN + ' ASC(PageName2$, x) = 45 + ' END IF + ' NEXT + ' DO WHILE INSTR(2, PageName2$, "_") + ' ' Change all underscores to dashes, except for the first character. + ' ASC(PageName2$, INSTR(2, PageName2$, "_")) = 45 + ' LOOP + + PageName2$ = StrReplace$(PageName2$, "_", "-") + IF MID$(PageName2$, 1, 1) = "-" THEN + ASC(PageName2$, 1) = 95 + END IF + DO WHILE INSTR(PageName2$, " ") - ASC(PageName2$, INSTR(PageName2$, " ")) = 95 + ASC(PageName2$, INSTR(PageName2$, " ")) = 45 '95 LOOP DO WHILE INSTR(PageName2$, "&") i = INSTR(PageName2$, "&") @@ -57,7 +73,7 @@ FUNCTION Wiki$ (PageName$) END IF IF Help_Recaching = 0 THEN - a$ = "Downloading '" + PageName$ + "' page..." + a$ = "Downloading '" + PageName2$ + "' page..." ' Was PageName$ IF LEN(a$) > 60 THEN a$ = LEFT$(a$, 57) + STRING$(3, 250) IF LEN(a$) < 60 THEN a$ = a$ + SPACE$(60 - LEN(a$)) @@ -67,6 +83,7 @@ FUNCTION Wiki$ (PageName$) PCOPY 3, 0 END IF + url$ = CHR$(34) + wikiBaseAddress$ + "/" + PageName2$ + ".md" + CHR$(34) outputFile$ = Cache_Folder$ + "/" + PageName2$ + ".txt" @@ -89,7 +106,6 @@ SUB Help_AddTxt (t$, col, link) c = ASC(t$, i) - IF Help_BG_Col = 0 AND Help_LockWrap = 0 THEN 'addtxt handles all wrapping issues @@ -224,7 +240,7 @@ SUB WikiParse (a$) col = Help_Col - 'Syntax Notes: + ' (OLD) Syntax Notes: ' '''=bold ' ''=italic ' {{macroname|macroparam}} or simply {{macroname}} @@ -243,12 +259,38 @@ SUB WikiParse (a$) ' :=indent (if beginning a new line) ' CHR$(10)=new line character + ' (NEW) Syntax Notes: + ' **=bold + ' *=italic + ' {{macroname|macroparam}} or simply {{macroname}} + ' eg. {{KW|PRINT}}=a key word, a link to a page + ' {{Cl|PRINT}}=a key word in a code example, will be printed in bold and aqua + ' {{Parameter|expression}}=a parameter, in italics + ' {{PageSyntax}} {{PageParameters}} {{PageDescription}} {{PageExamples}} + ' {{CodeStart}} {{CodeEnd}} {{OutputStart}} {{OutputEnd}} + ' {{PageSeeAlso}} {{PageNavigation}} {{PageLegacySupport}} + ' {{PageQBasic}} {{PageAvailability}} + ' [SPACE$](url) = a link to wikipage called "SPACE$" + ' [INTEGER](integer) = a link, link's name is on left and text to appear is on right + ' * = a dot point + ' - = a sub(ie. further indented) dot point + ' " = a quotation mark + ' : = indent (if beginning a new line) + ' CHR$(10) = new line character + prefetch = 16 DIM c$(prefetch) FOR ii = 1 TO prefetch c$(ii) = SPACE$(ii) NEXT + ' c$() is a look ahead (helper) "cache" + ' ------- + ' c$(1) is 1 character - same as c$ and c + ' c$(2) is 2 characters + ' ... + ' c$(16) is 16 characters + i = INSTR(a$, "") + 1) @@ -272,7 +314,7 @@ SUB WikiParse (a$) NEXT NEXT - IF c = 38 THEN '"&" + IF c = 38 THEN ' "&" s$ = """ IF c$(LEN(s$)) = s$ THEN i = i + LEN(s$) - 1 @@ -363,148 +405,278 @@ SUB WikiParse (a$) SpecialChr: END IF 'c=38 '"&" - 'Links - IF c = 91 THEN '"[" - IF c$(2) = "[[" AND link = 0 THEN - i = i + 1 - link = 1 - link$ = "" - GOTO Special - END IF + ' ****************************************** + ' * New parse code... + ' ****************************************** + + IF c = 91 THEN ' [ --- Possible Link + + lb = i: rb = -1: lp = -1: rp = -1 + + p = i + 1: innerParen = 0 + DO WHILE p < n + IF rb = -1 AND ASC(a$, p) = 93 THEN ' ] + rb = p: p = p + 1 END IF - IF link = 1 THEN - IF c$(2) = "]]" OR c$(2) = "}}" THEN - i = i + 1 - link = 0 - text$ = link$ - i2 = INSTR(link$, "|") - IF i2 THEN - text$ = RIGHT$(link$, LEN(link$) - i2) - link$ = LEFT$(link$, i2 - 1) - END IF - - IF INSTR(link$, "#") THEN 'local page links not supported yet - Help_AddTxt text$, 8, 0 - GOTO Special - END IF - - Help_LinkN = Help_LinkN + 1 - Help_Link$ = Help_Link$ + "PAGE:" + link$ + Help_Link_Sep$ - - IF Help_BG_Col = 0 THEN - Help_AddTxt text$, Help_Col_Link, Help_LinkN - ELSE - Help_AddTxt text$, Help_Col_Bold, Help_LinkN - END IF - GOTO Special - END IF - link$ = link$ + c$ - GOTO Special + IF rb <> -1 AND lp = -1 THEN + IF ASC(a$, p) = 40 THEN ' ( + ' We are expecting the ( to be right after the ]. + lp = p: p = p + 1 ' and now look for the closing ). + ELSE + ' If not, abort. + EXIT DO + END IF END IF - - - 'External links - IF c = 91 THEN '"[" - IF c$(6) = "[http:" AND elink = 0 THEN - elink = 2 - elink$ = "" - GOTO Special + IF rb <> -1 AND lp <> -1 AND rp = -1 THEN ' looking for closing ) + IF ASC(a$, p) = 41 THEN ' ) + IF innerParen = 0 THEN + rp = p: EXIT DO + ELSE + innerParen = innerParen - 1 END IF + ELSEIF ASC(a$, p) = 40 THEN ' ( + innerParen = innerParen + 1 + END IF END IF - IF elink = 2 THEN - IF c$ = " " THEN - elink = 1 - GOTO Special - END IF - elink$ = elink$ + c$ - GOTO Special - END IF - IF elink >= 1 THEN - IF c$ = "]" THEN - elink = 0 - elink$ = " " + elink$ - Help_LockWrap = 1: Help_Wrap_Pos = 0 - Help_AddTxt elink$, 8, 0 - Help_LockWrap = 0 - elink$ = "" - GOTO Special - END IF + p = p + 1 + LOOP + + IF lb > -1 AND rb > lb AND lp > rb AND rp > lp THEN + IF rb + 1 = lp THEN + + text$ = MID$(a$, lb + 1, (rb - lb) - 1) + link$ = MID$(a$, lp + 1, (rp - lp) - 1) + + Help_LinkN = Help_LinkN + 1 + Help_Link$ = Help_Link$ + "PAGE:" + link$ + Help_Link_Sep$ + + IF Help_BG_Col = 0 THEN + Help_AddTxt text$, Help_Col_Link, Help_LinkN + ELSE + Help_AddTxt text$, Help_Col_Bold, Help_LinkN + END IF + i = rp '+ 1 + GOTO Special + END IF + END IF - IF c = 123 THEN '"{" - IF c$(5) = "{{KW|" THEN 'this is really a link! - i = i + 4 - link = 1 - link$ = "" - GOTO Special - END IF - IF c$(5) = "{{Cl|" THEN 'this is really a link too (in code example) - i = i + 4 - link = 1 - link$ = "" - GOTO Special - END IF - IF c$(2) = "{{" THEN - i = i + 1 - cb = 1 - cb$ = "" - GOTO Special - END IF - END IF + END IF - IF cb = 1 THEN - IF c$ = "|" OR c$(2) = "}}" THEN - IF c$(2) = "}}" THEN i = i + 1 - cb = 0 + IF nl = 1 THEN ' If a new line... + IF c$(3) = "## " THEN ' Section + section$ = "" + FOR ii = i + 3 TO LEN(a$) + IF ASC(a$, ii) = 10 THEN EXIT FOR + section$ = section$ + MID$(a$, ii, 1) + NEXT + Help_AddTxt section$ + ":" + CHR$(13), Help_Col_Section, 0 + i = ii - 1: GOTO Special + END IF + IF c$(5) = "```vb" THEN ' Code + Help_NewLine + Help_BG_Col = 1 + i = i + 4: GOTO Special + END IF + IF c$(7) = "```text" THEN ' Output + Help_NewLine + Help_BG_Col = 2 + i = i + 6: GOTO Special + END IF + IF c$(3) = "```" THEN + Help_BG_Col = 0 + i = i + 2 + GOTO Special + END IF + IF c$(2) = "> " THEN ' "Quote" + Help_AddTxt " ", col, 0 + Help_NewLineIndent = Help_NewLineIndent + 4 + i = i + 2: GOTO special2 + END IF + IF c$(2) = "* " OR c$(2) = "- " THEN ' Bullet + i = i + 1 + Help_AddTxt CHR$(254) + " ", col, 0 + Help_NewLineIndent = Help_NewLineIndent + 2 + GOTO Special + END IF + IF c$(4) = " * " OR c$(4) = " - " THEN ' Sub Bullet + i = i + 3 + Help_AddTxt " " + CHR$(254) + " ", col, 0 + Help_NewLineIndent = Help_NewLineIndent + 6 + GOTO Special + END IF + IF c$(6) = " * " OR c$(6) = " - " THEN ' Sub Bullet + i = i + 5 + Help_AddTxt " " + CHR$(254) + " ", col, 0 + Help_NewLineIndent = Help_NewLineIndent + 6 + GOTO Special + END IF + IF c$(3) = "---" THEN ' Horizontal Line + i = i + 2 + Help_AddTxt STRING$(100, 196), 8, 0 + GOTO Special + END IF + END IF - IF cb$ = "PageSyntax" THEN Help_AddTxt "Syntax:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageParameters" THEN Help_AddTxt "Parameters:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageDescription" THEN Help_AddTxt "Description:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageAvailability" THEN Help_AddTxt "Availability:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageExamples" THEN Help_AddTxt "Code Examples:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageSeeAlso" THEN Help_AddTxt "See also:" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageLegacySupport" THEN Help_AddTxt "Legacy support" + CHR$(13), Help_Col_Section, 0 - IF cb$ = "PageQBasic" THEN Help_AddTxt "QBasic/QuickBASIC" + CHR$(13), Help_Col_Section, 0 + IF c$(2) = "**" THEN ' Bold + ' Bold is only active is asterisks are immediately followed by a character. + IF Help_Bold = 0 AND c$(3) = "** " THEN GOTO Special + i = i + 1 + IF Help_Bold = 0 THEN Help_Bold = 1 ELSE Help_Bold = 0 + col = Help_Col + GOTO Special + END IF - IF cb$ = "CodeStart" THEN - Help_NewLine - Help_BG_Col = 1 - 'Skip non-meaningful content before section begins - ws = 1 - FOR ii = i + 1 TO LEN(a$) - IF ASC(a$, ii) = 10 THEN EXIT FOR - IF ASC(a$, ii) <> 32 AND ASC(a$, ii) <> 39 THEN ws = 0 - NEXT - IF ws THEN i = ii - END IF - IF cb$ = "CodeEnd" THEN Help_BG_Col = 0 - IF cb$ = "OutputStart" THEN - Help_NewLine - Help_BG_Col = 2 - 'Skip non-meaningful content before section begins - ws = 1 - FOR ii = i + 1 TO LEN(a$) - IF ASC(a$, ii) = 10 THEN EXIT FOR - IF ASC(a$, ii) <> 32 AND ASC(a$, ii) <> 39 THEN ws = 0 - NEXT - IF ws THEN i = ii - END IF - IF cb$ = "OutputEnd" THEN Help_BG_Col = 0 + IF c$ = "*" THEN ' Italic + ' Italic is only active is asterisk is immediately followed by a character. + IF Help_Italic = 0 AND c$(2) = "* " THEN GOTO Special + IF Help_Italic = 0 THEN Help_Italic = 1 ELSE Help_Italic = 0 + col = Help_Col + GOTO Special + END IF - GOTO Special + ' ****************************************** - END IF + ' 'Links + ' IF c = 91 THEN '"[" + ' IF c$(2) = "[[" AND link = 0 THEN + ' i = i + 1 + ' link = 1 + ' link$ = "" + ' GOTO Special + ' END IF + ' END IF + ' IF link = 1 THEN + ' IF c$(2) = "]]" OR c$(2) = "}}" THEN + ' i = i + 1 + ' link = 0 + ' text$ = link$ + ' i2 = INSTR(link$, "|") + ' IF i2 THEN + ' text$ = RIGHT$(link$, LEN(link$) - i2) + ' link$ = LEFT$(link$, i2 - 1) + ' END IF - cb$ = cb$ + c$ 'reading maro name - GOTO Special - END IF 'cb=1 + ' IF INSTR(link$, "#") THEN 'local page links not supported yet + ' Help_AddTxt text$, 8, 0 + ' GOTO Special + ' END IF - IF c$(2) = "}}" THEN 'probably the end of a text section of macro'd text - i = i + 1 - GOTO Special - END IF + ' Help_LinkN = Help_LinkN + 1 + ' Help_Link$ = Help_Link$ + "PAGE:" + link$ + Help_Link_Sep$ + + ' IF Help_BG_Col = 0 THEN + ' Help_AddTxt text$, Help_Col_Link, Help_LinkN + ' ELSE + ' Help_AddTxt text$, Help_Col_Bold, Help_LinkN + ' END IF + ' GOTO Special + ' END IF + ' link$ = link$ + c$ + ' GOTO Special + ' END IF + ' 'External links + ' IF c = 91 THEN '"[" + ' IF c$(6) = "[http:" AND elink = 0 THEN + ' elink = 2 + ' elink$ = "" + ' GOTO Special + ' END IF + ' END IF + ' IF elink = 2 THEN + ' IF c$ = " " THEN + ' elink = 1 + ' GOTO Special + ' END IF + ' elink$ = elink$ + c$ + ' GOTO Special + ' END IF + ' IF elink >= 1 THEN + ' IF c$ = "]" THEN + ' elink = 0 + ' elink$ = " " + elink$ + ' Help_LockWrap = 1: Help_Wrap_Pos = 0 + ' Help_AddTxt elink$, 8, 0 + ' Help_LockWrap = 0 + ' elink$ = "" + ' GOTO Special + ' END IF + ' END IF + + ' IF c = 123 THEN '"{" + ' IF c$(5) = "{{KW|" THEN 'this is really a link! + ' i = i + 4 + ' link = 1 + ' link$ = "" + ' GOTO Special + ' END IF + ' IF c$(5) = "{{Cl|" THEN 'this is really a link too (in code example) + ' i = i + 4 + ' link = 1 + ' link$ = "" + ' GOTO Special + ' END IF + ' IF c$(2) = "{{" THEN + ' i = i + 1 + ' cb = 1 + ' cb$ = "" + ' GOTO Special + ' END IF + ' END IF + + ' IF cb = 1 THEN + ' IF c$ = "|" OR c$(2) = "}}" THEN + ' IF c$(2) = "}}" THEN i = i + 1 + ' cb = 0 + + ' IF cb$ = "PageSyntax" THEN Help_AddTxt "Syntax:" + CHR$(13), Help_Col_Section, 0 + ' IF cb$ = "PageParameters" THEN Help_AddTxt "Parameters:" + CHR$(13), Help_Col_Section, 0 + ' IF cb$ = "PageDescription" THEN Help_AddTxt "Description:" + CHR$(13), Help_Col_Section, 0 + ' IF cb$ = "PageAvailability" THEN Help_AddTxt "Availability:" + CHR$(13), Help_Col_Section, 0 + ' IF cb$ = "PageExamples" THEN Help_AddTxt "Code Examples:" + CHR$(13), Help_Col_Section, 0 + ' IF cb$ = "PageSeeAlso" THEN Help_AddTxt "See also:" + CHR$(13), Help_Col_Section, 0 + ' IF cb$ = "PageLegacySupport" THEN Help_AddTxt "Legacy support" + CHR$(13), Help_Col_Section, 0 + ' IF cb$ = "PageQBasic" THEN Help_AddTxt "QBasic/QuickBASIC" + CHR$(13), Help_Col_Section, 0 + + ' IF cb$ = "CodeStart" THEN + ' Help_NewLine + ' Help_BG_Col = 1 + ' 'Skip non-meaningful content before section begins + ' ws = 1 + ' FOR ii = i + 1 TO LEN(a$) + ' IF ASC(a$, ii) = 10 THEN EXIT FOR + ' IF ASC(a$, ii) <> 32 AND ASC(a$, ii) <> 39 THEN ws = 0 + ' NEXT + ' IF ws THEN i = ii + ' END IF + ' IF cb$ = "CodeEnd" THEN Help_BG_Col = 0 + ' IF cb$ = "OutputStart" THEN + ' Help_NewLine + ' Help_BG_Col = 2 + ' 'Skip non-meaningful content before section begins + ' ws = 1 + ' FOR ii = i + 1 TO LEN(a$) + ' IF ASC(a$, ii) = 10 THEN EXIT FOR + ' IF ASC(a$, ii) <> 32 AND ASC(a$, ii) <> 39 THEN ws = 0 + ' NEXT + ' IF ws THEN i = ii + ' END IF + ' IF cb$ = "OutputEnd" THEN Help_BG_Col = 0 + + ' GOTO Special + + ' END IF + + ' cb$ = cb$ + c$ 'reading maro name + ' GOTO Special + ' END IF 'cb=1 + + ' IF c$(2) = "}}" THEN 'probably the end of a text section of macro'd text + ' i = i + 1 + ' GOTO Special + ' END IF IF c$(4) = " == " THEN i = i + 3 @@ -526,48 +698,47 @@ SUB WikiParse (a$) GOTO Special END IF + ' IF c$(3) = "'''" THEN + ' i = i + 2 + ' IF Help_Bold = 0 THEN Help_Bold = 1 ELSE Help_Bold = 0 + ' col = Help_Col + ' GOTO Special + ' END IF - IF c$(3) = "'''" THEN - i = i + 2 - IF Help_Bold = 0 THEN Help_Bold = 1 ELSE Help_Bold = 0 - col = Help_Col - GOTO Special - END IF + ' IF c$(2) = "''" THEN + ' i = i + 1 + ' IF Help_Italic = 0 THEN Help_Italic = 1 ELSE Help_Italic = 0 + ' col = Help_Col + ' GOTO Special + ' END IF - IF c$(2) = "''" THEN - i = i + 1 - IF Help_Italic = 0 THEN Help_Italic = 1 ELSE Help_Italic = 0 - col = Help_Col - GOTO Special - END IF + ' IF nl = 1 THEN - IF nl = 1 THEN + ' IF c$(3) = "** " THEN + ' i = i + 2 + ' Help_AddTxt " " + CHR$(254) + " ", col, 0 + ' Help_NewLineIndent = Help_NewLineIndent + 6 + ' GOTO Special + ' END IF + ' IF c$(2) = "* " THEN + ' i = i + 1 + ' Help_AddTxt CHR$(254) + " ", col, 0 + ' Help_NewLineIndent = Help_NewLineIndent + 2 + ' GOTO Special + ' END IF + ' IF c$(2) = "**" THEN + ' i = i + 1 + ' Help_AddTxt " " + CHR$(254) + " ", col, 0 + ' Help_NewLineIndent = Help_NewLineIndent + 6 + ' GOTO Special + ' END IF + ' IF c$ = "*" THEN + ' Help_AddTxt CHR$(254) + " ", col, 0 + ' Help_NewLineIndent = Help_NewLineIndent + 2 + ' GOTO Special + ' END IF - IF c$(3) = "** " THEN - i = i + 2 - Help_AddTxt " " + CHR$(254) + " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 6 - GOTO Special - END IF - IF c$(2) = "* " THEN - i = i + 1 - Help_AddTxt CHR$(254) + " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 2 - GOTO Special - END IF - IF c$(2) = "**" THEN - i = i + 1 - Help_AddTxt " " + CHR$(254) + " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 6 - GOTO Special - END IF - IF c$ = "*" THEN - Help_AddTxt CHR$(254) + " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 2 - GOTO Special - END IF - - END IF + ' END IF s$ = "{|" IF c$(LEN(s$)) = s$ THEN @@ -668,11 +839,11 @@ SUB WikiParse (a$) GOTO Special END IF - IF c$ = ":" AND nl = 1 THEN - Help_AddTxt " ", col, 0 - Help_NewLineIndent = Help_NewLineIndent + 4 - i = i + 1: GOTO special2 - END IF + ' IF c$ = ":" AND nl = 1 THEN + ' Help_AddTxt " ", col, 0 + ' Help_NewLineIndent = Help_NewLineIndent + 4 + ' i = i + 1: GOTO special2 + ' END IF s$ = "__NOTOC__" + CHR$(10) IF c$(LEN(s$)) = s$ THEN @@ -685,13 +856,11 @@ SUB WikiParse (a$) GOTO Special END IF - IF c$(4) = "----" THEN - i = i + 3 - Help_AddTxt STRING$(100, 196), 8, 0 - GOTO Special - END IF - - + ' IF c$(4) = "----" THEN + ' i = i + 3 + ' Help_AddTxt STRING$(100, 196), 8, 0 + ' GOTO Special + ' END IF IF c$ = CHR$(10) THEN Help_NewLineIndent = 0 @@ -731,7 +900,7 @@ SUB WikiParse (a$) 'PRINT "Finished parsing!": _DISPLAY - IF Help_PageLoaded$ = "Keyword Reference - Alphabetical" THEN + IF Help_PageLoaded$ = "Keyword Reference (Alphabetical)" THEN fh = FREEFILE OPEN "internal\help\links.bin" FOR OUTPUT AS #fh @@ -841,10 +1010,6 @@ SUB WikiParse (a$) END IF - - - - END SUB FUNCTION wikiGetLine$ (a$, i)