Skip to content

Commit f963523

Browse files
authored
Fix some docs formatting (#2112)
There were some warnings when building the documentation so this PR fixes them.
1 parent f97f76c commit f963523

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

Sources/GRPCCore/Documentation.docc/Articles/Generating-stubs.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
Learn how to generate stubs for gRPC Swift from a service defined using the Protocol Buffers IDL.
44

5-
## Using protoc
5+
## Overview
6+
7+
### Using protoc
68

79
If you've used Protocol Buffers before then generating gRPC Swift stubs should be simple. If you're
810
unfamiliar with Protocol Buffers then you should get comfortable with the concepts before
@@ -45,7 +47,7 @@ protoc \
4547
--grpc-swift_out=.
4648
```
4749

48-
### Generator options
50+
#### Generator options
4951

5052
| Name | Possible Values | Default | Description |
5153
|---------------------------|--------------------------------------------|------------|----------------------------------------------------------|
@@ -67,7 +69,7 @@ allows you to specify a mapping from `.proto` files to the Swift module they are
6769
allows the code generator to add appropriate imports to your generated stubs. This is described in
6870
more detail in the [SwiftProtobuf documentation](https://github.com/apple/swift-protobuf/blob/main/Documentation/PLUGIN.md).
6971

70-
### Building the plugin
72+
#### Building the plugin
7173

7274
> The version of `protoc-gen-grpc-swift` you use mustn't be newer than the version of
7375
> the `grpc-swift-protobuf` you're using.

Sources/GRPCCore/Documentation.docc/Development/Benchmarks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Benchmarks
22

3+
This article discusses benchmarking in `grpc-swift`.
4+
35
## Overview
46

57
Benchmarks for this package are in a separate Swift Package in the `Performance/Benchmarks`

Sources/GRPCCore/Documentation.docc/Development/Design.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ mapping a call onto a stream and dealing with serialization. The highest level
1414
of abstraction is the _stub_ layer which provides client and server interfaces
1515
generated from an interface definition language (IDL).
1616

17-
## Transport
17+
## Overview
18+
19+
### Transport
1820

1921
The transport layer provides a bidirectional communication channel with a remote
2022
peer which is typically long-lived.
@@ -42,7 +44,7 @@ The vast majority of users won't need to implement either of these protocols.
4244
However, many users will need to create instances of types conforming to these
4345
protocols to create a server or client, respectively.
4446

45-
### Server transport
47+
#### Server transport
4648

4749
The ``ServerTransport`` is responsible for the server half of a transport. It
4850
listens for new gRPC streams and then processes them. This is achieved via the
@@ -57,7 +59,7 @@ Note that the server transport doesn't include the idea of a "connection". While
5759
an HTTP/2 server transport will in all likelihood have multiple connections open
5860
at any given time, that detail isn't surfaced at this level of abstraction.
5961

60-
### Client transport
62+
#### Client transport
6163

6264
While the server is responsible for handling streams, the ``ClientTransport`` is
6365
responsible for creating them. Client transports will typically maintain a
@@ -83,7 +85,7 @@ may be retried. Some of this is exposed via the ``ClientTransport`` as
8385
the ``ClientTransport/retryThrottle`` and
8486
``ClientTransport/config(forMethod:)``.
8587

86-
### Streams
88+
#### Streams
8789

8890
Both client and server transport protocols use ``RPCStream`` to represent
8991
streams of information. Each RPC can be thought of as having two logical
@@ -122,7 +124,7 @@ and indicates the final outcome of an RPC. It includes a ``Status/Code-swift.str
122124
and string describing the final outcome while the ``Metadata`` may contain additional
123125
information about the RPC.
124126

125-
## Call
127+
### Call
126128

127129
The "call" layer builds on top the transport layer to map higher level RPCs calls on
128130
to streams. It also implements transport-agnostic functionality, like serialization
@@ -139,7 +141,7 @@ provides support for [SwiftProtobuf](https://github.com/apple/swift-protobuf) by
139141
implementing serializers and a code generator for the Protocol Buffers
140142
compiler, `protoc`.
141143

142-
### Interceptors
144+
#### Interceptors
143145

144146
This layer also provides client and server interceptors allowing you to modify requests
145147
and responses between the caller and the network. These are implemented as
@@ -152,7 +154,7 @@ Naturally, the interceptors APIs are `async`.
152154
Interceptors are registered directly with the ``GRPCClient`` and ``GRPCServer`` and
153155
can either be applied to all RPCs or to specific services.
154156

155-
### Client
157+
#### Client
156158

157159
The call layer includes a concrete ``GRPCClient`` which provides API to execute all
158160
four types of RPC against a ``ClientTransport``. These methods are:
@@ -178,7 +180,7 @@ which will stop new RPCs from starting (by failing them with
178180
Existing work can be stopped more abruptly by cancelling the task where
179181
``GRPCClient/run()`` is executing.
180182

181-
### Server
183+
#### Server
182184

183185
``GRPCServer`` is provided by the call layer to host services for a given
184186
transport. Beyond creating the server it has a very limited API surface: it has
@@ -188,7 +190,7 @@ can initiate graceful shutdown by calling ``GRPCServer/beginGracefulShutdown()``
188190
which will stop new RPCs from being handled but will let existing RPCs run to
189191
completion. Cancelling the task will close the server more abruptly.
190192

191-
## Stub
193+
### Stub
192194

193195
The stub layer is the layer which most users interact with. It provides service
194196
specific interfaces generated from an interface definition language (IDL) such
@@ -204,7 +206,7 @@ However, the stub layer is optional, users may choose to not use it and
204206
construct clients and services manually. A gRPC proxy, for example, would not
205207
use the stub layer.
206208

207-
### Server stubs
209+
#### Server stubs
208210

209211
Users implement services by conforming a type to a generated service `protocol`.
210212
Each service has three protocols generated for it:
@@ -308,7 +310,7 @@ refines the ``RegistrableRPCService`` protocol. This `protocol` has a single
308310
requirement for registering methods with an ``RPCRouter``. A default
309311
implementation of this method is also provided.
310312

311-
### Client stubs
313+
#### Client stubs
312314

313315
Generated client code is split into a `protocol` and a concrete `struct`
314316
implementing the `protocol`. An example of the client protocol is:

Sources/GRPCCore/Documentation.docc/Documentation.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ A gRPC library for Swift written natively in Swift.
55
> 🚧 This module is part of gRPC Swift v2 which is under active development and in the pre-release
66
> stage.
77
8-
## Package structure
8+
## Overview
9+
10+
### Package structure
911

1012
gRPC Swift is distributed across multiple Swift packages. These are:
1113

@@ -32,7 +34,7 @@ gRPC Swift is distributed across multiple Swift packages. These are:
3234
This package, and this module (``GRPCCore``) in particular, include higher level documentation such
3335
as tutorials.
3436

35-
## Modules in this package
37+
### Modules in this package
3638

3739
- ``GRPCCore`` (this module) contains core abstractions, currency types and runtime components
3840
for gRPC Swift.

0 commit comments

Comments
 (0)