Skip to main content

Tooling & Codegen

Introduction​

The blocks in this group are for programs that read or write text formats and source code instead of serving users: generators, documentation tools and API model processors.

The Blocks​

The group has three blocks, each aimed at a different format.

BlockArtifactWhat It Is For
Code Generationzio-blocks-codegenGeneric Scala code generation IR and emitter
Docszio-blocks-markdownGitHub Flavored Markdown parsing, rendering, and programmatic construction
Smithyzio-blocks-smithySmithy IDL parser and AST library for API modeling

How the Blocks Differ​

Code Generation provides an intermediate representation of Scala code, such as files, case classes, sealed traits and methods, and a pure emitter that turns it into formatted Scala source.

Docs is the Markdown library: an immutable model of a document, a strict parser, renderers for Markdown, HTML and the terminal, and a string interpolator validated at compile time. Its artifact is zio-blocks-markdown.

Smithy parses Smithy 2.0 text into a data structure, lets a program query the shapes in a model, and prints a model back as valid Smithy.

Where to Start​

Start with Code Generation to emit Scala source from a model, and Smithy when the input is an API model. Read Docs to parse or build Markdown documents.