Page 1 of 1
Please create an online version of help and integrate it in the IDE
Posted: Sun Feb 23, 2025 3:36 pm
by NicTheQuick
When I program with PureBasic, then of course I also use the help function very often. However, it is really bad if you are looking for very specific things. For example, I recently searched for the syntax rules for escaped strings and found absolutely nothing.
But there are a lot of little things that bother me about the integrated help. And maybe it's just a problem under Linux, but it's often unusable.
Here are a few points:
- There are always coding errors such as: “Schlüsselwörter für Fortgeschrittene”
- The search does not work with the enter key, you have to explicitly click on “Search”
- If you place the cursor on a keyword in the IDE and press F1, you will see the correct help page in most cases, but the “Contents” tree on the left is still often in the wrong place, e.g. when you press F1 on the "Debug" command.
- The forward and back buttons of my mouse also do not work in the help, while in the browser they work as expected.
I would like to be able to change the IDE help optionally to the online help so that the browser opens on the correct page when I press F1. The online help could integrate a better search and be better linked to itself and integrate even more examples or even a comment section. It would just need a menu on the left-hand side. Also with online help you can even open multiple tabs on different topics instead of switching between them with the integrated help.
What do you think? Did I miss something? Do you see the same problems? Are you happy with the help?
Re: Please create an online version of help and integrate it in the IDE
Posted: Sun Feb 23, 2025 5:41 pm
by AZJIO
https://www.purebasic.fr/english/viewtopic.php?t=85486
It is necessary to replace the tag <body> with
Code: Select all
<body>
<a target="_blank" href="https://www.purebasic.com/documentation/folder/name.html"><img title="Online" src="../link.png" border="0" align="left"></a>
But as a name you need to use the name of the file, so this is not just a replacement, but the code that embeds the name of the current file into the link.
Re: Please create an online version of help and integrate it in the IDE
Posted: Sun Feb 23, 2025 5:42 pm
by Quin
I'm on Windows and am much more happy with the IDE's help function than you, but it's still not perfect and I don't disagree that the web help should be updated. Also, it sounds quite broken on Linux...
An option to switch to the web help could also be useful, I think I'll forever stick to the CHM but being able to find topics such as escaping strings with ~ easier in the CHM would be great.
Re: Please create an online version of help and integrate it in the IDE
Posted: Sun Feb 23, 2025 6:03 pm
by AZJIO
You can unpack the CHM file and use the pages in the browser. The only thing you will need to translate all file names to the lower register, as well as write a code that in all pages will change the names of files to the lower register. Then it will be the perfect option and it will not load the server.
You can write a little code that will open the function in the browser directly from the IDE. To do this, we need to make a list of "function|paths" and you will always reliably open the information on the right page and the links on it will be working.
Re: Please create an online version of help and integrate it in the IDE
Posted: Mon Feb 24, 2025 7:52 pm
by AZJIO
Since I made the
online help in Russian (in 2023), here is the code I used to lowercase the paths in the links.
Code: Select all
; AZJIO
; Looking for links to local files (non-Internet) inside the HTML files and translates them to the lower register
; To avoid confusion in the registers in the names of folders and files on the server and not get an error 404.
; Since HTML files in UTF-8 format without BOM, all reading/recording settings in this format.
; Before processing, a message about the number of files and the first file are issued to show the correct path.
EnableExplicit
Procedure.s ReadFileTo(FilePath$)
Protected length, oFile, bytes, *mem, Text$
oFile = ReadFile(#PB_Any, FilePath$)
If oFile
length = Lof(oFile)
*mem = AllocateMemory(length)
If *mem
bytes = ReadData(oFile, *mem, length)
If bytes
Text$ = PeekS(*mem, -1, #PB_UTF8)
EndIf
FreeMemory(*mem)
EndIf
CloseFile(oFile)
EndIf
ProcedureReturn Text$
EndProcedure
Procedure SaveFileTo(File.s, Text$)
Protected Size
Protected Result = #False
Protected *Buff = UTF8(Text$)
Size = StringByteLength(Text$, #PB_UTF8)
Protected ID = CreateFile(#PB_Any, File, #PB_UTF8)
If ID
If WriteData(ID, *Buff, Size) = Size
Result = #True
EndIf
CloseFile(ID)
EndIf
FreeMemory(*Buff)
ProcedureReturn Result
EndProcedure
Procedure FileSearch(List Files.s(), dir.s, mask.s = "")
Protected name.s, id
If Right(dir, 1) <> #PS$
dir + #PS$
EndIf
id = ExamineDirectory(#PB_Any, dir, "")
If id
While NextDirectoryEntry(id)
name = DirectoryEntryName(id)
If name = "." Or name = ".."
Continue
EndIf
If DirectoryEntryType(id) = #PB_DirectoryEntry_Directory
FileSearch(Files(), dir + name + "\", mask)
ElseIf (Not Asc(mask) Or GetExtensionPart(name) = mask) And AddElement(Files())
Files() = dir + DirectoryEntryName(id)
EndIf
Wend
FinishDirectory(id)
EndIf
EndProcedure
Define Text$, rex, String$, i, j
Define NewList Files.s()
Define Path$ = "C:\PureBasic_Help_Online"
FileSearch(Files(), Path$, "html")
MessageRequester(Str(ListSize(Files())), Files())
rex = CreateRegularExpression(#PB_Any, ~"href=\"\\K[^:<>?*|\"]+?(?=\">)")
If Not rex
MessageRequester("", RegularExpressionError())
End
EndIf
ForEach Files()
i+1
If i = 200
j + 200
Debug j
i = 0
EndIf
Text$ = ReadFileTo(Files())
If ExamineRegularExpression(rex, Text$)
While NextRegularExpressionMatch(rex)
String$ = RegularExpressionMatchString(rex)
ReplaceString(Text$ , String$ , LCase(String$), #PB_String_InPlace, RegularExpressionMatchPosition(rex), 1)
; Length = RegularExpressionMatchLength(rex)
Wend
EndIf
SaveFileTo(Files(), Text$)
Next
MessageRequester("", "Done")
By the way, I added a tutorial there
RegExp (syntax) (
En)
if
array
String parsing (new, made almost yesterday.)