{"id":28294280,"url":"https://github.com/leventkaragol/libcpp-html-to-md","last_synced_at":"2026-04-27T11:31:14.777Z","repository":{"id":293754717,"uuid":"871672389","full_name":"leventkaragol/libcpp-html-to-md","owner":"leventkaragol","description":"High performance, easy to use, HTML to Markdown conversion library for C++ (17+)","archived":false,"fork":false,"pushed_at":"2024-10-13T15:07:22.000Z","size":18,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T00:37:35.080Z","etag":null,"topics":["converter","html","html-to-markdown","html-to-markdown-converter","html-to-md","html2markdown","html2md","markdown","md"],"latest_commit_sha":null,"homepage":"","language":"C++","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/leventkaragol.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":"2024-10-12T16:06:11.000Z","updated_at":"2024-10-13T12:21:01.000Z","dependencies_parsed_at":"2025-05-17T00:37:41.465Z","dependency_job_id":"049f66f3-d3a1-4a6c-bb8f-7ddcf1807826","html_url":"https://github.com/leventkaragol/libcpp-html-to-md","commit_stats":null,"previous_names":["leventkaragol/libcpp-html-to-md"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/leventkaragol/libcpp-html-to-md","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-html-to-md","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-html-to-md/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-html-to-md/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-html-to-md/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leventkaragol","download_url":"https://codeload.github.com/leventkaragol/libcpp-html-to-md/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leventkaragol%2Flibcpp-html-to-md/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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","html-to-markdown","html-to-markdown-converter","html-to-md","html2markdown","html2md","markdown","md"],"created_at":"2025-05-22T10:17:10.378Z","updated_at":"2026-04-27T11:31:14.772Z","avatar_url":"https://github.com/leventkaragol.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libcpp-html-to-md\n\nHigh performance, easy to use, HTML to Markdown conversion library for C++ (17+)\n\n[![linux](https://github.com/leventkaragol/libcpp-html-to-md/actions/workflows/linux.yml/badge.svg)](https://github.com/leventkaragol/libcpp-html-to-md/actions/workflows/linux.yml)\n[![windows](https://github.com/leventkaragol/libcpp-html-to-md/actions/workflows/windows.yml/badge.svg)](https://github.com/leventkaragol/libcpp-html-to-md/actions/workflows/windows.yml)\n\n\n\u003e [!TIP]\n\u003e Please read this document before using the library. I know, you don't have time but reading \n\u003e this document will save you time. I mean just this file, it's not long at all. Trial and error \n\u003e will cost you more time.\n\n\n# Table of Contents\n\n* [How to add it to my project](#how-to-add-it-to-my-project)\n* [How to use? (Simplest Form)](#how-to-use-simplest-form)\n* [Semantic Versioning](#semantic-versioning)\n* [Full function list](#full-function-list)\n* [License](#license)\n* [Contact](#contact)\n\n## How to add it to my project?\n\nThis is a header only library. So actually, all you need is to add the libcpp-html-to-md.hpp file\nin src folder to your project and start using it with #include.\n\nBut this library is uses libxml2 under the hood. So, you also need to add libxml2 to\nyour project before to use it.\n\nYou can find usage examples in the examples folder, also find a sample CMakeLists.txt file content below.\n\n```cmake\ncmake_minimum_required(VERSION 3.14)\n\nproject(myProject)\n\nfind_package(libxml2 REQUIRED)\n\nadd_executable(myProject main.cpp libcpp-html-to-md.hpp)\n\ntarget_include_directories(myProject PRIVATE ${LIBXML2_INCLUDE_DIR})\ntarget_link_libraries(myProject PRIVATE ${LIBXML2_LIBRARIES})\n\n```\n\n\u003e [!IMPORTANT]\n\u003e In order to run the library on Windows, the Iconv library is also needed. The CMakeLists.txt file under the examples\n\u003e folder contains the necessary additions to work on both platforms.\n\n\n## How to use? (Simplest Form)\n\nYou can call the **\"convert\"** method of the **\"MarkdownConverter\"** class to convert the HTML content you have  \nas a string variable to Markdown format without any customization.\n\n```cpp\n#include \"libcpp-html-to-md.hpp\"\n\nusing namespace lklibs;\n\nint main() {\n\n    const auto htmlContent = R\"(\n    \u003chtml\u003e\n        \u003chead\u003e\n            \u003ctitle\u003eTest\u003c/title\u003e\n        \u003c/head\u003e\n        \u003cbody\u003e\n            \u003ch1\u003eSimple H1 Header\u003c/h1\u003e\n            \u003cp\u003eSimple Paragraph\u003c/p\u003e\n            \u003ch2\u003eAnother H2 Header\u003c/h2\u003e\n            \u003col\u003e\n                \u003cli\u003eFirst item\u003c/li\u003e\n                \u003cli\u003eSecond item\u003c/li\u003e\n            \u003c/ol\u003e\n\n            \u003ctable\u003e\n                \u003ctr\u003e\n                    \u003ctd\u003eRow 1, Cell 1\u003c/td\u003e\n                    \u003ctd\u003eRow 1, Cell 2\u003c/td\u003e\n                \u003c/tr\u003e\n                \u003ctr\u003e\n                    \u003ctd\u003eRow 2, Cell 1\u003c/td\u003e\n                    \u003ctd\u003eRow 2, Cell 2\u003c/td\u003e\n                \u003c/tr\u003e\n            \u003c/table\u003e\n        \u003c/body\u003e\n    \u003c/html\u003e\n    )\";\n    \n    MarkdownConverter mdConverter(htmlContent);\n\n    const auto markdownContent = mdConverter.convert();\n\n    std::cout \u003c\u003c markdownContent \u003c\u003c std::endl;\n\n    return 0;\n}\n```\n\n## Semantic Versioning\n\nVersioning of the library is done using conventional semantic versioning. Accordingly,\nin the versioning made as **MAJOR.MINOR.PATCH**;\n\n**PATCH:** Includes possible Bug\u0026Fixes and improvements. You definitely want to get this.\n\n**MINOR:** Additional functionality added via backwards compatibility. You probably want to\nget this, it doesn't hurt.\n\n**MAJOR:** Additional functionality that breaks backwards compatibility. You'll need to know\nwhat's changed before you get it, and you'll probably have to make changes to your own code.\nIf I publish something like this, I will definitely add the changes required for migration\nsection to the documentation.\n\n## Full function list\n\nYou can find the complete list of functions in the library below.\n\n\u003e [!TIP]\n\u003e All functions and parameters descriptions are also available within the code as comment for IDEs.\n\n```cpp\nstd::string convert();\n```\n\n## License\n\nMIT License\n\nCopyright (c) 2024 Levent KARAGÖL\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Contact\n\nIf you have problems regarding the library, please open an\n[issue on GitHub](https://github.com/leventkaragol/libcpp-html-to-md/issues/new).\nPlease describe your request, issue, or question in as much detail as possible\nand also include the version of your compiler and operating system, as well as\nthe version of the library you are using. Before opening a new issue, please\nconfirm that the topic is not already exists in closed issues.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleventkaragol%2Flibcpp-html-to-md","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleventkaragol%2Flibcpp-html-to-md","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleventkaragol%2Flibcpp-html-to-md/lists"}