Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogenerate scenario schema doc #1441

Merged
merged 2 commits into from
Oct 9, 2023
Merged

Conversation

kostmo
Copy link
Member

@kostmo kostmo commented Aug 21, 2023

Closes #1436.

The schema .json files are now the authoritative source of truth for documentation.

Wrote a very simple parser for JsonSchema to extract the documentation from JSON.

Split the README.md into static and auto-generated parts.

Added a custom "footers" key to schema files to support inclusion of other markdown files for each object description.

Schema doc regeneration

./scripts/regenerate-schema-docs.sh

@kostmo kostmo force-pushed the feature/scenario-schema-docs branch 4 times, most recently from 228b5b1 to 3180bb0 Compare August 22, 2023 06:39
makePandocTable (fn, schm) =
setTitle (text "JSON Schema for Scenarios") $
doc $
header 3 (text $ T.toTitle $ T.pack fn) <> para (text $ description schm) <> myTable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a section in Get.hs for generating tables manually:

-- ----------------------------------------------------------------------------
-- GENERATE TABLES: COMMANDS, ENTITIES AND CAPABILITIES TO MARKDOWN TABLE
-- ----------------------------------------------------------------------------

We could reuse that here or make Gen.hs use Pandoc as well if Doc is split out.

@kostmo kostmo force-pushed the feature/scenario-schema-docs branch from 3180bb0 to 19199f3 Compare August 27, 2023 00:18
@kostmo kostmo force-pushed the feature/scenario-schema-docs branch 10 times, most recently from e553a0c to 5f27081 Compare September 26, 2023 06:45
@kostmo kostmo force-pushed the feature/scenario-schema-docs branch from 5f27081 to ba81aa3 Compare October 3, 2023 18:55
@kostmo kostmo mentioned this pull request Oct 8, 2023
4 tasks
@kostmo kostmo force-pushed the feature/scenario-schema-docs branch 4 times, most recently from ca2ef0d to e022916 Compare October 9, 2023 00:11
@kostmo kostmo force-pushed the feature/scenario-schema-docs branch from e022916 to c314cc5 Compare October 9, 2023 00:12
@kostmo kostmo requested a review from byorgey October 9, 2023 00:37
@kostmo kostmo marked this pull request as ready for review October 9, 2023 00:40
Copy link
Member

@byorgey byorgey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic! Thanks for putting in all the effort required!

@kostmo kostmo added the merge me Trigger the merge process of the Pull request. label Oct 9, 2023
@mergify mergify bot merged commit 4e886e0 into main Oct 9, 2023
10 checks passed
@mergify mergify bot deleted the feature/scenario-schema-docs branch October 9, 2023 02:11
@kostmo kostmo mentioned this pull request Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Autogenerate parts of scenarios/README.md
3 participants