An HTML index of Gambas Classes
An HTML index of Gambas Classes
As part of my FarmDB project, I gathered a lot of the information that is in the Wiki. Well, long story made short, attached you will find a zip file of an html file that is an index of all the class names in Gambas starting with an ordinary letter. The link should take you to the correct page in the wiki.
I hope you all find it useful.
Ced
.... and carry a big stick!
Re: An HTML index of Gambas Classes
Ced
.... and carry a big stick!
Re: An HTML index of Gambas Classes
First fruits of a long process? Yes.
Here is the process information flow diagram (programs in parentheses):
Code: Select all
/usr/share/Gambas3/info/gb.*
|
V
(Scanner)
|
V
LoadFiles.tsv (Text Editing)
| |
V V
(Loader) <-- LoadDB_Vault.SQL (Text Edit Field Info) Database Diagram
| | |
V V V
SQLiteDatabase <-- (DB Creator) <-- CreateDB_Vault.SQL <-- (Diagram Parser)
|
V
(Reporter) <-- Query_Vault.SQL <-- (SQLite + Text Editing)
| +- Report_Vault.HTM <-- (Text Editing)
V
HTML Files
Code: Select all
pd_vendors pd_roots wk_class_flags
0 1 0
| | |
M M |
pd_tags pd_projects wk_components |
1 1 1 1 0 1 1 1 1 |
| +-------+ | | | | +--------+ | | | +---+
M M M | | M M M M M M |
pd_subtags pd_project_tags | | pd_files pd_project_components wk_classes |
1 | | 1 1 1 1 1 0 |
| +-----------+ | | | +-----------+ +----+ | +---+
M M | | M M M |
pd_project_subtags +-------+ | cs_routines cs_class_usage |
| | 1 1 |
| +----+ | | |
M | M | |
cs_shared_libs | cs_lines | wk_member_types |
1 1 | 1 1 1 1 | 1 |
| | | | | | | | | |
| M M | | | M M M M
| cs_lib_usage | | | cs_calls wk_members
| | | | 1
| | | +-----+ +--------+
M | | M M
cs_lib_function | | cs_member_usage wk_keywords
1 | | 1
| | +-------+ +---------+
M M M M
cs_function_usage cs_keyword_usage
wk - Wiki Information
pd - Project Definition
cs - Code Scanner
Currently I have the wk region loaeded, working on the pd, not started on the cs.
When I am done, and the projects/code being scanned are all the projects in the Software Farm, the database will be able to report all sorts of useful information. This class listing is just the first. It is a simple query on the wk_classes and wk_components tables.
Code: Select all
SELECT wk_classes.name AS ClassName,
wk_components.name AS ComponentName,
wk_classes.inherits_name AS InheritsName
FROM wk_classes
INNER JOIN wk_components
ON wk_classes.wk_components_fk = wk_components.id
ORDER BY ClassName, ComponentName
'---- Gather the Values
For r = 0 To theClassNames.Max
If Left(theClassNames[r]) = theLetter Then
theEntry_Row.Add(r)
Endif
Next
For r = 0 To theClassNames.Max
If Left(theClassNames[r]) = "." Then
If Mid(theClassNames[r], 2, 1) = theLetter Then
theEntry_Row.Add(r)
Endif
Endif
Next
For r = 0 To theClassNames.Max
If Left(theClassNames[r]) = "_" Then
If Mid(theClassNames[r], 2, 1) = theLetter Then
theEntry_Row.Add(r)
Endif
Endif
Next
'---- Find the One third Mark
Dim theThird As Integer
theThird = Int((theEntry_Row.Count + 2) / 3)
The broader purpose of this whole exercise is to build a web application and a desktop application which will find code examples from the Software Farm indexed by the components/classes.Imagine that if you clicked on one of those links, not only would you get a list of members (properties,methods,events) of the class, but also a list of all the Software Farm projects which use that class. Click on a project name and it takes you to a page showing you code excerpts around the class usage.
I have attached the last program in the process for those who are interested in seeing how it works. The included database is just the wk tables to keep it as small as possible.
So, this is really a matter of perserverence over patience. The Vault files are like a Settings file that can be mulitple line with replaceable parameters. The code is a work in progress and I will be formally announcing it soon, but you can see how the first draft works in the attached files. Since they are text files, you can bring them into the IDE and use them as if they are alternative format source files.
Ced
P.S. Cogier, et al, I would be delighted if you downloaded this demo, modified the HTML to fit your site style, and posted a copy.
P.P.S. When you unzip the demo, there is a file called CreateUniqueWiki_Vault.SQL included. You should open up the FarmDB.sqlite database, paste the contents of the SQL file in the query execute panet and run it. This will create a set of new derived tables of unique identifiers for the wk tables.
.... and carry a big stick!
- cogier
- Site Admin
- Posts: 1126
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: An HTML index of Gambas Classes
I have added the page to Gambas.one. You can access it from the front page (Gambas Classes) or here https://www.gambas.one/classes/
Can you please advise me how to get the latest copy of the database, better still alter your program to go get it and do the necessary so I can just update the page when a new version of Gambas is out.
Nice work Cedron!
Can you please advise me how to get the latest copy of the database, better still alter your program to go get it and do the necessary so I can just update the page when a new version of Gambas is out.
Nice work Cedron!
Re: An HTML index of Gambas Classes
Thanks Cogier.
I'll be posting all the projects in the system diagram once they are in a presentable state. I'm also thinking of an umbrella project that will do a full refresh with a single button press. Currently the process (Delete the database, create it, load it, and do the report) takes about a minute or so.
I do think that you should dress the page up a bit with your site headers, links and such, so it looks like it belongs. I can modify the report program to match that.
If you want any of the pieces you see ahead of time, send me an email and I will send them to you.
In the meanwhile, if anybody wants to develop a Gambas Application to display the Wiki region of the database and post it here, that would be most welcome.
Ced
P.S. There is a slight error in the database data in that the inherits_id field in the classes table points at the first class that the name matches to, not the class with the same name in the same component. I'll be fixing that shortly, but it has no impact on the report.
I'll be posting all the projects in the system diagram once they are in a presentable state. I'm also thinking of an umbrella project that will do a full refresh with a single button press. Currently the process (Delete the database, create it, load it, and do the report) takes about a minute or so.
I do think that you should dress the page up a bit with your site headers, links and such, so it looks like it belongs. I can modify the report program to match that.
If you want any of the pieces you see ahead of time, send me an email and I will send them to you.
In the meanwhile, if anybody wants to develop a Gambas Application to display the Wiki region of the database and post it here, that would be most welcome.
Ced
P.S. There is a slight error in the database data in that the inherits_id field in the classes table points at the first class that the name matches to, not the class with the same name in the same component. I'll be fixing that shortly, but it has no impact on the report.
.... and carry a big stick!
- cogier
- Site Admin
- Posts: 1126
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: An HTML index of Gambas Classes
I'll make some changes as we go along, I have already altered the Report_Vault.HTM file. I would still like to know where you get the database from.
Re: An HTML index of Gambas Classes
Code: Select all
/usr/share/Gambas3/info/gb.*
|
V
(Scanner)
|
V
LoadFiles.tsv
|
V
(Loader)
|
V
SQLiteDatabase
|
V
(Reporter)
|
V
HTML Files
Ced
.... and carry a big stick!
- cogier
- Site Admin
- Posts: 1126
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: An HTML index of Gambas Classes
I have used your code Cedron but altered it to suit me (sorry). I like .csv files rather than .tsv.
Have a look at the attached program and let me know what you think. I'll put it on the Farm once I have some feed back.
- Attachments
-
- Gambas_Classes.7z
- (27.62 KiB) Downloaded 366 times
Re: An HTML index of Gambas Classes
{Replacement: lower case fix, new vault version]
That's pretty neat. I have no objections to you changing things to suit your tastes.
What I was actually looking for is good template code for typical database usage and you bypassed the database entirely. I'm chuckling.
I will look at your code closer.
In the meanwhile, here is the whole Wiki Scan/Load/Report in one console program.
This one renames the previous version of the database and creates a new one. Ultimately, it will be a refresh process.
To use:
1) Unzip the attached file
2) Open and run the BatchWiki project
The load files will be in the (TsvFiles) directory. (TSV are better suited for this task.)
https://forum.gambas.one/viewtopic.php?f=4&t=673
The Classes list will be in the (HtmlFiles) directory.
The FarmDB,sqlist will hold the Wiki region.
The HTML updates have been applied to the enclosed Report_Vault.HTM file.
Ced
That's pretty neat. I have no objections to you changing things to suit your tastes.
What I was actually looking for is good template code for typical database usage and you bypassed the database entirely. I'm chuckling.
I will look at your code closer.
In the meanwhile, here is the whole Wiki Scan/Load/Report in one console program.
This one renames the previous version of the database and creates a new one. Ultimately, it will be a refresh process.
To use:
1) Unzip the attached file
2) Open and run the BatchWiki project
The load files will be in the (TsvFiles) directory. (TSV are better suited for this task.)
https://forum.gambas.one/viewtopic.php?f=4&t=673
The Classes list will be in the (HtmlFiles) directory.
The FarmDB,sqlist will hold the Wiki region.
The HTML updates have been applied to the enclosed Report_Vault.HTM file.
Ced
.... and carry a big stick!