Skip to content

Commit ba57d0e

Browse files
authored
Merge pull request #229 from KubaO/staging
Contributed sections for tbRegExp, tbProjPacker and TBMANLIB_Dialog, and changes to `draft`, `sync` and the doc-draft workflow
2 parents 1bbccbb + f8e122c commit ba57d0e

89 files changed

Lines changed: 7369 additions & 57 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎WIP.Indexer.md‎

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ which would write the snapshots of another build.
135135
- **Snapshots are committed only for the documented packages, to start with**: 14 files, 3.2 MB
136136
(about 350 KB compressed). The contributed packages and the extra CEF builds are indexed into
137137
the store and left out of the repository. A package joins when its section does; `sync`
138-
copies a snapshot for a documented package it indexed in that run.
138+
copies a snapshot for a documented package it indexed in that run, and gives a documented
139+
package with none the store's `api.json` when that is of its `indexed_from` version
140+
(`adoptSnapshots`): a package is usually synced before its section exists, and a later
141+
sync finds its store current and indexes nothing.
139142
- **They are taken from the build the reference was last indexed against, BETA 997**
140143
(`beta-x-0997`), not from a newer one, so that the pages and the baseline agree and
141144
`analyze` of a newer build shows the real distance.
@@ -220,6 +223,12 @@ the old tool's at BETA 997, and it takes half a second with no cache.
220223
folder of the type returning it is limited to folders that already keep a type, because
221224
without that limit it moved Printer under Printers, Dictionary under JsonConverter and
222225
eight others that the sections keep at their roots.
226+
- **A new section borrows its model pages from its group.** Its pages have no sibling of
227+
their kind to follow, so the plan of the first package drafted into a new section
228+
(tbRegExp) gave every task `model: null`, and the agents would have invented a page
229+
layout. A page of a kind its section lacks now takes a model from the group's largest
230+
section that has one, of the same shape: a folder's `index.md` for a class that gets a
231+
folder, never a one-page class.
223232
- **A permalink is computed only where the rule holds for every existing page** of the
224233
section (`followsFolders`). On staging at BETA 997 that is every section but VBA's, whose
225234
pages live under `/tB/Modules/`. A section that breaks the rule once gets no computed
@@ -237,10 +246,24 @@ the old tool's at BETA 997, and it takes half a second with no cache.
237246
- **The check step compiles before a person reads.** One agent per package runs
238247
`check_examples --only` on the section, at a port of its own (9700 up, clear of the
239248
harness's default 9480), and fixes the pages. A contributed package without a
240-
`contributed-<Package>` template cannot be compiled, and the agent says so.
249+
`contributed-<Package>` template cannot be compiled, and the agent says so. **It also runs
250+
the doubts the other agents return**: the workflow passes their results into its prompt,
251+
and it settles each one a run can on a scratch page (`zz-probe.md`, every line expecting
252+
`' ?`, so the report prints what each line printed) and, for a package that replaces
253+
another object, on that object too (`cscript` for VBScript, `vb6run.mjs` for VB6). The
254+
Draft agents only list doubts: they run concurrently, so none of them compiles. The Lists
255+
agent reads a new package's README through read-only `gh` and lists the README's claims
256+
as doubts as well.
241257
- **The agents are Sonnet**, as the content agents of the contributed packages were; the
242258
drafts are read against the sources before they are committed, which no model choice
243259
replaces.
260+
- **The first run, tbRegExp 1.0.5.0 (28 pages, 5 batches), took 7 agents, 7 minutes and
261+
0.96 M subagent tokens**, and its 30 samples compiled and ran on the first Check. The
262+
review still found what no compile finds: the drafts state only what the code says, so
263+
where the package differs from the object it replaces (VBScript's **RegExp**, run under
264+
`cscript`) nothing said so, and claims read from the code but never run (`$0`, a lone `$`)
265+
needed a probe page. Running the doubts is now the Check agent's (above); the review
266+
still reads the pages against the sources.
244267
- **It is not in the published docs.** `draft` is (Tools-Build), because its plans serve a
245268
person writing pages by hand; the workflow is described here and in `WIP.md`, because
246269
nothing under `docs/Documentation/` may require Claude.
@@ -260,10 +283,6 @@ the old tool's at BETA 997, and it takes half a second with no cache.
260283
`Assert` functions on `Exact.md`) shows as undocumented, and a name shared by several types
261284
shows as documented once any page carries it. Update mode does not audit, but finds a
262285
changed symbol's `doc_page` the same way.
263-
- **Adopting a package whose store is already current writes no snapshot.** By reading `runSync`:
264-
the snapshots are copied for the packages the run indexed, and a package that is up to date
265-
is not among them. Documenting a package that `sync` has already read needs its store folder
266-
removed first, or a build newer than the store's.
267286
- **`indexer/TWINSERV-protocol.md` stays where it is, as reference beside the code.** It
268287
describes a third party's HTTP API, which is neither a reason nor a decision, and folding 239
269288
lines of it into this note would bury both. Its one reader is `lib/twinserv-client.mjs`, which

