Skip to content

Commit 133c166

Browse files
committed
examples: Rename and regenerate
1 parent f5174d3 commit 133c166

File tree

6 files changed

+109
-54
lines changed

6 files changed

+109
-54
lines changed

testdata/example1/Booking.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# Booking.proto
2-
3-
<a name="Booking-proto"></a><p align="right"><a href="#top">Top</a></p>
1+
---
2+
title: com.example.booking
3+
description: API Specification for the com.example.booking package.
4+
---
45

6+
<a name="booking-proto"></a><p align="right"><a href="#top">Top</a></p>
57

8+
<!-- begin services -->
69

710

811
<a name="com-example-booking-BookingService"></a>
@@ -20,7 +23,7 @@ Service for handling vehicle bookings.
2023

2124

2225

23-
26+
<!-- begin services -->
2427

2528

2629

@@ -40,10 +43,9 @@ Represents the booking status ID.
4043

4144

4245

46+
<!-- end nested messages -->
4347

44-
45-
46-
48+
<!-- end nested enums -->
4749

4850

4951

@@ -60,15 +62,14 @@ Represents the status of a vehicle booking.
6062
| Field | Type | Description |
6163
| ----- | ---- | ----------- |
6264
| id |int32| Unique booking status ID. |
63-
| description |string| Booking status description. E.g. &#34;Active&#34;. |
64-
65+
| description |string| Booking status description. E.g. "Active". |
6566

6667

6768

6869

69-
70+
<!-- end nested messages -->
7071

71-
72+
<!-- end nested enums -->
7273

7374

7475

@@ -78,8 +79,8 @@ Represents the status of a vehicle booking.
7879
### Booking
7980

8081
Represents the booking of a vehicle.
81-
//
82-
// Vehicles are quite fun. But drive carefully!
82+
83+
Vehicles are quite fun. But drive carefully!
8384

8485

8586

@@ -96,10 +97,9 @@ Represents the booking of a vehicle.
9697

9798

9899

100+
<!-- end nested messages -->
99101

100-
101-
102-
102+
<!-- end nested enums -->
103103

104104

105105

@@ -116,16 +116,16 @@ An empty message for testing
116116

117117

118118

119-
120-
121-
122-
119+
<!-- end nested messages -->
123120

124-
121+
<!-- end nested enums -->
125122

126123

127-
124+
<!-- end messages -->
128125

126+
<!-- begin file-level enums -->
127+
<!-- end file-level enums -->
129128

130-
129+
<!-- begin file-level extensions -->
130+
<!-- end file-level extensions -->
131131

testdata/example1/Vehicle.md

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# Vehicle.proto
2-
3-
<a name="Vehicle-proto"></a><p align="right"><a href="#top">Top</a></p>
4-
1+
---
2+
title: com.example
3+
description: API Specification for the com.example package.
4+
---
55

6+
<a name="vehicle-proto"></a><p align="right"><a href="#top">Top</a></p>
67

8+
<!-- begin services -->
79

10+
<!-- begin services -->
811

912

1013

