Notes: start reading at Hi :( AppDir = dirname(input_files()[1])..[[\]] os.execute(AppDir.."MultiMarkdown.exe --help > "..AppDir.."mmd.txt") os.execute(AppDir.."Upp.exe -h > "..AppDir.."upp.txt") ) $(tostring([[
]]) ) Hi, This is my attempt to pipe a simple text format through some small executables and make a formatted document. I am using Windows^TM^ but I think the same / similar tools can be found for MacOS and Linux. So far the requirements are limited to: * [Upp.exe](http://christophe.delord.free.fr/upp/) Pre-processor using Lua * [MultiMarkdown.exe](https://fletcher.github.io/MultiMarkdown-6/) Markdown with extras * [Highlight.js](https://highlightjs.org/) Syntax highlighting from the Web * [Shellexec.exe](http://www.naughter.com/shelexec.html) Windows command line launcher * Windows batch file ```batch REM Batch file to run hybrid (upp/mmd) files upp.exe -p . %1 | Multimarkdown.exe -s > %~n1.html shellexec.exe %~n1.html end ``` The aim is to be as ruthless as possible with the simplicity of the source format, while still providing significant additional functionality: * Linked CSS/JS files for further embellishments * Arbitrary calculations in Lua * HTML elements returned from Lua functions * Automated footnotes from saved citations Issues: * Multimarkdown tranclusion does not work for streamed input [Issue#181](https://github.com/fletcher/MultiMarkdown-6/issues/181). Thankfully Upp has an `include()` function. Examples: * Linked CSS/JS (this needs to be at the very top of the file) * MultiMarkdown will find a single CSS file using [metadata](https://fletcher.github.io/MultiMarkdown-6/syntax/metadata.html#css) * Alternatively this can be done with Lua by writing a whole head section. This example stops caching and adds syntax highlighting of code fragments: $\( ```html ]]) ``` ) * Calculations using Lua * The $\() syntax is used to insert text or variables $\(`math.pi`) = $(math.pi) * The :\() syntax is used to add Lua code :\( ```lua function Vsphere(radius) return (4/3)*(math.pi)*(radius^3) end ``` ) :( function Vsphere(radius) return (4/3)*(math.pi)*(radius^3) end function Rsphere(volume) return ((volume*(3/4))/(math.pi))^(1/3) end x = Rsphere(100) ) $\(Vsphere($(x))) = $((Vsphere(x))) * HTML examples as Lua functions * Button :\( ```lua function button_nav(url) local button = [[ ]] return button:gsub("$url",url) end ``` ) :( function button_nav(url) local button = [[ ]] return button:gsub("$url",url) end ) $\(button_nav("page2.html")) = $(button_nav("page2.html")) Helpful Documents: * Upp.exe command line options ```text $(include(AppDir.."upp.txt")) ``` * MultiMarkdown.exe command line options ```text $(include(AppDir.."mmd.txt")) ```