Skip to content

Convert inline doc examples to compiled GratsCode snippets#227

Merged
captbaritone merged 3 commits intomainfrom
docs-grats-code-audit
Apr 2, 2026
Merged

Convert inline doc examples to compiled GratsCode snippets#227
captbaritone merged 3 commits intomainfrom
docs-grats-code-audit

Conversation

@captbaritone
Copy link
Copy Markdown
Owner

Summary

  • Converts ~35 inline code blocks across 12 doc pages to compiled GratsCode snippets, ensuring all examples are validated by the Grats compiler and include Playground links
  • Adds a compact custom tab bar for the GratsCode "both" mode, replacing the heavyweight Docusaurus Tabs component
  • Updates the README example to use positional arguments
  • Renames generics.md and stream.md to .mdx to support JSX imports

Converted 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

  • All lint, build, and test suites pass
  • Docs site builds and serves correctly
  • Verified examples render with tabbed TS/GraphQL views and Playground links
  • Verified pnpm run grats generates correct .out files for all new snippets

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).
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

Deploy Preview for grats ready!

Name Link
🔨 Latest commit 5af2d57
🔍 Latest deploy log https://app.netlify.com/projects/grats/deploys/69cdb8d02031c2000819ba41
😎 Deploy Preview https://deploy-preview-227--grats.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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.
@captbaritone captbaritone merged commit 56f2e75 into main Apr 2, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant