@@ -68,36 +68,33 @@ To compile PureScript .purs files from .proto files, run for example:
6868We can test out code generation immediately by
6969generating ` .purs ` files for any of Google’s built-in “well-known types” in the
7070[ ` google.protobuf ` ] ( https://protobuf.dev/reference/protobuf/google.protobuf/ ) package namespace. Try the command
71- ``` console
71+ ``` shell
7272protoc --purescript_out=. google/protobuf/any.proto
7373```
7474or
75- ``` console
75+ ``` shell
7676protoc --purescript_out=. google/protobuf/timestamp.proto
7777```
7878
7979To see
8080[ all of the ` .proto ` definitions] ( https://github.com/protocolbuffers/protobuf/tree/main/src/google/protobuf )
8181included with the Nix PureScript Protobuf installation including
8282the “well-known types,”
83- ``` console
83+ ``` shell
8484ls $( nix path-info .# protobuf)/src/google/protobuf/*.proto
8585` ` `
8686
8787If you don' t want to use Nix,
88881. install the PureScript toolchain and `protoc`.
89892. Build the [PureScript plugin for `protoc`](plugin/).
90903. Run `protoc` with the path to the PureScript plugin executable, like for example
91- ``` console
91+ ```shell
9292 protoc --plugin=bin/protoc-gen-purescript --purescript_out=. google/protobuf/timestamp.proto
9393 ```
9494
9595## Writing programs with the generated code
9696
97- The code generator will use the ` package ` import statement in the ` .proto ` file
98- and the base ` .proto ` file name as the PureScript module name for that file.
99-
100- A message in a ` shapes.proto ` descriptor file declared as
97+ Suppose we have a `Rectangle` message declared in a `shapes.proto` descriptor file:
10198
10299```
103100syntax = "proto3";
@@ -109,8 +106,19 @@ message Rectangle {
109106}
110107```
111108
112- will export these four names from module ` Interproc.Shapes ` in a
113- generated ` shapes.Interproc.purs ` file.
109+ We run
110+
111+ ```shell
112+ protoc --purescript_out=. shapes.proto
113+ ```
114+
115+ which will generate a file `shapes.Interproc.purs`.
116+
117+ The code generator will use the `package` import statement in the `.proto` file
118+ and the base `.proto` file name as the PureScript module name for that file.
119+
120+ The generated `shapes.Interproc.purs` file
121+ will export these four names from module `Interproc.Shapes`.
114122
1151231. A message data type.
116124
@@ -258,12 +266,12 @@ programs which use code generated by __protobuf__. Refer to these
258266for further examples of how to use the generated code.
259267
2602681. The ` protoc`
261- [ compiler plugin] ( https://github.com/xc-jp /purescript-protobuf/blob/master/plugin/src/Main.purs ) .
269+ [compiler plugin](https://github.com/rowtype-yoga /purescript-protobuf/blob/master/plugin/src/Main.purs).
262270 The code generator imports generated code. This program writes itself.
2632712. The
264- [ unit test suite] ( https://github.com/xc-jp /purescript-protobuf/blob/master/library /test/Main.purs )
272+ [unit test suite](https://github.com/rowtype-yoga /purescript-protobuf/blob/master/plugin /test/Test/ Main.purs).
2652733. The Google
266- [ conformance test program] ( https://github.com/xc-jp/purescript-protobuf/blob/master/conformance/src/Main.purs )
274+ [conformance test program](https://github.com/xc-jp/purescript-protobuf/blob/master/conformance/src/Main.purs).
267275
268276The [Protobuf Decoder Explainer](http://jamesdbrock.github.io/protobuf-decoder-explainer/) shows an
269277example of how to use this library to parse binary Protobuf when we don’t
0 commit comments