{"id":17150987,"url":"https://github.com/simonrichardson/betwixt","last_synced_at":"2025-03-24T12:22:32.578Z","repository":{"id":65695757,"uuid":"94077825","full_name":"SimonRichardson/betwixt","owner":"SimonRichardson","description":"Documenting endpoints via testing...","archived":false,"fork":false,"pushed_at":"2018-02-01T16:23:16.000Z","size":19,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T17:30:29.646Z","etag":null,"topics":["documentation","markdown","meshuggah","plaintext","testing"],"latest_commit_sha":null,"homepage":"","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/SimonRichardson.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}},"created_at":"2017-06-12T09:19:35.000Z","updated_at":"2017-06-12T10:21:14.000Z","dependencies_parsed_at":"2023-02-05T00:35:16.866Z","dependency_job_id":null,"html_url":"https://github.com/SimonRichardson/betwixt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonRichardson%2Fbetwixt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonRichardson%2Fbetwixt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonRichardson%2Fbetwixt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonRichardson%2Fbetwixt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonRichardson","download_url":"https://codeload.github.com/SimonRichardson/betwixt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245267653,"owners_count":20587476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","markdown","meshuggah","plaintext","testing"],"created_at":"2024-10-14T21:37:00.493Z","updated_at":"2025-03-24T12:22:32.549Z","avatar_url":"https://github.com/SimonRichardson.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# betwixt\n\nBetwixt is a documentation tool to help API integration with external sources,\nwhilst development is ongoing. By placing the betwixt middleware between serving\nAPI and clients it's possible to use integration API tests to output up to date\ndocumentation for all.\n\nThis middleware is not router aligned so it integrates best with the standard\nlibrary, otherwise adapters can be created for usage with external routers.\n\n## Output\n\nBetwixt comes with three output formats; plaintext, markdown and Apiary\nflavoured markdown. Alternative outputs can be easily added if required (json,\nxml etc).\n\n### Plaintext\n\nTo create plaintext output middleware:\n\n```go\nhandler := http.DefaultServeMux\nhandler.HandleFunc(\"/hello\", func(w http.ResponseWriter, r *http.Request) {\n    w.Header().Set(\"content-type\", \"application/json\")\n    bytes, _ := json.Marshal(map[string]string{\n        \"hello\": \"world\",\n    })\n    w.WriteHeader(http.StatusOK)\n    w.Write(bytes)\n})\n\nvar buffer bytes.Buffer\noutputs := []betwixt.Output{\n    output.NewPlaintext(output.MakeWriter(\u0026buffer)),\n}\ncapture := betwixt.New(handler, outputs)\nserver  := httptest.NewServer(capture)\n\n...\n\nif err := capture.Output(); err != nil {\n    log.Fatal(err)\n}\n\nfmt.Println(buffer.String())\n```\n\nExample output for plaintext:\n\n```\n Output:\n GET 200 - /hello\n - Parameters:\n  ・ possible 2 (optional)\n  ・ random   2 (optional)\n - Request Headers:\n  ・ Accept-Encoding gzip\n  ・ User-Agent      Go-http-client/1.1\n  ・ Header          Value (optional)\n - Response Headers:\n  ・ Content-Type application/json\n - Response Body:\n\n   {\"hello\":\"world\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonrichardson%2Fbetwixt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonrichardson%2Fbetwixt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonrichardson%2Fbetwixt/lists"}