Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki stuff #506

Merged
merged 4 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 47 additions & 19 deletions source/ide/ide_methods.bas
Original file line number Diff line number Diff line change
Expand Up @@ -479,20 +479,24 @@ FUNCTION ide2 (ignore)
m = m + 1: i = 0
menu$(m, i) = "Help": i = i + 1
menu$(m, i) = "#View Shift+F1": i = i + 1
menuDesc$(m, i - 1) = "Displays help window"
menuDesc$(m, i - 1) = "Opens the help window with last viewed article"
menu$(m, i) = "#Contents Page": i = i + 1
menuDesc$(m, i - 1) = "Displays help contents page"
menu$(m, i) = "Keyword #Index": i = i + 1
menuDesc$(m, i - 1) = "Displays keyword index page"
menuDesc$(m, i - 1) = "Displays the help contents page"
menu$(m, i) = "Keywords #Index": i = i + 1
menuDesc$(m, i - 1) = "Displays the keywords index page (sorted alphabetically)"
menu$(m, i) = "#Keywords by Usage": i = i + 1
menuDesc$(m, i - 1) = "Displays keywords index by usage"
menuDesc$(m, i - 1) = "Displays the keywords index page (sorted by usage)"
menu$(m, i) = "#Metacommands": i = i + 1
menuDesc$(m, i - 1) = "Displays the metacommands overview page"
menu$(m, i) = "Variable #Types": i = i + 1
menuDesc$(m, i - 1) = "Displays the variable types overview page"
menu$(m, i) = "-": i = i + 1
menu$(m, i) = "#Update Current Page": i = i + 1
menuDesc$(m, i - 1) = "Downloads the latest version of an article from the wiki"
menuDesc$(m, i - 1) = "Downloads the latest version of the current article from the Wiki"
menu$(m, i) = "Update All #Pages...": i = i + 1
menuDesc$(m, i - 1) = "Downloads the latest version of all articles from the wiki"
menuDesc$(m, i - 1) = "Downloads the latest version of all articles from the Wiki"
menu$(m, i) = "View Current Page On #Wiki": i = i + 1
menuDesc$(m, i - 1) = "Launches the default browser and navigates to the current article on the wiki"
menuDesc$(m, i - 1) = "Opens the current article on the Wiki using your standard browser"
menu$(m, i) = "-": i = i + 1
'menu$(m, i) = "Check for #Newer Version...": i = i + 1
'menuDesc$(m, i - 1) = "Displays the current version of QB64-PE"
Expand Down Expand Up @@ -2422,8 +2426,9 @@ FUNCTION ide2 (ignore)
Help_Select = 2
Help_SelX1 = 1
Help_SelY1 = 1
Help_SelX2 = 10000000
Help_SelX2 = help_w
Help_SelY2 = help_h
Help_cx1 = 1: Help_cy1 = 1
Help_cx = 1: Help_cy = help_h + 1
GOTO keep_select
END IF
Expand Down Expand Up @@ -2559,7 +2564,8 @@ FUNCTION ide2 (ignore)
oldlnk = lnk
LOOP

IF Back_Name$(Help_Back_Pos) = "Alphabetical" OR Back_Name$(Help_Back_Pos) = "By Usage" THEN
'!!! RS:HCWD:#1 !!! (abbrev. page titles)
IF Back_Name$(Help_Back_Pos) = "KWs Alphab." OR Back_Name$(Help_Back_Pos) = "KWs by Usage" THEN
IF lnkx1 > 3 THEN
cx = px + 1
GOTO helpscanrow
Expand Down Expand Up @@ -2776,7 +2782,7 @@ FUNCTION ide2 (ignore)
Help_SelX1 = Help_cx: Help_SelX2 = Help_cx1 - 1
END IF
ELSE
Help_SelX1 = 1: Help_SelX2 = 10000000
Help_SelX1 = 1: Help_SelX2 = help_w
IF Help_cy > Help_cy1 THEN
Help_SelY1 = Help_cy1: Help_SelY2 = Help_cy
IF Help_cx = 1 THEN Help_SelY2 = Help_cy - 1
Expand Down Expand Up @@ -5443,7 +5449,7 @@ FUNCTION ide2 (ignore)
lnk$ = "QB64 Help Menu"
GOTO OpenHelpLink
END IF
IF menu$(m, s) = "Keyword #Index" THEN
IF menu$(m, s) = "Keywords #Index" THEN
PCOPY 3, 0: SCREEN , , 3, 0
lnk$ = "Keyword Reference - Alphabetical"
GOTO OpenHelpLink
Expand All @@ -5453,6 +5459,16 @@ FUNCTION ide2 (ignore)
lnk$ = "Keyword Reference - By usage"
GOTO OpenHelpLink
END IF
IF menu$(m, s) = "#Metacommands" THEN
PCOPY 3, 0: SCREEN , , 3, 0
lnk$ = "Metacommand"
GOTO OpenHelpLink
END IF
IF menu$(m, s) = "Variable #Types" THEN
PCOPY 3, 0: SCREEN , , 3, 0
lnk$ = "Variable Types"
GOTO OpenHelpLink
END IF

