{"id":37188234,"url":"https://github.com/adimyth/go-autodoc","last_synced_at":"2026-01-14T21:53:25.956Z","repository":{"id":131695927,"uuid":"535267900","full_name":"adimyth/go-autodoc","owner":"adimyth","description":"autodoc is a simple document generator. It parses docstrings for any function \u0026 generates markdown document. A playground version of go/doc package","archived":false,"fork":false,"pushed_at":"2022-09-11T12:25:22.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-19T16:16:36.739Z","etag":null,"topics":["documentation-generator","golang"],"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/adimyth.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-11T10:50:49.000Z","updated_at":"2022-09-12T09:16:20.000Z","dependencies_parsed_at":"2023-03-22T15:03:12.773Z","dependency_job_id":null,"html_url":"https://github.com/adimyth/go-autodoc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adimyth/go-autodoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimyth%2Fgo-autodoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimyth%2Fgo-autodoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimyth%2Fgo-autodoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimyth%2Fgo-autodoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adimyth","download_url":"https://codeload.github.com/adimyth/go-autodoc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adimyth%2Fgo-autodoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["documentation-generator","golang"],"created_at":"2026-01-14T21:53:24.451Z","updated_at":"2026-01-14T21:53:25.948Z","avatar_url":"https://github.com/adimyth.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cp align=\"center\"\u003eautodoc - A simple document generator\u003c/p\u003e\n\n`autodoc` is a simple document generator. It parses docstrings for any function \u0026 generates markdown document.\n\n\u003e 👉 This is a very very lean \u0026 playground version of [go/doc](https://pkg.go.dev/go/doc) package.\n\n---\n\n## ❓ What is it?\n\n`autodoc` parses the docstrings for all functions in a given source code \u0026 generates markdown representation for them.\n\n\u003e **Note**\n\u003e We are following the Numpy DocString Format.\n\nTo understand, how to write function docstrings following the **_numpy docstring format_** - checkout [this excellent guide](https://developer.lsst.io/python/numpydoc.html)\n\n## 🚀 Demo\n\nClone the repo \u0026 run the `main` script. \n```bash\ngo run main.go\n```\n\nIt will loop through all the files in `src` directory \u0026 generate a markdown file for each source file \u0026 store it in the `docs` directory.\n\nIn the repo, I have added 2 source files. Executing the `main` script, creates 2 new files in `docs` directory.\n\n```bash\n.\n├── docs\n│   ├── fibonacci.md\n│   └── square_root.md\n└── src\n    ├── fibonacci.go\n    └── square_root.go\n```\n\nCheckout the generated docs\n\n## 🤔 How?\n\nThe `autodoc` exports a `DocGenerator` method that takes in a filepath \u0026 generates a markdown of the same name in docs file. It does this by -\n\n1. Reads the source file\n2. Generates the Abstract Syntax Tree for the source code using the excellent `go/parser` package\n3. Traverses the tree to find function nodes. `go/ast` stores them as [FuncDecl](https://pkg.go.dev/go/ast#FuncDecl) nodes. It relies on `go/ast` to inspect the tree\n4. Reads the docstring assosciated with it \u0026 the function name\n5. Formats it into a markdown representation\n6. Writes it to a file inside `docs`\n\nThe `main` script recursively loops over all the files in `src` directory \u0026 applies all the previous step to each file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadimyth%2Fgo-autodoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadimyth%2Fgo-autodoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadimyth%2Fgo-autodoc/lists"}