{"id":16096091,"url":"https://github.com/kwkwc/gin-docs","last_synced_at":"2026-05-03T22:32:36.846Z","repository":{"id":239552140,"uuid":"798086663","full_name":"kwkwc/gin-docs","owner":"kwkwc","description":"Adds Docs support to Gin","archived":false,"fork":false,"pushed_at":"2024-05-23T10:38:21.000Z","size":552,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-25T12:32:25.444Z","etag":null,"topics":["api","debugger","documentation","gin","gin-docs","go","markdown"],"latest_commit_sha":null,"homepage":"https://kwkwc.github.io/gin-docs/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kwkwc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-09T04:20:18.000Z","updated_at":"2024-08-12T09:00:17.000Z","dependencies_parsed_at":"2024-05-13T09:33:31.940Z","dependency_job_id":"282a025e-f7cf-41f6-81cd-c37ac338dfae","html_url":"https://github.com/kwkwc/gin-docs","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"2df037e401ca3e50d78053305d24ca4c024160ab"},"previous_names":["kwkwc/gin-docs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kwkwc/gin-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwkwc%2Fgin-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwkwc%2Fgin-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwkwc%2Fgin-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwkwc%2Fgin-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwkwc","download_url":"https://codeload.github.com/kwkwc/gin-docs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwkwc%2Fgin-docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32587818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"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":["api","debugger","documentation","gin","gin-docs","go","markdown"],"created_at":"2024-10-09T17:10:36.114Z","updated_at":"2026-05-03T22:32:36.812Z","avatar_url":"https://github.com/kwkwc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gin-Docs\n\n[![test](https://github.com/kwkwc/gin-docs/actions/workflows/test.yml/badge.svg)](https://github.com/kwkwc/gin-docs/actions/workflows/test.yml)\n[![codecov](https://codecov.io/gh/kwkwc/gin-docs/graph/badge.svg?token=50MGV2JJ0H)](https://codecov.io/gh/kwkwc/gin-docs)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kwkwc/gin-docs)](https://goreportcard.com/report/github.com/kwkwc/gin-docs)\n[![Go Reference](https://pkg.go.dev/badge/github.com/kwkwc/gin-docs.svg)](https://pkg.go.dev/github.com/kwkwc/gin-docs)\n![GitHub release (with filter)](https://img.shields.io/github/v/release/kwkwc/gin-docs)\n![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/kwkwc/gin-docs)\n[![license](https://img.shields.io/github/license/kwkwc/gin-docs)](https://github.com/kwkwc/gin-docs/blob/main/LICENSE)\n\n\u003e Adds Docs support to Gin.\n\nEnglish | [简体中文](README.zh-CN.md)\n\n## Features\n\n- Automatic generation of markdown documentation\n- Support offline markdown document download\n- Support online debugging\n- Support Generate offline document\n  - [x] HTML\n  - [x] Markdown\n\n## Installation\n\n```bash\ngo get -u github.com/kwkwc/gin-docs\n```\n\n## Usage\n\n```go\nimport (\n    \"github.com/gin-gonic/gin\"\n    gd \"github.com/kwkwc/gin-docs\"\n)\n\nr := gin.Default()\nr.POST(\"/api/todo\", AddTodo)\nr.GET(\"/api/todo\", GetTodo)\n\nc := \u0026gd.Config{}\napiDoc := gd.ApiDoc{Ge: r, Conf: c.Default()}\napiDoc.OnlineHtml()\n\nr.Run()\n```\n\n## View the documentation page\n\n```shell\nhttp://127.0.0.1/docs/api/\n```\n\n## Page demo\n\n[Online Demo][online_demo]\n\n## Configuration\n\n```go\ntype Config struct {\n\t// Title, default `API Doc`\n\tTitle string\n\t// Version, default `1.0.0`\n\tVersion string\n\t// Description\n\tDescription string\n\n\t// Custom CDN CSS Template\n\tCdnCssTemplate string\n\t// Custom CDN JS Template\n\tCdnJsTemplate string\n\n\t// Custom url prefix, default `/docs/api`\n\tUrlPrefix string\n\t// No document text, default `No documentation found for this API`\n\tNoDocText string\n\t// Enable document pages, default `true`\n\tEnable bool\n\t// Using CDN, default `false`\n\tCdn bool\n\t// API package name to exclude\n\tExclude []string\n\t// Methods allowed to be displayed, default `[]string{\"GET\", \"POST\", \"PUT\", \"DELETE\", \"PATCH\"}`\n\tMethodsList []string\n\t// SHA256 encrypted authorization password, e.g. here is admin\n\t// echo -n admin | shasum -a 256\n\t// `8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918`\n\tPasswordSha2 string\n\t// Enable markdown processing for all documents, default `true`\n\tAllMd bool\n}\n```\n\n## Tag @@@\n\n```shell\n# Process all documents in markdown by default\n# 1. use the `@@@` wrapper if you want to specify processing\n# 2. Turn off `Config.AllMd` and remove the `@@@` tag if you want to display the original document\n\n@@@\n# Write your markdown document here\n@@@\n```\n\n## API\n\n````go\n/*\nAdd todo\n\n### args\n|  args | required | location | type   |  help    |\n|-------|----------|----------|--------|----------|\n| name  |  true    |  json    | string | todo name |\n| type  |  true    |  json    | string | todo type |\n\n### request\n```json\n{\"name\": \"xx\", \"type\": \"code\"}\n```\n\n### response\n```json\n{\"code\": xxxx, \"msg\": \"xxx\", \"data\": null}\n```\n*/\nfunc AddTodo(c *gin.Context) {\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"todo\": \"post todo\",\n\t})\n}\n````\n\n![sample_app](assets/sample_app_add.png)\n\n````go\n/*\nGet todo\n\n### description\n\u003e Get todo\n\n### args\n|  args | required | location |  type  |  help    |\n|-------|----------|----------|--------|----------|\n|  name |  true    |  query   | string | todo name |\n|  type |  false   |  query   | string | todo type |\n\n### request\n```\nhttp://127.0.0.1:8080/api/todo?name=xxx\u0026type=code\n```\n\n### response\n```json\n{\"code\": xxxx, \"msg\": \"xxx\", \"data\": null}\n```\n*/\nfunc GetTodo(c *gin.Context) {\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"todo\": \"get todo\",\n\t})\n}\n````\n\n![sample_app](assets/sample_app_get_1.png)\n![sample_app](assets/sample_app_get_2.png)\n\n## Debugger\n\n![debugger](assets/debugger.png)\n\n## Authentication\n\n![authentication](assets/authentication.png)\n\n## Generate offline document\n\n```go\nr := gin.Default()\n\nc := \u0026gd.Config{}\napiDoc := gd.ApiDoc{Ge: r, Conf: c.Default()}\n\n// HTML: Generate offline html document at `htmldoc/`\nout := \"htmldoc\"\napiDoc.OfflineHtml(out, true)\n\nr.StaticFile(c.UrlPrefix+\"/\", filepath.Join(out, \"index.html\"))\nr.StaticFile(c.UrlPrefix+\"/data\", filepath.Join(out, \"data\"))\nr.Static(c.UrlPrefix+\"/static\", filepath.Join(out, \"static\"))\n\n// Markdown: Generate the `doc.md` offline markdown document\napiDoc.OfflineMarkdown(\"doc.md\", true)\n```\n\n## Examples\n\n[Complete example][examples]\n\n## Development\n\n```bash\n# Clone code\ngit clone git@github.com:kwkwc/gin-docs.git\n\n# Working directory\ncd gin-docs\n\n# Install dependencies\nmake install\n\n# Run check\nmake check-all\n```\n\n## Transplantation project\n\n[Flask-Docs](https://github.com/kwkwc/flask-docs/)\n\n[examples]: https://github.com/kwkwc/gin-docs/tree/main/examples\n\n[online_demo]: https://kwkwc.github.io/gin-docs-demo/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwkwc%2Fgin-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwkwc%2Fgin-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwkwc%2Fgin-docs/lists"}