Skip to content

Conversation

@tawera-manaena
Copy link
Contributor

@tawera-manaena tawera-manaena commented Jun 2, 2025

Motivation

Now that we can generate Shortbread MBTiles, we need a system for automatically generating schema-like documentation. The system should create markdown files detailing the layers, features within those layers, and attributes for each feature, similar to Shortbread's Vector Tile Schema documentation.

Modifications

This work introduces two new cli commands for the cli-vector package:

reports

Parses an MBTiles file to extract and report detailed information about its contents. Identifies the layers, features within those layers, and attributes for each feature. For each identified layer, the command exports a JSON Report file, saving it into the target directory.

Inputs

Name Type Description
mbtiles Url Path to the mbtiles from which to generate reports.
target UrlFolder Target directory into which to save the generated reports.

Outputs

For each layer extracted from the MBTiles file:

Name Type Description
${layer.name}.json Report A JSON Report file detailing a layer's features, and attributes for each feature.

docs

Parses a directory of JSON Report files, a directory of JSON Schema files, and a Mustache template file to generate a collection of Vector Tile schema-like markdown files. For each JSON Report file, the command re-maps the report into a runtime Doc object, feeds the Doc into Mustache, and then exports a Markdown file, saving it into the target directory.

Inputs

Name Type Description
schemas UrlFolder Path to the directory containing schemas from which to extract layer-specific information.
reports UrlFolder Path to the directory containing JSON Report files from which to extract layer, feature, and attribute information.
template Url Path to the Mustache template markdown file.
target Url Target directory into which to save the generated markdown documentation.

Outputs

For each JSON Report file:

Name Type Description
${layer.name}.md Markdown A Markdown file detailing a layer's features, attributes for each feature, and values.

Verification

Base automatically changed from feat/etl-create to master June 4, 2025 02:12
@tawera-manaena tawera-manaena changed the title feat(cli-vector): initialise cli-vector docs command feat(cli-vector): implement cli-vector reports and docs commands Jun 11, 2025
@tawera-manaena tawera-manaena changed the title feat(cli-vector): implement cli-vector reports and docs commands feat(cli-vector): implement reports and docs commands BM-1215 Jun 11, 2025
@tawera-manaena tawera-manaena marked this pull request as ready for review June 12, 2025 21:45
@tawera-manaena tawera-manaena requested a review from a team as a code owner June 12, 2025 21:45
@tawera-manaena tawera-manaena marked this pull request as draft June 12, 2025 23:07
@tawera-manaena tawera-manaena marked this pull request as ready for review June 15, 2025 21:37
@tawera-manaena tawera-manaena marked this pull request as draft July 30, 2025 22:06
@tawera-manaena
Copy link
Contributor Author

We've changed direction regarding how we will automatically generating schema-like documentation. I will look to close this pull request once I've built our desired solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant