Convert inline doc examples to compiled GratsCode snippets#227
Merged
captbaritone merged 3 commits intomainfrom Apr 2, 2026
Merged
Convert inline doc examples to compiled GratsCode snippets#227captbaritone merged 3 commits intomainfrom
captbaritone merged 3 commits intomainfrom
Conversation
Replace ~35 inline code blocks across 12 doc pages with compiled GratsCode snippets, ensuring all examples are validated by the Grats compiler and include Playground links. Converted pages: enums, arguments, inputs, unions, context, scalars, info, generics, strict-semantic-nullability, stream, permissions, and the getting-started hero examples. Also adds a compact custom tab bar for the GratsCode "both" mode (replacing the heavyweight Docusaurus Tabs), updates the README example to use positional arguments, and renames generics.md and stream.md to .mdx to support JSX imports. Intentionally left as inline code: examples with non-grats imports (permissions directive impl), invalid TS syntax (nullable defaults), pseudo-code (functional fields), and error cases (FAQ pages).
✅ Deploy Preview for grats ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Render both panels in the DOM (hiding inactive with display:none) instead of conditionally rendering, so the docs-export plugin can extract the GraphQL code. Update the export plugin to unhide the hidden panel and strip the custom tab bar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
generics.mdandstream.mdto.mdxto support JSX importsConverted pages: enums, arguments, inputs, unions, context, scalars, info, generics, strict-semantic-nullability, stream, permissions, getting-started hero examples
Intentionally left as inline code: examples with non-grats imports (permissions directive impl), invalid TS syntax (nullable defaults), pseudo-code (functional fields), and error cases (FAQ pages)
Test plan
pnpm run gratsgenerates correct.outfiles for all new snippets