John Kouraklis 94 Posted December 22, 2022 (edited) Hi people, I need to convert markdown text to HTML and vice versa. I tried to find a component or some code but was unable to locate any. There is a number of online converters and I was hoping they had API available but, again, I haven't found anything. So, what would help are 1. Delphi component---ideally FMX but on Windows is just fine for now 2. Cloud service with API (free mostly) 3. EXE files that I could run from within my app Does anyone have any suggestions? Thanks. Edited December 23, 2022 by John Kouraklis Share this post Link to post
programmerdelphi2k 237 Posted December 23, 2022 did you know? (I dont use it) https://convertio.co/document-converter/ https://developers.convertio.co/ Share this post Link to post
John Kouraklis 94 Posted December 23, 2022 Hi, yes. I've seen this. I don't think it supports .md files and it is not free. Share this post Link to post
Fred Ahrens 59 Posted December 23, 2022 If you want to convert .md files, you are looking for a "Markdown" converter - not "Markup". The source code at https://github.com/grahamegrieve/delphi-markdown might be exactly what you are looking for. Share this post Link to post
Alexander Sviridenkov 357 Posted December 23, 2022 Your HCL version has MD to HTML converter in htmarkdown unit, please use MD := TMDParser.Create(..); s := MD.Render; There is also THtMardown panel which displays MD placed to HTML property. IDE from version 11.2 uses this component for MD files and code hints. Share this post Link to post
John Kouraklis 94 Posted December 23, 2022 8 hours ago, Fred Ahrens said: If you want to convert .md files, you are looking for a "Markdown" converter - not "Markup". The source code at https://github.com/grahamegrieve/delphi-markdown might be exactly what you are looking for. Yes, that's right. I corrected the post. Thanks I will have a look at the link. Share this post Link to post
John Kouraklis 94 Posted December 23, 2022 4 hours ago, Alexander Sviridenkov said: Your HCL version has MD to HTML converter in htmarkdown unit, please use MD := TMDParser.Create(..); s := MD.Render; There is also THtMardown panel which displays MD placed to HTML property. IDE from version 11.2 uses this component for MD files and code hints. Ah, thanks Alex. I will check. Do you also have a converter from HTML to MD? Share this post Link to post
Alexander Sviridenkov 357 Posted December 23, 2022 17 minutes ago, John Kouraklis said: Ah, thanks Alex. I will check. Do you also have a converter from HTML to MD? No, it general case this is not possible, only for very limited set of tags,. Share this post Link to post
Fred Ahrens 59 Posted December 23, 2022 For HTML to MD conversion (and from/to other formats) have a look at https://pandoc.org/ Share this post Link to post
Carlo Barazzetta 116 Posted May 28, 2023 Here you can see a full project to convert MarkDown to HTML (but not the inverse process): https://github.com/EtheaDev/MarkdownShellExtensions 1 Share this post Link to post