{"id":22941508,"url":"https://github.com/sanda0/json2docs","last_synced_at":"2025-09-12T22:36:20.220Z","repository":{"id":181765892,"uuid":"667263282","full_name":"sanda0/json2docs","owner":"sanda0","description":"package for create excel / pdf /html file using json template","archived":false,"fork":false,"pushed_at":"2023-07-26T13:12:06.000Z","size":20,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-12T21:41:30.139Z","etag":null,"topics":["excel","fileconverter","golang","html","json","pdf"],"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/sanda0.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":"2023-07-17T05:48:17.000Z","updated_at":"2025-03-15T23:21:55.000Z","dependencies_parsed_at":"2024-12-14T13:44:14.850Z","dependency_job_id":"c78b8f71-bef7-4974-8fd1-2139608dc97b","html_url":"https://github.com/sanda0/json2docs","commit_stats":null,"previous_names":["sanda0/json2docs"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/sanda0/json2docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanda0%2Fjson2docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanda0%2Fjson2docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanda0%2Fjson2docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanda0%2Fjson2docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanda0","download_url":"https://codeload.github.com/sanda0/json2docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanda0%2Fjson2docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274887189,"owners_count":25368228,"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","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["excel","fileconverter","golang","html","json","pdf"],"created_at":"2024-12-14T13:44:06.779Z","updated_at":"2025-09-12T22:36:20.186Z","avatar_url":"https://github.com/sanda0.png","language":"Go","funding_links":["https://www.buymeacoffee.com/sandakelum"],"categories":[],"sub_categories":[],"readme":"# json2docs\n\n### install\n\n```\ngo get github.com/sanda0/json2docs\n```\n\n### example\n\n```go\npackage main\n\nimport (\n \"fmt\"\n \"log\"\n\n \"github.com/sanda0/json2docs\"\n)\n\nfunc main() {\n formatJSON := []byte(`{\n  \"Header\": [\n   {\"Line\": 1, \"Text\": \"Abc Company\"},\n   {\"Line\": 2, \"Text\": \"123 Main Street\"},\n   {\"Line\": 3, \"Text\": \"Special report\"},\n   {\"Line\": 4, \"Text\": \"Reporting period January to December 2018\"}\n  ],\n  \"BodyHeader\": [\n   {\"Index\": 1, \"Text\": \"Code\", \"Width\": 10},\n   {\"Index\": 2, \"Text\": \"Name\", \"Width\": 30},\n   {\"Index\": 3, \"Text\": \"Quantity\", \"Width\": 10},\n   {\"Index\": 4, \"Text\": \"Price\", \"Width\": 10},\n   {\"Index\": 5, \"Text\": \"Total\", \"Width\": 10},\n   {\"Index\": 6, \"Text\": \"AVG\", \"Width\": 10}\n  ],\n  \"BodyFields\": [\n   {\"Index\": 1, \"Field\": \"prodId\", \"Width\": 10},\n   {\"Index\": 2, \"Field\": \"description\", \"Width\": 30},\n   {\"Index\": 3, \"Field\": \"qty\", \"Width\": 10},\n   {\"Index\": 4, \"Field\": \"price\", \"Width\": 10},\n   {\"Index\": 5, \"Field\": \"amount\", \"Width\": 10},\n   {\"Index\": 6, \"Field\": \"avg\", \"Width\": 10}\n\n  ],\n  \"Summary\": [\n   {\"Index\": 1, \"Text\": \"\", \"Width\": 10},\n   {\"Index\": 2, \"Text\": \"\", \"Width\": 30},\n   {\"Index\": 3, \"Text\": \"\", \"Width\": 10},\n   {\"Index\": 4, \"Text\": \"\", \"Width\": 10},\n   {\"Index\": 5, \"Text\": \"150.00\", \"Width\": 10},\n   {\"Index\": 6, \"Text\": \"10.00\", \"Width\": 10}\n  ]\n }`)\n\n dataJSON := []byte(`[\n  {\n   \"prodId\": \"1\",\n   \"description\": \"Product 1\",\n   \"qty\": 1,\n   \"price\": 10.00,\n   \"amount\": 10.00,\n   \"avg\": 5.00\n  },\n  {\n   \"prodId\": \"2\",\n   \"description\": \"Product 2\",\n   \"qty\": 1,\n   \"price\": 20.00,\n   \"amount\": 20.00,\n   \"avg\": 5.00\n\n  },\n  {\n   \"prodId\": \"3\",\n   \"description\": \"Product 3\",\n   \"qty\": 1,\n   \"price\": 30.00,\n   \"amount\": 30.00,\n   \"avg\": 5.00\n\n  },\n  {\n   \"prodId\": \"4\",\n   \"description\": \"Product 4\",\n   \"qty\": 1,\n   \"price\": 40.00,\n   \"amount\": 40.00,\n   \"avg\": 5.00\n\n  },\n  {\n   \"prodId\": \"5\",\n   \"description\": \"Product 5\",\n   \"qty\": 1,\n   \"price\": 50.00,\n   \"amount\": 50.00,\n   \"avg\": 5.00\n\n  },\n  {\n   \"prodId\": \"3\",\n   \"description\": \"Product 3\",\n   \"qty\": 1,\n   \"price\": 30.00,\n   \"amount\": 30.00,\n   \"avg\": 5.00\n\n  },\n  {\n   \"prodId\": \"4\",\n   \"description\": \"Product 4\",\n   \"qty\": 1,\n   \"price\": 40.00,\n   \"amount\": 40.00,\n   \"avg\": 5.00\n\n  },\n  {\n   \"prodId\": \"5\",\n   \n   \"qty\": 1,\n   \"price\": 50.00,\n   \"amount\": 50.00,\n   \"description\": \"Product 5\",\n   \"avg\": 5.00\n\n  }\n ]`)\n\n  excelFilename,err := json2docs.ExcelTabularGenerator(formatJSON, dataJSON, \"filename\")\n if err != nil {\n  log.Fatal(err)\n }\n pdfFilename,err := json2docs.PdfTabularGenerator(formatJSON, dataJSON,\"filename\")\n if err != nil {\n  log.Fatal(err)\n }\n htmlFilename,err := json2docs.HtmlTabularGenerator(formatJSON, dataJSON,\"filename\")\n if err != nil {\n  log.Fatal(err)\n }\n fmt.Println(\"Excel file generated:\", excelFilename)\n fmt.Println(\"pdf file generated:\", pdfFilename)\n fmt.Println(\"html file generated:\", htmlFilename)\n\n // /================================================================\n\n}\n```\n\u003ca href=\"https://www.buymeacoffee.com/sandakelum\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanda0%2Fjson2docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanda0%2Fjson2docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanda0%2Fjson2docs/lists"}