@@ -20,15 +23,14 @@ Represents a manufacturer of cars.
2023
| Field | Type | Description |
2124
| ----- | ---- | ----------- |
2225
| id |int32| The unique manufacturer ID. |
23-
| code |string| A manufacturer code, e.g. &#34;DKL4P&#34;. |
26+
| code |string| A manufacturer code, e.g. "DKL4P". |
2427
| details |string| Manufacturer details (minimum orders et.c.). |
2528
| category |[Manufacturer.Category](#com-example-Manufacturer-Category)| Manufacturer category. |
2629

2730

2831

2932

30-
31-
33+
<!-- end nested messages -->
3234

3335

3436

@@ -45,7 +47,7 @@ Manufacturer category. A manufacturer may be either inhouse or external.
4547
| CATEGORY_EXTERNAL | 1 | The manufacturer is external. |
4648

4749

48-
50+
<!-- end nested enums -->
4951

5052

5153

@@ -62,18 +64,17 @@ Represents a vehicle model.
6264
| Field | Type | Description |
6365
| ----- | ---- | ----------- |
6466
| id |string| The unique model ID. |
65-
| model_code |string| The car model code, e.g. &#34;PZ003&#34;. |
66-
| model_name |string| The car model name, e.g. &#34;Z3&#34;. |
67+
| model_code |string| The car model code, e.g. "PZ003". |
68+
| model_name |string| The car model name, e.g. "Z3". |
6769
| daily_hire_rate_dollars |sint32| Dollars per day. |
6870
| daily_hire_rate_cents |sint32| Cents per day. |
6971

7072

7173

7274

75+
<!-- end nested messages -->
7376

74-
75-
76-
77+
<!-- end nested enums -->
7778

7879

7980

@@ -99,7 +100,6 @@ Represents a vehicle that can be hired.
99100

100101

101102

102-
103103
| Extension | Type | Base | Number | Description |
104104
| --------- | ---- | ---- | ------ | ----------- |
105105
| series | Vehicle.series | Vehicle | 100 | Vehicle model series. |
@@ -112,33 +112,32 @@ Represents a vehicle that can be hired.
112112

113113
### Category
114114

115-
Represents a vehicle category. E.g. &#34;Sedan&#34; or &#34;Truck&#34;.
115+
Represents a vehicle category. E.g. "Sedan" or "Truck".
116116

117117

118118

119119

120120
| Field | Type | Description |
121121
| ----- | ---- | ----------- |
122-
| code |string| Category code. E.g. &#34;S&#34;. |
123-
| description |string| Category name. E.g. &#34;Sedan&#34;. |
122+
| code |string| Category code. E.g. "S". |
123+
| description |string| Category name. E.g. "Sedan". |
124124

125125

126126

127127

128+
<!-- end nested messages -->
128129

129-
130+
<!-- end nested enums -->
130131

131-
132132

133+
<!-- end nested messages -->
133134

134-
135+
<!-- end nested enums -->
135136

136-
137-
138-
139-
140137

138+
<!-- end messages -->
141139

140+
<!-- begin file-level enums -->
142141

143142

144143
<a name="com-example-Coolness"></a>
@@ -153,16 +152,16 @@ Represents a vehicle category. E.g. &#34;Sedan&#34; or &#34;Truck&#34;.
153152
| COOLNESS_MAX | 1 | The coolness is maximum. |
154153

155154

156-
155+
<!-- end file-level enums -->
157156

157+
<!-- begin file-level extensions -->
158158

159+
<a name="vehicle-proto-extensions"></a>
159160

160-
<a name="Vehicle-proto-extensions"></a>
161-
162-
### File-level Extensions
163-
| Extension | Type | Base | Number | Description |
161+
### Extensions
162+
| Extension | Type | Extension Point | Number | Description |
164163
| --------- | ---- | ---- | ------ | ----------- |
165-
| country | com.example.country | (none) | 100 | Manufacturer country. |
164+
| country | com.example.country | Manufacturer | 100 | Manufacturer country. |
166165

167-
166+
<!-- end file-level extensions -->
168167

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: com.example.proto3
3+
description: API Specification for the com.example.proto3 package.
4+
---
5+
6+
<a name="field_presence-proto"></a><p align="right"><a href="#top">Top</a></p>
7+
8+
<!-- begin services -->
9+
10+
<!-- begin services -->
11+
12+
13+
14+
<a name="com-example-proto3-MyMessage"></a>
15+
16+
### MyMessage
17+
18+
19+
20+
21+
22+
| Field | Type | Description |
23+
| ----- | ---- | ----------- |
24+
| not_tracked |int32| |
25+
|<tr><td colspan=2>Union field `_tracked`. `_tracked` can be only one of the following:</td></tr>|
26+
| tracked |int32| Explicit presence |
27+
28+
29+
30+
31+
32+
<!-- end nested messages -->
33+
34+
<!-- end nested enums -->
35+
36+
37+
<!-- end messages -->
38+
39+
<!-- begin file-level enums -->
40+
<!-- end file-level enums -->
41+
42+
<!-- begin file-level extensions -->
43+
<!-- end file-level extensions -->
44+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Encoding and show field presence.
2+
syntax = "proto3";
3+
4+
package com.example.proto3;
5+
6+
option go_package = "example.com/vehicleproto3";
7+
8+
message MyMessage {
9+
int32 not_tracked = 1;
10+
// Explicit presence
11+
optional int32 tracked = 2;
12+
}

0 commit comments

Comments
 (0)