{"id":34613849,"url":"https://github.com/x-lambda/protoc-gen-markdown","last_synced_at":"2026-05-25T18:31:57.072Z","repository":{"id":57575933,"uuid":"356444215","full_name":"x-lambda/protoc-gen-markdown","owner":"x-lambda","description":"protoc plugin: generate markdown by pb file","archived":false,"fork":false,"pushed_at":"2022-10-24T09:14:36.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-20T10:06:00.853Z","etag":null,"topics":["protoc","protoc-plugin"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x-lambda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-10T02:08:37.000Z","updated_at":"2022-10-24T09:14:39.000Z","dependencies_parsed_at":"2022-08-29T00:50:44.112Z","dependency_job_id":null,"html_url":"https://github.com/x-lambda/protoc-gen-markdown","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/x-lambda/protoc-gen-markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-lambda%2Fprotoc-gen-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-lambda%2Fprotoc-gen-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-lambda%2Fprotoc-gen-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-lambda%2Fprotoc-gen-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x-lambda","download_url":"https://codeload.github.com/x-lambda/protoc-gen-markdown/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x-lambda%2Fprotoc-gen-markdown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33488771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["protoc","protoc-plugin"],"created_at":"2025-12-24T14:19:37.417Z","updated_at":"2026-05-25T18:31:57.061Z","avatar_url":"https://github.com/x-lambda.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# protoc-gen-markdown\n\n根据`proto`文件生成`markdown`文档\n\u003e 依赖`protoc`，请先安装`protoc3`\n\n\n\n### 安装\n```shell\ngo get -u github.com/x-lambda/protoc-gen-markdown\n```\n\n### 使用\n```shell\nprotoc -I . --markdown_out=filename=foo.md:/tmp/doc_path demo.proto\n```\n\n##### `TODO`\n补充`test case`，手动创建一个`CodeGeneratorRequest`对象，然后使用`proto.Marshal()`序列化成字节对象，\n最后通过`buffer`包装成`io.Reader`，验证输出结果是否和预期一致。\n\n##### 参考\n`CodeGeneratorRequest`对象比较复杂，可以参考已有的文档/项目来理解\n\u003e `github.com/davyxu/pbmeta`\n\n项目将`protoc`传递的`CodeGeneratorRequest`对象输出到文件\n\u003cbr\u003e\n\u003cbr\u003e\n\n***\n\n\u003e `tips`: 重复造了一个轮子的初衷是，现有的`protoc-gen-markdown`作为一个二进制文件，不好集成到其他系统中。\n\u003e 因此，想单独提供一个`package`的方式，可以让其他项目引用。\n\u003e `generator.ReadGenRequest()`可以接受不同的源，例如可以自定义一个合法的`CodeGeneratorRequest`对象，\n\u003e 放到`buffer`中，然后再通过`ReadGenRequest()`和`Generator.Generate()`转成`CodeGeneratorResponse`对象。\n\u003e 这样如果`protoc`也提供`package`的方式，则不需要安装这些二进制，可以直接在系统中集成即可。\n\n\n##### TODO\nmarkdown锚点设置","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-lambda%2Fprotoc-gen-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx-lambda%2Fprotoc-gen-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx-lambda%2Fprotoc-gen-markdown/lists"}