IF menu$(m, s) = "#View Shift+F1" THEN

Expand Down Expand Up @@ -18628,18 +18644,22 @@ SUB IdeMakeContextualMenu
menuDesc$(m, i - 1) = "Selects all contents of current article"
menu$(m, i) = "-": i = i + 1
menu$(m, i) = "#Contents Page": i = i + 1
menuDesc$(m, i - 1) = "Displays help contents page"
menu$(m, i) = "Keyword #Index": i = i + 1
menuDesc$(m, i - 1) = "Displays keyword index page"
menuDesc$(m, i - 1) = "Displays the help contents page"
menu$(m, i) = "Keywords #Index": i = i + 1
menuDesc$(m, i - 1) = "Displays the keywords index page (sorted alphabetically)"
menu$(m, i) = "#Keywords by Usage": i = i + 1
menuDesc$(m, i - 1) = "Displays keywords index by usage"
menuDesc$(m, i - 1) = "Displays the keywords index page (sorted by usage)"
menu$(m, i) = "#Metacommands": i = i + 1
menuDesc$(m, i - 1) = "Displays the metacommands overview page"
menu$(m, i) = "Variable #Types": i = i + 1
menuDesc$(m, i - 1) = "Displays the variable types overview page"
menu$(m, i) = "-": i = i + 1
menu$(m, i) = "#Update Current Page": i = i + 1
menuDesc$(m, i - 1) = "Downloads the latest version of this article from the wiki"
menuDesc$(m, i - 1) = "Downloads the latest version of the current article from the Wiki"
menu$(m, i) = "Update All #Pages...": i = i + 1
menuDesc$(m, i - 1) = "Downloads the latest version of all articles from the wiki"
menuDesc$(m, i - 1) = "Downloads the latest version of all articles from the Wiki"
menu$(m, i) = "View Current Page On #Wiki": i = i + 1
menuDesc$(m, i - 1) = "Launches the default browser and navigates to the current article on the wiki"
menuDesc$(m, i - 1) = "Opens the current article on the Wiki using your standard browser"
menu$(m, i) = "-": i = i + 1
menu$(m, i) = "Clo#se Help ESC": i = i + 1
menuDesc$(m, i - 1) = "Closes help window"
Expand Down Expand Up @@ -19008,12 +19028,20 @@ FUNCTION ideupdatehelpbox
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
PageName2$ = "QB64_Help_Menu.txt"
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
PageName2$ = "Data_types.txt"
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
PageName2$ = "Variable_Types.txt"
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
PageName2$ = "ERROR_Codes.txt"
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
PageName2$ = "Quick_Reference_-_Tables.txt"
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
PageName2$ = "Keywords_currently_not_supported_by_QB64.txt"
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
PageName2$ = "Keyword_Reference_-_By_usage.txt"
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
PageName2$ = "Metacommand.txt"
IF INSTR(f$, CHR$(0) + PageName2$ + CHR$(0)) = 0 THEN f$ = CHR$(0) + PageName2$ + f$
et# = TIMER(0.001) - st#: IF et# < 0 THEN et# = et# + 86400
IF 1.25 - et# > 0 THEN _DELAY 1.25 - et#
UpdateStep = UpdateStep + 1
Expand Down
44 changes: 31 additions & 13 deletions source/ide/wiki/wiki_methods.bas
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
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$ = "Keywords currently not supported by QB64" THEN Back2BackName$ = "Unsupported": EXIT FUNCTION
IF a$ = "QB64 Help Menu" THEN Back2BackName$ = "Help": EXIT FUNCTION
IF a$ = "QB64 FAQ" THEN Back2BackName$ = "FAQ": EXIT FUNCTION
Back2BackName$ = a$
SELECT CASE a$
CASE "Base Comparisons": Back2BackName$ = "Base Compare"
CASE "Bitwise Operators": Back2BackName$ = "Bitwise OPs"
CASE "Downloading Files": Back2BackName$ = "Downloads"
CASE "Function (explanatory)": Back2BackName$ = "FUNC expl."
CASE "Greater Than Or Equal": Back2BackName$ = "Greater|Equal"
CASE "Keyboard scancodes": Back2BackName$ = "KB Scancodes"
CASE "Keyword Reference - Alphabetical": Back2BackName$ = "KWs Alphab." 'scan sources for
CASE "Keyword Reference - By usage": Back2BackName$ = "KWs by Usage" ' '!!! RS:HCWD:#1 !!!
CASE "Keywords currently not supported by QB64": Back2BackName$ = "Unsupp. KWs"
CASE "Less Than Or Equal": Back2BackName$ = "Less|Equal"
CASE "Mathematical Operations": Back2BackName$ = "Math OPs"
CASE "QB64 Help Menu": Back2BackName$ = "QB64 Help"
CASE "Quick Reference - Tables": Back2BackName$ = "QRef. Tables"
CASE "Relational Operations": Back2BackName$ = "Relational OPs"
CASE "Scientific notation": Back2BackName$ = "Sci. Notation"
CASE "Sub (explanatory)": Back2BackName$ = "SUB expl."
CASE "Windows Environment": Back2BackName$ = "Win Env."
CASE "Windows Libraries": Back2BackName$ = "Win Lib."
CASE "Windows Printer Settings": Back2BackName$ = "Win Print"
CASE "Windows Registry Access": Back2BackName$ = "Win Reg."
CASE ELSE: Back2BackName$ = a$
END SELECT
END FUNCTION

