Markdown is a lightweight markup language.
Originally created by John Gruber and Aaron Swartz, Markdown allows people "to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML or HTML. It is used to make the sources of static web pages more human readable, and it is also more pleasant to write in than HTML. It has been used as a wiki formatting language, for example at StackOverflow .
anoved - 2012-12-20 19:22:24
A variant of Markdown is heavily used at GitHub, a git repository host, for formatting Readmes, issues, and other comments. https://help.github.com/articles/github-flavored-markdown/
HJG 2013-09-22 - Another variant of Markdown: http://txt2tags.org/ . It uses python, and supports output to HTML, XHTML, SGML, DocBook, LaTeX, Lout, Man page, Creole, Wikipedia/MediaWiki, Google Code Wiki, PmWiki, DokuWiki, MoinMoin, MagicPoint, PageMaker, AsciiDoc, ASCII Art, Plain text.
JOB - 2016-06-15 17:21:53
Utility script to convert all markup files in the current directory:
Prerequisites:
package require Tk catch {console show} # convert to html using markdown set dir [file dirname [info script]] set mdcmd [file join $dir "util/Markdown.pl"] set pattern "*.text" set ext ".html" # fix the directory name (required for glob under windows) ... set basedir [string trimright [file join [file normalize $dir] { }]] # execute markdown... foreach f [glob -nocomplain -type {f r} -path $basedir $pattern] { # change file extension: set htmlfile [file rootname $f] append htmlfile $ext # puts "exec perl $mdcmd --html4tags $f > $htmlfile" eval exec perl $mdcmd --html4tags $f > $htmlfile & } # e.g. loading the browser... set current_file [file join $dir "testfile.html"] set command [list {*}[auto_execok start] {}] exec {*}$command chrome $current_file & puts "Done" exit 0
The above script can be replaced by the following - a pure tcl markdown implementation available in tcllib as already described further up:
package require Tk catch {console show} # convert to html using markdown set dir [file dirname [info script]] lappend auto_path [file join $dir "lib"] package require textutil package require Markdown set pattern "*.text" set ext ".html" # fix the directory name (required for glob under windows) ... set basedir [string trimright [file join [file normalize $dir] { }]] # execute markdown... foreach f [glob -nocomplain -type {f r} -path $basedir $pattern] { # change file extension: set htmlfile [file rootname $f] append htmlfile $ext # slurp up the data file set fp [open $f "r"] set markup [read $fp] close $fp set fp [open $htmlfile "w"] puts -nonewline $fp [Markdown::convert $markup] close $fp } puts "Done" if {1} { set current_file [file join $dir "testfile.html"] set command [list {*}[auto_execok start] {}] exec {*}$command chrome $current_file & exit 0 }
JOB - 2016-10-12 21:29:28 See also: Markdown2Go