{"id":17703798,"url":"https://github.com/zudov/haskell-comark","last_synced_at":"2025-03-13T07:32:08.854Z","repository":{"id":68795602,"uuid":"64046257","full_name":"zudov/haskell-comark","owner":"zudov","description":"CommonMark parser/renderer in pure Haskell.","archived":false,"fork":false,"pushed_at":"2018-03-06T23:23:20.000Z","size":5579,"stargazers_count":8,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T19:07:08.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","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/zudov.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":"2016-07-24T03:09:16.000Z","updated_at":"2023-09-04T21:37:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"fa2bc5cf-9645-4d82-b282-e9b4a23221fa","html_url":"https://github.com/zudov/haskell-comark","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zudov%2Fhaskell-comark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zudov%2Fhaskell-comark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zudov%2Fhaskell-comark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zudov%2Fhaskell-comark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zudov","download_url":"https://codeload.github.com/zudov/haskell-comark/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243361382,"owners_count":20278559,"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":[],"created_at":"2024-10-24T21:05:59.096Z","updated_at":"2025-03-13T07:32:08.848Z","avatar_url":"https://github.com/zudov.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# haskell-comark\n\n[![Build Status](https://travis-ci.org/zudov/haskell-comark.svg?branch=master)](https://travis-ci.org/zudov/haskell-comark)\n\n[![comark on Hackage](https://img.shields.io/hackage/v/comark.svg)](http://hackage.haskell.org/package/comark)\n\n[![comark on Stackage LTS 2](http://stackage.org/package/comark/badge/lts-2)](http://stackage.org/lts-2/package/comark)\n[![comark on Stackage LTS 3](http://stackage.org/package/comark/badge/lts-3)](http://stackage.org/lts-3/package/comark)\n[![comark on Stackage Nightly](http://stackage.org/package/comark/badge/nightly)](http://stackage.org/nightly/package/comark)\n\nThe functionality is split across several libraries which are contained in this\nrepo:\n\n- **comark**           -- reexports other libraries\n- **comark-syntax**    -- definition of Commonmark's AST;\n- **comark-parser**    -- parsing commonmark text and producing AST\n- **comark-html**      -- rendering commonmark's AST into HTML\n- **comark-testutils** -- utilities for testing these packages.\n\n# Usage\n\nThe easiest way to get it running is to use [stack](https://haskellstack.org). For instructions see [Downloading and Installation][stack-installation].\n\n[stack]: https://haskellstack.org \"The Haskell Tool Stack\"\n[stack-installation]: https://docs.haskellstack.org/en/stable/GUIDE/#downloading-and-installation \"Stack: Downloading and Instalation\"\n\n## Executable\n\nExecutable version lets you play with and test comark easily.\nTo get the executable try doing `stack install comark`.\n\n```shell\n$ comark-hs --help\nUsage:    comark-hs [OPTIONS*] [FILE*]\nOptions:\n  --to, -t FORMAT  Specify output format (html, native)\n  --normalize      Consolidate adjacent text nodes\n  --help, -h       Print usage information\n\n$ echo \"# Hello, Markdown\" | comark-hs\n\u003ch1\u003eHello, Markdown\u003c/h1\u003e\n$ comark-hs --normalize README.md \u003e README.html\n$ comark-hs --to native README.md \u003e README.hs\n```\n## Library\n\nInitially adding `comark` dependency should be enough.\nFor more granular imports you might want to add some of the libraries listed above.\n\nTo learn how the dependency can be added see [Adding dependencies][stack-dependencies].\n\n[stack-dependencies]: https://docs.haskellstack.org/en/stable/GUIDE/#adding-dependencies \"Stack: Adding dependencies\"\n\n```haskell\nimport           Data.Text (Text)\nimport qualified Comark\n\nmarkdownToHtml :: Text -\u003e Text\nmarkdownToHtml =\n  Comark.render . Comark.parse [ Comark.Normalize ]\n```\n\nYou can find examples of more complex transformations in [comark-examples](./comark-examples).\nAnd make sure to checkout the docs.\n\n# TODO\n\n- [X] Working parser implementation, pass all tests\n- [X] Fast and accurate renderer, renders things exactly as in spec.txt.\n- [X] Make full use of spec examples.\n\t  Both renderer and parser are separately tested against the spec relying only on it\n\t  and the reference implementation (libcmark).\n- [X] Handle pathological inputs. Benchmarks are run against `markdown-it`'s samples\n\t  and over notoriously known nested parenthesis/brackets (`\"[\" * 50000 + \"foo\" + \"]\" * 50000`)\n- [X] Revise module structure, names, and (re-)exports.\n- [ ] Add to hackage and stackage.\n- [X] Document things up.\n- [ ] Extend ecosystem with additional libraries that ease the integration\n\t  (comark-blaze, comark-lucid, comark-json)\n- [ ] Add helpers for processing/walking the AST and examples of typical manipulations.\n- [ ] Work on extensibility.\n- [ ] Compile with ghcjs. If performance/size isn't great, consider making bindings to\n\t  `commonmark.js` but provide `comark-syntax` based interface.\n\n# License\n\nThis library is released under BSD-3-Clause license. See LICENSE for terms and copyright notice.\n\nCustom parser combinators and block structure parser are largely based on the ones found\nin [Cheapskate](https://github.com/jgm/cheapskate) (Copyright © 2012, 2013, 2014 John MacFarlane).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzudov%2Fhaskell-comark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzudov%2Fhaskell-comark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzudov%2Fhaskell-comark/lists"}