{"id":13878199,"url":"https://github.com/conversation/upmark","last_synced_at":"2025-07-16T14:31:35.237Z","repository":{"id":1698092,"uuid":"2426626","full_name":"conversation/upmark","owner":"conversation","description":"A HTML to Markdown converter.","archived":false,"fork":false,"pushed_at":"2024-04-21T22:53:16.000Z","size":117,"stargazers_count":29,"open_issues_count":2,"forks_count":6,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-10-31T14:29:11.767Z","etag":null,"topics":["converter","html","markdown","peg","ruby"],"latest_commit_sha":null,"homepage":"Upmark has the skills to convert your HTML to Markdown.","language":"Ruby","has_issues":false,"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/conversation.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2011-09-21T01:09:29.000Z","updated_at":"2024-09-05T06:16:23.000Z","dependencies_parsed_at":"2024-04-21T23:46:56.816Z","dependency_job_id":"c2669109-0ec0-433d-97df-7269684abfa2","html_url":"https://github.com/conversation/upmark","commit_stats":{"total_commits":118,"total_committers":9,"mean_commits":13.11111111111111,"dds":0.5508474576271186,"last_synced_commit":"b11bd6222a5167ef7fd75f3f48909257e93e8840"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversation%2Fupmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversation%2Fupmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversation%2Fupmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/conversation%2Fupmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/conversation","download_url":"https://codeload.github.com/conversation/upmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226138849,"owners_count":17579496,"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":["converter","html","markdown","peg","ruby"],"created_at":"2024-08-06T08:01:42.514Z","updated_at":"2024-11-24T07:30:50.486Z","avatar_url":"https://github.com/conversation.png","language":"Ruby","readme":"# Upmark\n\nA HTML to Markdown converter.\n\n## Installation\n\n    \u003e gem install upmark\n\n## Usage\n\nIn ruby:\n\n```ruby\nrequire \"upmark\"\nhtml = \"\u003cp\u003emessenger \u003cstrong\u003ebag\u003c/strong\u003e skateboard\u003c/p\u003e\"\nmarkdown = Upmark.convert(html)\nputs markdown\n```\n\nFrom the command-line:\n\n    \u003e upmark foo.html\n\nYou can also pipe poorly formatted HTML documents through `tidy` before piping them into `upmark`:\n\n    \u003e cat bar.html | tidy -asxhtml -indent -quiet --show-errors 0 --show-warnings 0 --show-body-only 1 --wrap 0 | upmark\n\n## Features\n\nUpmark will convert the following (arbitrarily nested) HTML elements to Markdown:\n\n* `strong`\n* `em`\n* `p`\n* `a`\n* `h1`, `h2`, `h3`, `h4`, `h5`, `h6`\n* `ul`\n* `ol`\n* `br`\n\nIt will also pass through block and span-level HTML elements (e.g. `table`, `div`, `span`, etc) which aren't used by Markdown.\n\n## How it works\n\nUpmark defines a parsing expression grammar (PEG) using the very awesome [Parslet](https://github.com/kschiess/parslet/) gem. This PEG is then used to convert HTML into Markdown in 4 steps:\n\n1. Parse the XHTML into an abstract syntax tree (AST).\n2. Normalize the AST into a nested hash of HTML elements.\n3. Mark the block and span-level subtrees which should be ignored (`table`, `div`, `span`, etc).\n4. Convert the AST leaves into Markdown.\n","funding_links":[],"categories":["Ruby","Convert to Markdown Tools"],"sub_categories":["Hypertext Markup Language (HTML) to Markdown"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconversation%2Fupmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconversation%2Fupmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconversation%2Fupmark/lists"}