##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: November 2016 # Modified: 2016-11-11/17:55-0500 ##+ # # soldout.icn, a loadable Markdown to HTML demonstration # # tectonics: # gcc -o soldout.so -shared -fpic soldout.c -lsoldout # link base64 # any arguments will trigger firefox with the HTML output procedure main(argv) markdown := "_ Unicon and libsoldout\n_ =====================\n_ \n_ ## Header 2\n_ ### Header 3\n_ - list item\n\n_ a link: \n\n_ `some code`\n\n_ and soldout extensions: ++insert++ --delete--" write(markdown) # load up the soldout library function soldout := loadfunc("./soldout.so", "soldout") # convert the Markdown and show the HTML markup := soldout(markdown) write("\n---HTML markup follows---\n") write(markup) # base64 encode the result and pass through a data url for browsing if \argv[1] then system("firefox \"data:text/html;base64, " || base64encode(markup) || "\" &") end