markdown to html anyone? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

markdown to html anyone?

22 Oct 2018, 10:36

Has anyone written a script to convert markdown to html?
I.e. so I can open md files via AutoHotkey. Thanks.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: markdown to html anyone?

23 Oct 2018, 15:06

Thanks a lot tmplinshi.

Code: Select all

;note: for Markdown2HTML.ahk
;replace this:
;if StrStartsWith(tline, ";")
;with this:
;if (SubStr(tline, 1, 1) = ";")

;[Markdown2HTML function]
;GitHub - fincs/GenDocs: AutoHotkey documentation generator
;https://github.com/fincs/GenDocs

;[example md files]
;GitHub - Lexikos/Object.ahk: This library for AutoHotkey v2-alpha tests some ideas for potential changes to how objects work.
;https://github.com/Lexikos/Object.ahk

q:: ;convert md file to htm file
vPath := A_Desktop "\Object.ahk-master\readme.md"
FileRead, vText, % vPath
vHtml := Markdown2HTML(vText)
SplitPath, vPath, vName, vDir, vExt, vNameNoExt, vDrive
vPath2 := vDir "\" vNameNoExt ".htm"
if !FileExist(vPath2)
	FileAppend, % vHtml, % "*" vPath2
Run, % vPath2
return

#Include %A_Desktop%\GenDocs-master\Lib\Markdown2HTML.ahk
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, GollyJer, Google [Bot], Lamron750 and 258 guests