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: check markdown grammar issues #665

Merged
merged 11 commits into from
Jun 23, 2022
52 changes: 52 additions & 0 deletions .github/markdown_lint_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"MD001": true,
"MD002": false,
"MD003": false,
"MD004": false,
"MD005": false,
"MD006": false,
"MD007": false,
"MD008": false,
"MD009": false,
"MD010": false,
"MD011": false,
"MD012": false,
"MD013": false,
"MD014": false,
"MD015": false,
"MD016": false,
"MD017": false,
"MD018": false,
"MD019": false,
"MD020": false,
"MD021": false,
"MD022": false,
"MD023": false,
"MD024": false,
"MD025": false,
"MD026": false,
"MD027": false,
"MD028": false,
"MD029": false,
"MD030": false,
"MD031": true,
"MD032": false,
"MD033": false,
"MD034": false,
"MD035": false,
"MD036": false,
"MD037": true,
"MD038": true,
"MD039": false,
"MD040": false,
"MD041": false,
"MD042": false,
"MD043": false,
"MD044": false,
"MD045": false,
"MD046": false,
"MD047": false,
"MD048": false,
"MD049": false,
"MD050": false
}
20 changes: 20 additions & 0 deletions .github/workflows/markdown-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Layotto Env Pipeline 🌊

on:
pull_request:
branches:
- main

jobs:
check:
name: "🍀 Markdown Lint"
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Check markdown grammar in the docs directory
uses: nosborn/[email protected]
with:
files: docs/*
config_file: ".github/markdown_lint_config.json"
16 changes: 8 additions & 8 deletions docs/en/api_reference/appcallback_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This document is automaticallly generated from the [`.proto`](https://github.com

<a name="spec.proto.runtime.v1.AppCallback"></a>

### [gRPC Service] AppCallback
## [gRPC Service] AppCallback
seeflood marked this conversation as resolved.
Show resolved Hide resolved
AppCallback V1 allows user application to interact with runtime.
User application needs to implement AppCallback service if it needs to
receive message from runtime.
Expand All @@ -28,7 +28,7 @@ receive message from runtime.
<a name="spec.proto.runtime.v1.ListTopicSubscriptionsResponse"></a>
<p align="right"><a href="#top">Top</a></p>

### ListTopicSubscriptionsResponse
## ListTopicSubscriptionsResponse
ListTopicSubscriptionsResponse is the message including the list of the subscribing topics.


Expand All @@ -44,7 +44,7 @@ ListTopicSubscriptionsResponse is the message including the list of the subscrib
<a name="spec.proto.runtime.v1.TopicEventRequest"></a>
<p align="right"><a href="#top">Top</a></p>

### TopicEventRequest
## TopicEventRequest
TopicEventRequest message is compatible with CloudEvent spec v1.0
https://github.com/cloudevents/spec/blob/v1.0/spec.md

Expand All @@ -69,7 +69,7 @@ https://github.com/cloudevents/spec/blob/v1.0/spec.md
<a name="spec.proto.runtime.v1.TopicEventRequest.MetadataEntry"></a>
<p align="right"><a href="#top">Top</a></p>

### TopicEventRequest.MetadataEntry
## TopicEventRequest.MetadataEntry



Expand All @@ -86,7 +86,7 @@ https://github.com/cloudevents/spec/blob/v1.0/spec.md
<a name="spec.proto.runtime.v1.TopicEventResponse"></a>
<p align="right"><a href="#top">Top</a></p>

### TopicEventResponse
## TopicEventResponse
TopicEventResponse is response from app on published message


Expand All @@ -102,7 +102,7 @@ TopicEventResponse is response from app on published message
<a name="spec.proto.runtime.v1.TopicSubscription"></a>
<p align="right"><a href="#top">Top</a></p>

### TopicSubscription
## TopicSubscription
TopicSubscription represents topic and metadata.


Expand All @@ -120,7 +120,7 @@ TopicSubscription represents topic and metadata.
<a name="spec.proto.runtime.v1.TopicSubscription.MetadataEntry"></a>
<p align="right"><a href="#top">Top</a></p>

### TopicSubscription.MetadataEntry
## TopicSubscription.MetadataEntry



Expand All @@ -138,7 +138,7 @@ TopicSubscription represents topic and metadata.

<a name="spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus"></a>

### TopicEventResponse.TopicEventResponseStatus
## TopicEventResponse.TopicEventResponseStatus
TopicEventResponseStatus allows apps to have finer control over handling of the message.

| Name | Number | Description |
Expand Down
5 changes: 5 additions & 0 deletions docs/en/api_reference/comment_spec_of_proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

Avoid adding empty lines between comments symbols `//`.If there is a blank line in the comments, the tool(protoc-gen-doc) will generate malformed documents.
bad case:

```
message BadCase{
// XXXXXXXX
Expand All @@ -13,7 +14,9 @@ message BadCase{
field A
}
```

good case:

```
message GoodCase{
// XXXXXXXX
Expand All @@ -22,11 +25,13 @@ message GoodCase{
field A
}
```

Or you can use another annotation symbol directly `/* */`


If you want to have some comment in your proto files, but don't want them to be part of the docs, you can simply prefix the comment with `@exclude`.
Example: include only the comment for the id field

```
/**
* @exclude
Expand Down
5 changes: 5 additions & 0 deletions docs/en/api_reference/how_to_generate_api_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ Note: the commands below should be executed under layotto directory
## How to compile the proto files into `.pb.go` code
<!-- tabs:start -->
### **Make cmmand(recommended)**

```bash
make proto.code
```

This command uses docker to run protoc and generate `.pb.go` code files.

### **Install protoc**
Expand All @@ -20,15 +22,18 @@ This command uses docker to run protoc and generate `.pb.go` code files.
cd spec/proto/runtime/v1
protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=require_unimplemented_servers=false,paths=source_relative *.proto
```

<!-- tabs:end -->
## How to generate API reference doc according to the proto files
We can use [protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) and docker to generate api documents,the command is as follows:

<!-- tabs:start -->
### **Make command(recommended)**

```bash
make proto.doc
```

This command uses docker to run protoc-gen-doc and generate docs.

### **Use docker to run protoc-gen-doc**
Expand Down
Loading