‎WIP.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sibling. History goes nowhere: git keeps it.
3333

3434
Reference documentation is **complete** for all thirteen packages: VBA, VBRUN, VB, WebView2, Assert, CustomControls, CEF, WinEventLogLib, WinNamedPipesLib, WinServicesLib, tbIDE, WinNativeCommonCtls and AppGlobalClassObject. It is adapted from primary sources: Microsoft VBA-Docs (CC-BY-4.0) for the runtime library, `.twin` source for the twinBASIC-specific packages. The CEF and WebView2 packages also carry a tutorial set.
3535

36-
Eleven **contributed** packages from TWINSERV have sections under `docs/Reference/Contributed/`: FileProps, Fmt, OLEGuids, WinReg, TwinTimerPackage, TBMANLIB_ListBoxHScroll, TBMANLIB_RES and VBA_JSON complete; AutoCompleteLib, BigNumberLib and VBComDlg their main class only. Fmt documents its test code (`HelloWorldClass`, `HelloWorldModule`, `Pootle`) in one paragraph of its landing page, which `exclude_from_docs` names; OLEGuids documents each interface's methods on the interface's page. Each published one has a chapter in the book's Packages part. **BigNumberLib and WinReg are not published**: their packages do not compile on BETA 1005, so their pages are kept but excluded in `_config.yml`'s `exclude:` (owner, 2026-10-11), whose comment says how to bring one back.
36+
Fourteen **contributed** packages from TWINSERV have sections under `docs/Reference/Contributed/`: FileProps, Fmt, OLEGuids, WinReg, TwinTimerPackage, TBMANLIB_Dialog, TBMANLIB_ListBoxHScroll, TBMANLIB_RES, tbProjPacker, tbRegExp and VBA_JSON complete; AutoCompleteLib, BigNumberLib and VBComDlg their main class only. Fmt documents its test code (`HelloWorldClass`, `HelloWorldModule`, `Pootle`) in one paragraph of its landing page, which `exclude_from_docs` names. tbRegExp's `exclude_from_docs` names its private engine module, `StaticRegex`, and tbProjPacker's its helper modules, `modPackUnpack` and `modWin32`: the indexer counts a Public Enum as public even inside a Private Module, because a built-in package's are reached through its library symbol written with an asterisk (`*WinNativeCommonCtls`, as `ImlDrawConstants` says). By its bare name no such enum is reachable, in a built-in or a contributed package (TB5079 on BETA 1005). OLEGuids documents each interface's methods on the interface's page. What TBMANLIB_Dialog's pages say its dialogs do comes from `test/package-probes/TBMANLIB_Dialog/`, which operates them in a built exe on a private desktop; run it again when the package's version changes. tbRegExp is the first section drafted by the doc-draft workflow ([WIP.Indexer.md](WIP.Indexer.md#draft-and-the-doc-draft-workflow)), then reviewed against the sources, the package's README and VBScript's own **RegExp** under `cscript`. Each published one has a chapter in the book's Packages part. **BigNumberLib and WinReg are not published**: their packages do not compile on BETA 1005, so their pages are kept but excluded in `_config.yml`'s `exclude:` (owner, 2026-10-11), whose comment says how to bring one back.
3737

3838
The rest of this file is the maintenance guide for updating existing pages or adding new ones: package surface notes, page conventions, and the integrity check.
3939

