@@ -92,13 +92,13 @@ For Closure imports, `protoc` will generate a single output file
92
92
(` myproto_libs.js ` in this example). The generated file will ` goog.provide() `
93
93
all of the types defined in your .proto files. For example, for the unit
94
94
tests the generated files contain many ` goog.provide ` statements like:
95
-
95
+ ``` js
96
96
goog .provide (' proto.google.protobuf.DescriptorProto' );
97
97
goog .provide (' proto.google.protobuf.DescriptorProto.ExtensionRange' );
98
98
goog .provide (' proto.google.protobuf.DescriptorProto.ReservedRange' );
99
99
goog .provide (' proto.google.protobuf.EnumDescriptorProto' );
100
100
goog .provide (' proto.google.protobuf.EnumOptions' );
101
-
101
+ ```
102
102
The generated code will also ` goog.require() ` many types in the core library,
103
103
and they will require many types in the Google Closure library. So make sure
104
104
that your ` goog.provide() ` / ` goog.require() ` setup can find all of your
@@ -107,11 +107,11 @@ Google Closure library itself.
107
107
108
108
Once you've done this, you should be able to import your types with
109
109
statements like:
110
-
110
+ ``` js
111
111
goog .require (' proto.my.package.MyMessage' );
112
112
113
113
var message = proto .my .package .MyMessage ();
114
-
114
+ ```
115
115
If unfamiliar with Closure or its compiler, consider reviewing
116
116
[ Closure documentation] ( https://developers.google.com/closure/library ) .
117
117
@@ -134,11 +134,11 @@ to build it first by running:
134
134
135
135
Once you've done this, you should be able to import your types with
136
136
statements like:
137
-
137
+ ``` js
138
138
var messages = require (' ./messages_pb' );
139
139
140
140
var message = new messages.MyMessage ();
141
-
141
+ ```
142
142
The ` --js_out ` flag
143
143
-------------------
144
144
165
165
166
166
The API is not well-documented yet. Here is a quick example to give you an
167
167
idea of how the library generally works:
168
-
168
+ ``` js
169
169
var message = new MyMessage ();
170
170
171
171
message .setName (" John Doe" );
@@ -176,6 +176,6 @@ idea of how the library generally works:
176
176
var bytes = message .serializeBinary ();
177
177
178
178
var message2 = MyMessage .deserializeBinary (bytes);
179
-
179
+ ```
180
180
For more examples, see the tests. You can also look at the generated code
181
181
to see what methods are defined for your generated messages.
0 commit comments