Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support multi line description in markdown #486

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion examples/doc/example.docbook
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@
<entry>daily_hire_rate_cents</entry>
<entry><link linkend="sint32">sint32</link></entry>
<entry>optional</entry>
<entry><para>Cents per day.</para></entry>
<entry><para>Cents per day.</para><para>e.g. 20</para></entry>
</row>

</tbody>
Expand Down
4 changes: 3 additions & 1 deletion examples/doc/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,9 @@ <h3 id="com.example.Vehicle">Vehicle</h3>
<td>daily_hire_rate_cents</td>
<td><a href="#sint32">sint32</a></td>
<td>optional</td>
<td><p>Cents per day. </p></td>
<td><p>Cents per day.

e.g. 20 </p></td>
</tr>

</tbody>
Expand Down
2 changes: 1 addition & 1 deletion examples/doc/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@
},
{
"name": "daily_hire_rate_cents",
"description": "Cents per day.",
"description": "Cents per day.\n\ne.g. 20",
"label": "optional",
"type": "sint32",
"longType": "sint32",
Expand Down
2 changes: 1 addition & 1 deletion examples/doc/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Represents a vehicle that can be hired.
| mileage | [sint32](#sint32) | optional | Current vehicle mileage, if known. |
| category | [Vehicle.Category](#com-example-Vehicle-Category) | optional | Vehicle category. |
| daily_hire_rate_dollars | [sint32](#sint32) | optional | Dollars per day. Default: 50 |
| daily_hire_rate_cents | [sint32](#sint32) | optional | Cents per day. |
| daily_hire_rate_cents | [sint32](#sint32) | optional | Cents per day.&lt;br&gt;&lt;br&gt;e.g. 20 |



Expand Down
2 changes: 2 additions & 0 deletions examples/doc/example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ Represents a vehicle that can be hired.

|daily_hire_rate_cents | <<sint32,sint32>> |optional |Cents per day.

e.g. 20

|===========================================


Expand Down
2 changes: 2 additions & 0 deletions examples/proto/Vehicle.proto
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ message Vehicle {

/**
* Cents per day.
*
* e.g. 20
*/
optional sint32 daily_hire_rate_cents = 7;

Expand Down
10 changes: 5 additions & 5 deletions resources/markdown.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
{{range .Fields -}}
| {{.Name}} | [{{.LongType}}](#{{.FullType | anchor}}) | {{.Label}} | {{if (index .Options "deprecated"|default false)}}**Deprecated.** {{end}}{{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
| {{.Name}} | [{{.LongType}}](#{{.FullType | anchor}}) | {{.Label}} | {{if (index .Options "deprecated"|default false)}}**Deprecated.** {{end}}{{.Description | replace "\n" "<br>" | nobr}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
{{end}}
{{end}}

{{if .HasExtensions}}
| Extension | Type | Base | Number | Description |
| --------- | ---- | ---- | ------ | ----------- |
{{range .Extensions -}}
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{.Description | replace "\n" "<br>" | nobr}}{{if .DefaultValue}} Default: {{.DefaultValue}}{{end}} |
{{end}}
{{end}}

Expand All @@ -64,7 +64,7 @@
| Name | Number | Description |
| ---- | ------ | ----------- |
{{range .Values -}}
| {{.Name}} | {{.Number}} | {{nobr .Description}} |
| {{.Name}} | {{.Number}} | {{.Description | replace "\n" "<br>" | nobr}} |
{{end}}

{{end}} <!-- end enums -->
Expand All @@ -76,7 +76,7 @@
| Extension | Type | Base | Number | Description |
| --------- | ---- | ---- | ------ | ----------- |
{{range .Extensions -}}
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{nobr .Description}}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} |
| {{.Name}} | {{.LongType}} | {{.ContainingLongType}} | {{.Number}} | {{.Description | replace "\n" "<br>" | nobr}}{{if .DefaultValue}} Default: `{{.DefaultValue}}`{{end}} |
{{end}}
{{end}} <!-- end HasExtensions -->

Expand All @@ -89,7 +89,7 @@
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
{{range .Methods -}}
| {{.Name}} | [{{.RequestLongType}}](#{{.RequestFullType | anchor}}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}](#{{.ResponseFullType | anchor}}){{if .ResponseStreaming}} stream{{end}} | {{nobr .Description}} |
| {{.Name}} | [{{.RequestLongType}}](#{{.RequestFullType | anchor}}){{if .RequestStreaming}} stream{{end}} | [{{.ResponseLongType}}](#{{.ResponseFullType | anchor}}){{if .ResponseStreaming}} stream{{end}} | {{.Description | replace "\n" "<br>" | nobr}} |
{{end}}
{{end}} <!-- end services -->

Expand Down