‎builder/page-baseline.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"src": "docs",
3-
"pages": 1066,
3+
"pages": 1131,
44
"staticFiles": 794
55
}

‎docs/Documentation/Tools-Build.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ A name that matches no package is reported, the other packages are done, and the
188188

189189
`sync` judges a package by what the store holds, never by the manifest. A package is read again when the store lacks its sources or its `api.json`, or holds an `api.json` in an older format or from another build. A package whose `api.json` another version of the scanner wrote is indexed again from the sources already in the store, with no download. A clone has no store, so its first `sync` reads every package.
190190

191-
**Which packages are documented.** A section of the reference documents a package when its folder under `docs/Reference/Default/`, `Built-In/` or `Contributed/` has an `index.md`, and the landing page's `package_name` lists the package (without that key, the folder's name is the package's). The page's `package_name`, `indexed_from`, `exclude_from_docs` and `exclude_kinds` are described under [Frontmatter and permalinks](Authoring#frontmatter-and-permalinks); the indexer reads them and the build does not put them into any page. `sync` copies a package's `api.json` to `indexer/snapshots/` only if the reference documents the package and that run indexed it.
191+
**Which packages are documented.** A section of the reference documents a package when its folder under `docs/Reference/Default/`, `Built-In/` or `Contributed/` has an `index.md`, and the landing page's `package_name` lists the package (without that key, the folder's name is the package's). The page's `package_name`, `indexed_from`, `exclude_from_docs` and `exclude_kinds` are described under [Frontmatter and permalinks](Authoring#frontmatter-and-permalinks); the indexer reads them and the build does not put them into any page. `sync` copies a package's `api.json` to `indexer/snapshots/` only if the reference documents the package and that run indexed it, or the package has no snapshot yet and the store's `api.json` is of the version its section's `indexed_from` names. The second case is a new section: its package was synced before the section existed, so the next `sync` finds the store up to date and indexes nothing.
192192

193193
**What `analyze` reports.** By default it covers the documented packages and says how many others it left out. `--package` and `--packages` name any package. A package that no section documents has no pages to compare with, so every public symbol of it is listed as one to create, and so it is for every package under `--all`. A symbol is a type, or a name that a type declares: the Get, Let and Set of a property, and the overloads of a name, are one symbol, as the reference has one page for each. Only Public and Protected members of public types count, less what `exclude_from_docs` and `exclude_kinds` name. Each package is analyzed in one of two modes.
194194

‎docs/Reference/Contributed.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ Each package is versioned apart from twinBASIC, and its section says which versi
1616
- [**FileProps**](FileProps/) -- the Windows shell properties of a file, read and written
1717
- [**Fmt**](Fmt/) -- **StringFormat**, a string built from a format string and values, in the style of C#'s **String.Format**
1818
- [**OLEGuids**](OLEGuids/) -- OLE and COM interfaces and structures in twinBASIC source, in place of `OLEGuids.tlb`
19+
- [**TBMANLIB_Dialog**](TBMANLIB_Dialog/) -- the **cDialog** class: the Open, Save and folder dialogs, with file filters and path helpers
1920
- [**TBMANLIB_ListBoxHScroll**](TBMANLIB_ListBoxHScroll/) -- a horizontal scroll bar for a **ListBox**
2021
- [**TBMANLIB_RES**](TBMANLIB_RES/) -- resources embedded in an executable, as bytes, strings, hex, Base64 or pictures
22+
- [**tbProjPacker**](tbProjPacker/) -- a `.twinproj` or `.twinpack` file unpacked into a folder of source files, and packed again
23+
- [**tbRegExp**](tbRegExp/) -- regular expressions, in place of VBScript's **RegExp** object
2124
- [**TwinTimerPackage**](TwinTimerPackage/) -- a Win32 timer class that reports the elapsed time
2225
- [**VBA_JSON**](VBA_JSON/) -- JSON parsing and serialization, with UTC and ISO 8601 date conversion
2326
- [**VBComDlg**](VBComDlg/) -- the **CommonDialog** class, for the Windows common dialogs
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: AddFilter
3+
parent: cDialog
4+
permalink: /tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/AddFilter
5+
has_toc: false
6+
---
7+
8+
# AddFilter
9+
{: .no_toc }
10+
11+
Appends a description and a pattern to the [**Filter**](Filter) of the Open and Save As dialogs.
12+
13+
Syntax: *object*.**AddFilter** ( *strDescription*, *strExtension* )
14+
15+
*object*
16+
: *required* An object expression that evaluates to a **cDialog**.
17+
18+
*strDescription*
19+
: *required* A **String**, the text that the dialog shows for the pair, such as `Text Files (*.txt)`.
20+
21+
*strExtension*
22+
: *required* A **String**, the pattern that selects the files, such as `*.txt`. Several patterns are separated by semicolons: `*.jpg;*.jpeg`.
23+
24+
## Remarks
25+
26+
**AddFilter** appends `description|pattern` to the text of **Filter**, with a `|` in front of it when **Filter** is not empty. The first pair added is the one that the dialog selects when it opens.
27+
28+
A filter with one pair gives a file-type list with one item. Despite its name, *strExtension* is a pattern, and the class uses the text as it is: it adds no `*.` in front. Write the pattern in the form that the Windows documentation of `OPENFILENAME` gives, such as `*.txt`.
29+
30+
The class does not check the arguments. A `|` in either one adds an element, so the later elements are no longer paired correctly.
31+
32+
## Example
33+
34+
```tb check_build check_run
35+
Dim dlg As New cDialog
36+
dlg.AddFilter "Text Files (*.txt)", "*.txt"
37+
dlg.AddFilter "Pictures", "*.png;*.jpg"
38+
Debug.Print dlg.Filter ' Text Files (*.txt)|*.txt|Pictures|*.png;*.jpg
39+
```
40+
41+
A `|` in a description makes three elements out of two:
42+
43+
```tb check_build check_run
44+
Dim dlg As New cDialog
45+
dlg.AddFilter "Text|Notes", "*.txt"
46+
Debug.Print UBound(Split(dlg.Filter, "|")) + 1 ' 3
47+
```
48+
49+
## See Also
50+
51+
- [Filter](Filter) property -- the whole list as one string
52+
- [ClearFilter](ClearFilter) method -- empties the filter
53+
- [SetCommonFilters](SetCommonFilters) method -- replaces the filter with a ready-made list
54+
- [ShowOpen](ShowOpen) method -- shows the Open dialog
55+
- [cDialog](.) class -- overview
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: ClearFilter
3+
parent: cDialog
4+
permalink: /tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/ClearFilter
5+
has_toc: false
6+
---
7+
8+
# ClearFilter
9+
{: .no_toc }
10+
11+
Empties the [**Filter**](Filter) of the Open and Save As dialogs.
12+
13+
Syntax: *object*.**ClearFilter**
14+
15+
*object*
16+
: *required* An object expression that evaluates to a **cDialog**.
17+
18+
## Remarks
19+
20+
**ClearFilter** sets **Filter** to an empty string, as `dlg.Filter = ""` does. The four `Set...Filters` methods call it first, so each of them replaces the filter.
21+
22+
## Example
23+
24+
```tb check_build check_run
25+
Dim dlg As New cDialog
26+
dlg.AddFilter "Text Files (*.txt)", "*.txt"
27+
Debug.Print Len(dlg.Filter) > 0 ' True
28+
29+
dlg.ClearFilter
30+
Debug.Print Len(dlg.Filter) ' 0
31+
```
32+
33+
## See Also
34+
35+
- [Filter](Filter) property -- the whole list as one string
36+
- [AddFilter](AddFilter) method -- appends a pair
37+
- [Reset](Reset) method -- clears the filter along with every other property
38+
- [cDialog](.) class -- overview
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: CreatePrompt
3+
parent: cDialog
4+
permalink: /tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/CreatePrompt
5+
has_toc: false
6+
---
7+
8+
# CreatePrompt
9+
{: .no_toc }
10+
11+
Returns or sets whether the Open dialog asks permission before it accepts the name of a file that does not exist.
12+
13+
Syntax: *object*.**CreatePrompt** [ = *boolean* ]
14+
15+
*object*
16+
: *required* An object expression that evaluates to a **cDialog**.
17+
18+
*boolean*
19+
: A **Boolean**. **True** sets `OFN_CREATEPROMPT`. The default is **False**.
20+
21+
## Remarks
22+
23+
Only [**ShowOpen**](ShowOpen) uses the property. [**ShowSave**](ShowSave) never sets `OFN_CREATEPROMPT`, and [**ShowBrowseForFolder**](ShowBrowseForFolder) ignores the property.
24+
25+
When the user types the name of a file that does not exist, such as `nosuch.txt`, the box *This file doesn't exist. Create the file?* appears, with the buttons *Yes* and *No*. *Yes* closes the dialog and returns the path. *No* leaves the dialog open. This happens whether [**FileMustExist**](FileMustExist) is **True** or **False**, so the question takes the place of the *File not found* box that **FileMustExist** shows.
26+
27+
The file is not created: neither the dialog nor the class creates it, and the program has to do so.
28+
29+
## Example
30+
31+
```tb check_build check_run
32+
Dim dlg As New cDialog
33+
Debug.Print dlg.CreatePrompt ' False
34+
35+
dlg.CreatePrompt = True
36+
Debug.Print dlg.CreatePrompt ' True
37+
```
38+
39+
This example lets the user name a new file in the Open dialog and creates it when the user agrees.
40+
41+
```tb check_build
42+
Dim dlg As New cDialog
43+
Dim path As String
44+
45+
dlg.CreatePrompt = True
46+
path = dlg.ShowOpen()
47+
If Len(path) > 0 Then
48+
If Len(Dir$(path)) = 0 Then
49+
Open path For Output As #1
50+
Close #1
51+
End If
52+
End If
53+
```
54+
55+
## See Also
56+
57+
- [FileMustExist](FileMustExist) property -- lets only names of existing files through
58+
- [ShowOpen](ShowOpen) method -- shows the Open dialog
59+
- [cDialog](.) class -- overview
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: DefaultExt
3+
parent: cDialog
4+
permalink: /tB/Packages/Contributed/TBMANLIB_Dialog/cDialog/DefaultExt
5+
has_toc: false
6+
---
7+
8+
# DefaultExt
9+
{: .no_toc }
10+
11+
Returns or sets the extension that Windows adds to a file name that the user types without one.
12+
13+
Syntax: *object*.**DefaultExt** [ = *string* ]
14+
15+
*object*
16+
: *required* An object expression that evaluates to a **cDialog**.
17+
18+
*string*
19+
: A **String**, an extension written without a period, such as `txt`. The default is an empty string.
20+
21+
## Remarks
22+
23+
[**ShowOpen**](ShowOpen) and [**ShowSave**](ShowSave) pass the text as the `lpstrDefExt` member of `OPENFILENAME`. [**ShowBrowseForFolder**](ShowBrowseForFolder) ignores it.
24+
25+
Windows appends the extension to a name that the user types without one. Write the extension without a period. The class does not change the text, and does not take an extension from the selected pair of [**Filter**](Filter).
26+
27+
In the Save As dialog, with the user typing `out`:
28+
29+
| **DefaultExt** | **ShowSave** returns |
30+
|---|---|
31+
| `txt` | `<dir>\out.txt` |
32+
| `.txt` | `<dir>\out..txt` |
33+
| An empty string | `<dir>\out` |
34+
35+
`<dir>` is the folder of the dialog. A period in **DefaultExt** is kept, and gives a name with two periods. An empty **DefaultExt** appends nothing.
36+
37+
## Example
38+
39+
```tb check_build check_run
40+
Dim dlg As New cDialog
41+
Debug.Print "[" & dlg.DefaultExt & "]" ' []
42+
43+
dlg.DefaultExt = "txt"
44+
Debug.Print dlg.DefaultExt ' txt
45+
```
46+
47+
This example shows the Save As dialog and adds `.txt` to a name typed without an extension.
48+
49+
```tb check_build
50+
Dim dlg As New cDialog
51+
dlg.DefaultExt = "txt"
52+
dlg.SetCommonFilters
53+
Debug.Print dlg.ShowSave()
54+
```
55+
56+
## See Also
57+
58+
- [Filter](Filter) property -- the file-type list, which does not set the extension
59+
- [ShowSave](ShowSave) method -- shows the Save As dialog
60+
- [ShowOpen](ShowOpen) method -- shows the Open dialog
61+
- [cDialog](.) class -- overview

0 commit comments

Comments
 (0)