Skip to content

Commit 83f7728

Browse files
committed
makehtml devel
1 parent f923f04 commit 83f7728

4 files changed

Lines changed: 97 additions & 107 deletions

File tree

utilities/makehtml/glodata.pas

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright 2026, Jerome Shidel
2+
// The Clear BSD License
3+
// All rights reserved.
4+
5+
unit GloData;
6+
7+
{$mode objfpc}{$H+}
8+
9+
{$I patches.pp} // Various compiler directives to "fix" things.
10+
{$I version.def} // Version information defines
11+
12+
interface
13+
14+
uses
15+
{$IFDEF USES_CWString} cwstring, {$ENDIF}
16+
{$IFDEF UNIX}
17+
cthreads,
18+
{$ENDIF}
19+
SysUtils,
20+
{ you can add units after this }
21+
Version, PasExt, BinTree;
22+
23+
type
24+
// Types of entries in a LIST file
25+
TListType = (lfUnknown, lfExclude, lfSubPart, lfList, lfLinks, lfFAQ, lfSMM);
26+
27+
// Record for information on open LIST file
28+
TListFile =record
29+
Kind : TListType;
30+
Name : String;
31+
Header : String;
32+
Sections : TBinaryTree;
33+
Entries : TBinaryTree;
34+
end;
35+
36+
// Array type for information LIST files
37+
TListFiles = array of TListFile;
38+
39+
var
40+
// Information about open LIST files;
41+
ListFiles : TListFiles;
42+
// Total count of Critical Errors encountered while processing The List
43+
CriticalErrors : integer;
44+
45+
implementation
46+
47+
48+
initialization
49+
50+
ListFiles:=[];
51+
CriticalErrors:=0;
52+
53+
finalization
54+
55+
end.

utilities/makehtml/makehtml.lpr

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@
1616
{$ENDIF}
1717
Classes, SysUtils, IniFiles, StrUtils,
1818
{ you can add units after this }
19-
Version, PasExt, BinTree,
20-
CfgOpts, SrcData;
19+
Version, // Program version information, generated by version.sh
20+
PasExt, BinTree, // A couple basic MPLA units.
21+
CfgOpts, // Command Line option processing.
22+
GloData, // Global types, variables, data, etc.
23+
ReadList; // Loading and dissecting of The List release files.
2124

25+
// Converts The List to HTML
2226
procedure Conversion;
2327
begin
2428
if not DirectoryExists(Source) then begin
@@ -34,7 +38,7 @@ procedure Conversion;
3438
end;
3539
LogMessage(vbNormal, 'Created HTML output directory: ' + Output)
3640
end;
37-
ProcessFiles(Source);
41+
ReadTheList(Source);
3842
LogMessage(vbNormal, 'Conversion finished.');
3943
end;
4044

utilities/makehtml/makehtml.lps

