Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Getting started

## Install protoc

The betterproto2 compiler is a plugin of `protoc`, you first need to [install](https://grpc.io/docs/protoc-installation/) it.

## Install `betterproto2_compiler`

It is possible to install `betterproto2_compiler` using pip:

```
pip install betterproto2_compiler
```

## Compile a proto file

Create the following `example.proto` file.

```proto
syntax = "proto3";

package helloworld;

message HelloWorld {
string message = 1;
}
```

You should now be able to compile it using:

```
mkdir lib
protoc -I . --python_betterproto2_out=lib example.proto
```
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Home
====

Welcome to betterproto2-compiler's documentation!
Welcome to `betterproto2_compiler`'s documentation! This site will guide you through the steps needed to install and use the betterproto2 compiler.
11 changes: 10 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
site_name: Betterproto2 Compiler
site_name: Betterproto2
site_url: https://betterproto.github.io/python-betterproto2-compiler/
theme:
name: material
palette:
primary: deep orange
accent: deep orange

features:
- navigation.tabs

nav:
- Betterproto2: https://betterproto.github.io/python-betterproto2/
- Betterproto2 compiler:
- index.md
- Getting started: getting-started.md

plugins:
- mkdocstrings

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pytest = "^6.2.5"
protobuf = "^4"

[tool.poetry.scripts]
protoc-gen-python_betterproto = "betterproto2_compiler.plugin:main"
protoc-gen-python_betterproto2 = "betterproto2_compiler.plugin:main"

[tool.ruff]
extend-exclude = ["tests/output_*"]
Expand Down
2 changes: 1 addition & 1 deletion tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def protoc(
):
path: Path = Path(path).resolve()
output_dir: Path = Path(output_dir).resolve()
python_out_option: str = "python_betterproto_out" if not reference else "python_out"
python_out_option: str = "python_betterproto2_out" if not reference else "python_out"

if pydantic_dataclasses:
plugin_path = Path("src/betterproto2_compiler/plugin/main.py")
Expand Down
Loading