FUNCTION Wiki$ (PageName$) 'Read cached wiki page (download, if not yet cached)
Expand Down Expand Up @@ -117,7 +134,7 @@ END FUNCTION

SUB Help_AddTxt (t$, col, link) 'Add help text, handle word wrap
IF t$ = "" THEN EXIT SUB
IF Help_ChkBlank <> 0 THEN Help_CheckBlankLine: Help_ChkBlank = 0
IF Help_ChkBlank <> 0 THEN Help_CheckBlankLine

FOR i = 1 TO LEN(t$)
c = ASC(t$, i)
Expand Down Expand Up @@ -210,6 +227,7 @@ SUB Help_CheckBlankLine 'Make sure the last help line is a blank line (implies f
IF ASC(Help_Txt$, Help_Txt_Len - 2) < 128 THEN Help_NewLine
IF ASC(Help_Txt$, Help_Txt_Len - 6) < 128 THEN Help_NewLine
END IF
Help_ChkBlank = 0
END SUB

SUB Help_CheckRemoveBlankLine 'If the last help line is blank, then remove it
Expand Down Expand Up @@ -703,7 +721,7 @@ SUB WikiParse (a$) 'Wiki page interpret
END IF

'Template wrapped plugin
IF (cb$ = "PageNavigation" OR RIGHT$(cb$, 6) = "Plugin") AND Help_LockParse = 0 THEN 'no plugins in blocks
IF (cb$ = "PageNavigation" OR cb$ = "PageReferences" OR RIGHT$(cb$, 6) = "Plugin") AND Help_LockParse = 0 THEN 'no plugins in blocks
pit$ = Wiki$("Template:" + cb$)
IF INSTR(pit$, "{{PageInternalError}}") = 0 THEN
a$ = LEFT$(a$, i) + pit$ + RIGHT$(a$, LEN(a$) - i)
Expand Down Expand Up @@ -785,17 +803,17 @@ SUB WikiParse (a$) 'Wiki page interpret
'Rulers
IF c$(4) = "----" AND nl = 1 THEN
i = i + 3
Help_CheckBlankLine
IF Help_ChkBlank = -1 THEN Help_ChkBlank = 0: ELSE Help_CheckBlankLine
Help_AddTxt STRING$(Help_ww, 196), 14, 0
Help_ChkBlank = 1
Help_ChkBlank = -1
GOTO charDone
END IF
IF c$(4) = "<hr>" OR c$(6) = "<hr />" THEN
IF c$(4) = "<hr>" THEN i = i + 3
IF c$(6) = "<hr />" THEN i = i + 5
Help_CheckBlankLine
IF Help_ChkBlank = -1 THEN Help_ChkBlank = 0: ELSE Help_CheckBlankLine
Help_AddTxt STRING$(Help_ww, 196), 14, 0
Help_ChkBlank = 1
Help_ChkBlank = -1
GOTO charDone
END IF
END IF
Expand All @@ -808,8 +826,8 @@ SUB WikiParse (a$) 'Wiki page interpret
IF c$(2) = "; " THEN i = i + 1
IF ah = 0 AND dl = 0 THEN Help_CheckBlankLine
Help_Bold = 1: col = Help_Col: Help_DList = 1
IF c$(3) = ";* " OR c$(3) = ";# " THEN i = i + 2: Help_DList = 3 'list dot belongs to description
IF c$(2) = ";*" OR c$(2) = ";#" THEN i = i + 1: Help_DList = 2 'list dot belongs to description
IF c$(3) = ";* " OR c$(3) = ";# " THEN i = i + 1: Help_DList = 3 'list dot belongs to description
IF dl < 3 THEN
Help_AddTxt "Þ ", 11, 0: dl = 1
Help_LIndent$ = Help_LIndent$ + "Þ "
Expand Down
Loading