Lines changed: 28 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
<Unit>
88
<Filename Value="makehtml.lpr"/>
99
<IsPartOfProject Value="True"/>
10-
<CursorPos X="40" Y="15"/>
11-
<UsageCount Value="182"/>
10+
<IsVisibleTab Value="True"/>
11+
<CursorPos X="7" Y="40"/>
12+
<UsageCount Value="183"/>
1213
<Loaded Value="True"/>
1314
</Unit>
1415
<Unit>
1516
<Filename Value="cfgopts.pas"/>
1617
<UnitName Value="CfgOpts"/>
17-
<EditorIndex Value="3"/>
18+
<EditorIndex Value="4"/>
1819
<TopLine Value="46"/>
1920
<CursorPos X="85" Y="69"/>
2021
<UsageCount Value="73"/>
@@ -31,93 +32,45 @@
3132
<Unit>
3233
<Filename Value="srcdata.pas"/>
3334
<UnitName Value="SrcData"/>
34-
<IsVisibleTab Value="True"/>
35-
<EditorIndex Value="1"/>
36-
<TopLine Value="47"/>
37-
<CursorPos X="6" Y="111"/>
38-
<FoldState Value=" T3i90Q131 PRlU0p"/>
35+
<EditorIndex Value="-1"/>
36+
<TopLine Value="7"/>
37+
<CursorPos X="87" Y="181"/>
38+
<FoldState Value=" T3c0Q2 pjLkD0v012 PIiT0D"/>
3939
<UsageCount Value="63"/>
40-
<Loaded Value="True"/>
4140
</Unit>
4241
<Unit>
4342
<Filename Value="bintree.pp"/>
4443
<UnitName Value="BinTree"/>
45-
<EditorIndex Value="2"/>
44+
<EditorIndex Value="3"/>
4645
<TopLine Value="98"/>
4746
<CursorPos X="48" Y="118"/>
4847
<UsageCount Value="52"/>
4948
<Loaded Value="True"/>
5049
</Unit>
50+
<Unit>
51+
<Filename Value="glodata.pas"/>
52+
<UnitName Value="GloData"/>
53+
<EditorIndex Value="2"/>
54+
<TopLine Value="6"/>
55+
<CursorPos X="26" Y="7"/>
56+
<UsageCount Value="10"/>
57+
<Loaded Value="True"/>
58+
</Unit>
59+
<Unit>
60+
<Filename Value="readlist.pas"/>
61+
<UnitName Value="ReadList"/>
62+
<EditorIndex Value="1"/>
63+
<TopLine Value="215"/>
64+
<CursorPos X="15" Y="253"/>
65+
<UsageCount Value="10"/>
66+
<Loaded Value="True"/>
67+
</Unit>
5168
</Units>
52-
<JumpHistory HistoryIndex="16">
53-
<Position>
54-
<Filename Value="srcdata.pas"/>
55-
<Caret Line="21" Column="27" TopLine="4"/>
56-
</Position>
57-
<Position>
58-
<Filename Value="srcdata.pas"/>
59-
<Caret Line="51" Column="34" TopLine="26"/>
60-
</Position>
61-
<Position>
62-
<Filename Value="srcdata.pas"/>
63-
<Caret Line="67" Column="8" TopLine="32"/>
64-
</Position>
69+
<JumpHistory>
6570
<Position>
6671
<Filename Value="cfgopts.pas"/>
6772
<Caret Line="69" Column="85" TopLine="46"/>
6873
</Position>
69-
<Position>
70-
<Filename Value="srcdata.pas"/>
71-
<Caret Line="71" Column="49" TopLine="42"/>
72-
</Position>
73-
<Position>
74-
<Filename Value="srcdata.pas"/>
75-
<Caret Line="67" Column="34" TopLine="30"/>
76-
</Position>
77-
<Position>
78-
<Filename Value="srcdata.pas"/>
79-
<Caret Line="66" Column="52" TopLine="42"/>
80-
</Position>
81-
<Position>
82-
<Filename Value="srcdata.pas"/>
83-
<Caret Line="74" Column="41" TopLine="47"/>
84-
</Position>
85-
<Position>
86-
<Filename Value="srcdata.pas"/>
87-
<Caret Line="108" Column="50" TopLine="67"/>
88-
</Position>
89-
<Position>
90-
<Filename Value="srcdata.pas"/>
91-
<Caret Line="113" Column="3" TopLine="51"/>
92-
</Position>
93-
<Position>
94-
<Filename Value="srcdata.pas"/>
95-
<Caret Line="123" Column="42" TopLine="100"/>
96-
</Position>
97-
<Position>
98-
<Filename Value="srcdata.pas"/>
99-
<Caret Line="129" Column="51" TopLine="95"/>
100-
</Position>
101-
<Position>
102-
<Filename Value="srcdata.pas"/>
103-
<Caret Line="64" Column="5" TopLine="34"/>
104-
</Position>
105-
<Position>
106-
<Filename Value="srcdata.pas"/>
107-
<Caret Line="62" Column="31" TopLine="38"/>
108-
</Position>
109-
<Position>
110-
<Filename Value="srcdata.pas"/>
111-
<Caret Line="149" Column="49" TopLine="115"/>
112-
</Position>
113-
<Position>
114-
<Filename Value="srcdata.pas"/>
115-
<Caret Line="153" Column="36" TopLine="129"/>
116-
</Position>
117-
<Position>
118-
<Filename Value="srcdata.pas"/>
119-
<Caret Line="159" Column="27" TopLine="125"/>
120-
</Position>
12174
</JumpHistory>
12275
<RunParams>
12376
<FormatVersion Value="2"/>
Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// The Clear BSD License
33
// All rights reserved.
44

5-
unit SrcData;
5+
unit ReadList;
66

77
{$mode objfpc}{$H+}
88

@@ -18,26 +18,11 @@ interface
1818
{$ENDIF}
1919
SysUtils,
2020
{ you can add units after this }
21-
Version, PasExt, BinTree;
21+
Version, PasExt, BinTree, GloData;
2222

23-
type
24-
TListType = (lfUnknown, lfExclude, lfSubPart, lfList, lfLinks, lfFAQ, lfSMM);
25-
26-
TListFile =record
27-
Kind : TListType;
28-
Name : String;
29-
Header : String;
30-
Sections : TBinaryTree;
31-
Entries : TBinaryTree;
32-
end;
33-
34-
TListFiles = array of TListFile;
35-
36-
var
37-
ListFiles : TListFiles;
38-
CriticalErrors : integer;
39-
40-
procedure ProcessFiles(Pathname : String);
23+
// Loads The List release files from a directory and prepares for the process
24+
// of converting their data to HTML.
25+
procedure ReadTheList(Pathname : String);
4126

4227
implementation
4328

@@ -46,6 +31,7 @@ implementation
4631
SectionDivider = '--------';
4732

4833
var
34+
// Type of List file that is being loaded and processed.
4935
ListType : TListType;
5036

5137
// Determines if a section header is an Entry or a Comment.
@@ -264,7 +250,7 @@ procedure ProcessClear;
264250
end;
265251

266252
// Process 'The List' Release files in a directory
267-
procedure ProcessFiles(Pathname: String);
253+
procedure ReadTheList(Pathname: String);
268254
var
269255
I : Integer;
270256
L : TArrayOfRawByteString;
@@ -275,12 +261,4 @@ procedure ProcessFiles(Pathname: String);
275261
ProcessFile(IncludeTrailingPathDelimiter(Pathname) + L[I]);
276262
end;
277263

278-
279-
initialization
280-
281-
ListFiles:=[];
282-
CriticalErrors:=0;
283-
284-
finalization
285-
286264
end.

0 commit comments

Comments
 (0)