# jHTML2Md **Repository Path**: mirrors/jHTML2Md ## Basic Information - **Project Name**: jHTML2Md - **Description**: jHTML2Md 是一个用来实现 HTML 转 Markdown 的 Java 库 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: https://www.oschina.net/p/jhtml2md - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 2 - **Created**: 2018-03-03 - **Last Updated**: 2025-08-09 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # jHTML2Md A simple converter from HTML to Markdown in Java. I created this project for importing notes on Capsa Notes. Currently it hasn't any options. I plan to add different markdown styles (Headers using # instead of underline =, for example). ## How to use it: It's pretty simple, first add jSoup to the classpath. Then: String markdownText = HTML2Md.convert(html, baseURL); Where html is a String containing the html code you want to convert, and baseURL is the url you will use as a reference for converting relative links. You can use directly an URL too, like this: URL url = new URL("http://www.example.com/"); HTML2Md.convert(url, 30000); The 30000 is the timeout for requesting the page in milliseconds. Enjoy! # RoadMap * Add options for different markdown styles * Jekyll & Hexo markdown styles has already been added, to use them, simply invoke HTML2Md.htmlToJekyllMd(htmlPath, mdPath, charset); HTML2Md.htmlToHexoMd(htmlPath, mdPath, charset); * Some refactoring, currently the code is quite ugly