{"id":29081541,"url":"https://github.com/fuelen/html2text","last_synced_at":"2025-10-11T08:42:39.177Z","repository":{"id":298779449,"uuid":"1001114439","full_name":"fuelen/html2text","owner":"fuelen","description":"HTML to text via Rust NIF","archived":false,"fork":false,"pushed_at":"2025-07-21T08:19:34.000Z","size":27,"stargazers_count":59,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-27T01:41:33.903Z","etag":null,"topics":["converter","html","nif","text"],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/fuelen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2025-06-12T21:04:26.000Z","updated_at":"2025-09-23T11:17:31.000Z","dependencies_parsed_at":"2025-06-12T22:39:12.692Z","dependency_job_id":"1edfc064-37ff-4a36-bdd0-5e1fd2f1c253","html_url":"https://github.com/fuelen/html2text","commit_stats":null,"previous_names":["fuelen/html2text"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fuelen/html2text","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fhtml2text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fhtml2text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fhtml2text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fhtml2text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fuelen","download_url":"https://codeload.github.com/fuelen/html2text/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fuelen%2Fhtml2text/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006638,"owners_count":26084149,"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-10-11T02:00:06.511Z","response_time":55,"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":["converter","html","nif","text"],"created_at":"2025-06-27T19:08:57.307Z","updated_at":"2025-10-11T08:42:39.148Z","avatar_url":"https://github.com/fuelen.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML2Text\n[![Hex.pm](https://img.shields.io/hexpm/v/html2text.svg)](https://hex.pm/packages/html2text)\n\nA high-performance Elixir library for converting HTML documents to plain text format using Rust NIFs (Native Implemented Functions).\n\n## Overview\n\nHTML2Text provides a simple and efficient way to extract readable plain text from HTML content. It leverages the power of Rust's [html2text](https://crates.io/crates/html2text) crate to deliver fast HTML parsing and text extraction while maintaining the logical structure and readability of the content.\n\n## Installation\n\nAdd `html2text` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:html2text, \"~\u003e 0.2\"}\n  ]\nend\n```\n\nThen run:\n\n```bash\nmix deps.get\n```\n\n## Usage\n\n```elixir\n# Convert with specific line width\nhtml = \"\u003ch1\u003eWelcome\u003c/h1\u003e\u003cp\u003eThis is a sample paragraph with some content.\u003c/p\u003e\"\ntext = HTML2Text.convert!(html, width: 30)\nIO.puts(text)\n\n# Output:\n# # Welcome\n#\n# This is a sample paragraph\n# with some content.\n\nhtml = \"\"\"\n\u003carticle\u003e\n  \u003ch1\u003eArticle Title\u003c/h1\u003e\n  \u003cp\u003e\u003cstrong\u003eIntroduction:\u003c/strong\u003e This article covers important topics.\u003c/p\u003e\n\n  \u003ch2\u003eSection 1\u003c/h2\u003e\n  \u003cp\u003eContent with \u003cem\u003eemphasis\u003c/em\u003e and \u003ca href=\"http://example.com\"\u003elinks\u003c/a\u003e.\u003c/p\u003e\n\n  \u003cul\u003e\n    \u003cli\u003ePoint one\u003c/li\u003e\n    \u003cli\u003ePoint two\u003c/li\u003e\n  \u003c/ul\u003e\n\n  \u003ch2\u003eSection 2: Simple Table\u003c/h2\u003e\n  \u003cp\u003eKey metrics overview:\u003c/p\u003e\n\n  \u003ctable border=\"1\" cellpadding=\"6\" cellspacing=\"0\"\u003e\n    \u003cthead\u003e\n      \u003ctr\u003e\n        \u003cth\u003eMetric\u003c/th\u003e\n        \u003cth\u003eValue\u003c/th\u003e\n        \u003cth\u003eChange\u003c/th\u003e\n      \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eUsers\u003c/td\u003e\n        \u003ctd\u003e15,300\u003c/td\u003e\n        \u003ctd\u003e+12%\u003c/td\u003e\n      \u003c/tr\u003e\n      \u003ctr\u003e\n        \u003ctd\u003eSessions\u003c/td\u003e\n        \u003ctd\u003e48,500\u003c/td\u003e\n        \u003ctd\u003e-5%\u003c/td\u003e\n      \u003c/tr\u003e\n    \u003c/tbody\u003e\n  \u003c/table\u003e\n\n  \u003ch2\u003eConclusion\u003c/h2\u003e\n  \u003cp\u003eThis article provided an overview of important web technologies and some key statistics.\u003c/p\u003e\n\u003c/article\u003e\n\"\"\"\n\ntext = HTML2Text.convert!(html)\nIO.puts(text)\n\n# Output:\n# # Article Title\n#\n# **Introduction:** This article covers important topics.\n#\n# ## Section 1\n#\n# Content with *emphasis* and [links][1].\n# * Point one\n# * Point two\n#\n# ## Section 2: Simple Table\n#\n# Key metrics overview:\n#\n# ────────┬──────┬──────\n# Metric  │Value │Change\n# ────────┼──────┼──────\n# Users   │15,300│+12%  \n# ────────┼──────┼──────\n# Sessions│48,500│-5%   \n# ────────┴──────┴──────\n#\n# ## Conclusion\n#\n# This article provided an overview of important web technologies and some key\n# statistics.\n#\n# [1]: http://example.com\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuelen%2Fhtml2text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuelen%2Fhtml2text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuelen%2Fhtml2text/lists"}