{"id":43589469,"url":"https://github.com/sivukhin/godjot","last_synced_at":"2026-02-04T01:50:03.546Z","repository":{"id":205469370,"uuid":"714313026","full_name":"sivukhin/godjot","owner":"sivukhin","description":"Djot parser written in Go","archived":false,"fork":false,"pushed_at":"2025-06-12T19:26:26.000Z","size":172,"stargazers_count":39,"open_issues_count":9,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-25T11:52:43.093Z","etag":null,"topics":["djot","golang","markup","parser"],"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/sivukhin.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,"zenodo":null}},"created_at":"2023-11-04T14:44:26.000Z","updated_at":"2025-08-21T19:26:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b2116bd-f232-4db6-878d-a15d950435c8","html_url":"https://github.com/sivukhin/godjot","commit_stats":null,"previous_names":["sivukhin/godjot"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/sivukhin/godjot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivukhin%2Fgodjot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivukhin%2Fgodjot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivukhin%2Fgodjot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivukhin%2Fgodjot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sivukhin","download_url":"https://codeload.github.com/sivukhin/godjot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sivukhin%2Fgodjot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29064025,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T00:26:14.114Z","status":"ssl_error","status_checked_at":"2026-02-04T00:23:06.435Z","response_time":96,"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":["djot","golang","markup","parser"],"created_at":"2026-02-04T01:50:02.907Z","updated_at":"2026-02-04T01:50:03.515Z","avatar_url":"https://github.com/sivukhin.png","language":"Go","funding_links":[],"categories":["Parsers \u0026 Libraries"],"sub_categories":["Go"],"readme":"## godjot\n\n[![Go Report Card][go-report-image]][go-report-url]\n![Go Version][go-build-badge]\n\n[go-report-image]: https://goreportcard.com/badge/github.com/sivukhin/godjot\n[go-report-url]: https://goreportcard.com/report/github.com/sivukhin/godjot\n[go-build-badge]: https://img.shields.io/github/v/tag/sivukhin/godjot?label=version\u0026sort=semver\n\n[Djot](https://github.com/jgm/djot) markup language parser implemented in Go language\n\n### Installation\n\nYou can install **godjot** as a standalone binary:\n```shell\n$\u003e go install github.com/sivukhin/godjot/v2@latest\n$\u003e echo '*Hello*, _world_' | godjot\n\u003cp\u003e\u003cstrong\u003eHello\u003c/strong\u003e, \u003cem\u003eworld\u003c/em\u003e\u003c/p\u003e\n```\n\n### Usage\n\n**godjot** provides API to parse AST from djot string \n``` go\nvar djot []byte\nast := djot_parser.BuildDjotAst(djot)\n```\n\nAST is loosely typed and described with following simple struct:\n```go\ntype TreeNode[T ~int] struct {\n    Type       T                     // one of DjotNode options\n    Attributes tokenizer.Attributes  // string attributes of node\n    Children   []TreeNode[T]         // list of child\n    Text       []byte                // not nil only for TextNode\n}\n```\n\nYou can transform AST to HTML with predefined set of rules:\n```go\ncontent := djot_html.New().ConvertDjot(\u0026djot_html.HtmlWriter{}, ast...).String()\n```\n\nOr, you can override some default conversion rules:\n```go\ncontent := djot_html.New(\n    djot_html.DefaultConversionRegistry,\n    map[djot_parser.DjotNode]djot_parser.Conversion[*djot_html.HtmlWriter]{\n        djot_parser.ImageNode: func(state djot_parser.ConversionState[*djot_html.HtmlWriter], next func(c djot_parser.Children)) {\n            state.Writer.\n                OpenTag(\"figure\").\n                OpenTag(\"img\", state.Node.Attributes.Entries()...).\n                OpenTag(\"figcaption\").\n                WriteString(state.Node.Attributes.Get(djot_parser.ImgAltKey)).\n                CloseTag(\"figcaption\").\n                CloseTag(\"figure\")\n        },\n    }\n).ConvertDjot(\u0026djot_html.HtmlWriter{}, ast...).String()\n```\n\nThis implementation passes all examples provided in the [spec](https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/syntax.html) but can diverge from original javascript implementation in some cases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivukhin%2Fgodjot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsivukhin%2Fgodjot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsivukhin%2Fgodjot/lists"}