Skip to content
Open
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
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ DOCKER_CMD=docker run --rm \
-v $(DOCS_DIR):/out:rw \
-v $(PROTOS_DIR):/protos:ro \
-v $(EXAMPLE_DIR)/templates:/templates:ro \
-v $(PWD)/thirdparty/github.com/mwitkow:/usr/include/github.com/mwitkow:ro \
-v $(PWD)/thirdparty/github.com/envoyproxy:/usr/include/github.com/envoyproxy:ro \
-v $(PWD)/thirdparty/buf.build/protovalidate:/usr/include/buf.build/protovalidate:ro \
-v $(PWD)/examples/proto:/usr/include/examples:ro \
-v $(PWD)/tmp/googleapis/google/api:/usr/include/google/api:ro \
pseudomuto/protoc-gen-doc:latest

Expand Down
7 changes: 3 additions & 4 deletions cmd/protoc-gen-doc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
//
// Example: generate HTML documentation
//
// protoc --doc_out=. --doc_opt=html,index.html protos/*.proto
// protoc --doc_out=. --doc_opt=html,index.html protos/*.proto
//
// Example: use a custom template
//
// protoc --doc_out=. --doc_opt=custom.tmpl,docs.txt protos/*.proto
// protoc --doc_out=. --doc_opt=custom.tmpl,docs.txt protos/*.proto
//
// For more details, check out the README at https://github.com/pseudomuto/protoc-gen-doc
package main
Expand All @@ -21,8 +21,7 @@ import (

gendoc "github.com/pseudomuto/protoc-gen-doc"
_ "github.com/pseudomuto/protoc-gen-doc/extensions/google_api_http" // imported for side effects
_ "github.com/pseudomuto/protoc-gen-doc/extensions/lyft_validate" // imported for side effects
_ "github.com/pseudomuto/protoc-gen-doc/extensions/validator_field" // imported for side effects
_ "github.com/pseudomuto/protoc-gen-doc/extensions/protovalidate" // imported for side effects
)

func main() {
Expand Down
35 changes: 35 additions & 0 deletions examples/doc/example-camel-case-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
- [Address](#com-example-Address)
- [Customer](#com-example-Customer)

- [Edition2023.proto](#Edition2023-proto)
- [EditionMessage](#com-example-editions-EditionMessage)

- [Vehicle.proto](#Vehicle-proto)
- [Manufacturer](#com-example-Manufacturer)
- [Model](#com-example-Model)
Expand Down Expand Up @@ -179,6 +182,38 @@ Represents a customer.



<a name="Edition2023-proto"></a>
<p align="right"><a href="#top">Top</a></p>

## Edition2023.proto



<a name="com-example-editions-EditionMessage"></a>

### EditionMessage



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | |
| id | [int32](#int32) | | |















<a name="Vehicle-proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down
53 changes: 53 additions & 0 deletions examples/doc/example.docbook
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,59 @@



</section>

<section>
<title>Edition2023.proto</title>
<para></para>

<section id="com.example.editions.EditionMessage">
<title>EditionMessage</title>
<para></para>

<table frame="all">
<title><classname>EditionMessage</classname> Fields</title>
<tgroup cols="4">
<colspec colwidth="*"/>
<colspec colwidth="*"/>
<colspec colwidth="0.5*"/>
<colspec colwidth="3*"/>
<thead>
<row>
<entry>Field</entry>
<entry>Type</entry>
<entry>Label</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>

<row>
<entry>name</entry>
<entry><link linkend="string">string</link></entry>
<entry></entry>
<entry><para></para></entry>
</row>

<row>
<entry>id</entry>
<entry><link linkend="int32">int32</link></entry>
<entry></entry>
<entry><para></para></entry>
</row>

</tbody>
</tgroup>
</table>


</section>






</section>

<section>
Expand Down
122 changes: 92 additions & 30 deletions examples/doc/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,21 @@ <h2>Table of Contents</h2>



</ul>
</li>


<li>
<a href="#Edition2023.proto">Edition2023.proto</a>
<ul>

<li>
<a href="#com.example.editions.EditionMessage"><span class="badge">M</span>EditionMessage</a>
</li>




</ul>
</li>

Expand Down Expand Up @@ -328,6 +343,7 @@ <h3 id="com.example.Booking">Booking</h3>




<h4>Fields with deprecated option</h4>
<table>
<thead>
Expand Down Expand Up @@ -380,6 +396,7 @@ <h3 id="com.example.BookingStatus">BookingStatus</h3>




<h4>Validated Fields</h4>
<table>
<thead>
Expand All @@ -395,9 +412,9 @@ <h4>Validated Fields</h4>
<td>
<ul>

<li>string_not_empty: true</li>
<li>buf.validate.field.string.min_len: 1</li>

<li>length_lt: 255</li>
<li>buf.validate.field.string.max_len: 254</li>

</ul>
</td>
Expand Down Expand Up @@ -473,34 +490,6 @@ <h3 id="com.example.BookingService">BookingService</h3>
</table>




<h4>Methods with HTTP bindings</h4>
<table>
<thead>
<tr>
<td>Method Name</td>
<td>Method</td>
<td>Pattern</td>
<td>Body</td>
</tr>
</thead>
<tbody>



<tr>
<td>BookVehicle</td>
<td>POST</td>
<td>/api/bookings/vehicle/{vehicle_id}</td>
<td>*</td>
</tr>


</tbody>
</table>




<div class="file-heading">
Expand Down Expand Up @@ -565,6 +554,34 @@ <h3 id="com.example.Address">Address</h3>
</table>





<h4>Validated Fields</h4>
<table>
<thead>
<tr>
<td>Field</td>
<td>Validations</td>
</tr>
</thead>
<tbody>

<tr>
<td>address_line_1</td>
<td>
<ul>

<li>buf.validate.field.string.min_len: 2</li>

</ul>
</td>
</tr>

</tbody>
</table>





Expand Down Expand Up @@ -642,6 +659,51 @@ <h3 id="com.example.Customer">Customer</h3>



<div class="file-heading">
<h2 id="Edition2023.proto">Edition2023.proto</h2><a href="#title">Top</a>
</div>
<p></p>


<h3 id="com.example.editions.EditionMessage">EditionMessage</h3>
<p></p>


<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
</thead>
<tbody>

<tr>
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
</tr>

<tr>
<td>id</td>
<td><a href="#int32">int32</a></td>
<td></td>
<td><p> </p></td>
</tr>

</tbody>
</table>













<div class="file-heading">
<h2 id="Vehicle.proto">Vehicle.proto</h2><a href="#title">Top</a>
</div>
Expand Down
Loading