By now you probably know that MarkAPL converts Markdown to HTML.
All you need is the class
MarkAPL and the namespace script
Let's assume you have some Markdown:
MyMarkdown←'# MarkAPL' 'All about **_MarkAPL_**'
There are two possible scenarios:
All you need to do is to call the
(html ns)←MarkAPL.Markdown2HTML MyMarkdown 50↑∊html <a id="markapl" class="autoheaderlink"><h1>MarkAPLstrong></p>
Note that not only the HTML but also a namespace
ns is returned which, among other stuff, has a variable
report that might carry warnings and report errors. Ideally
report is empty.
This way of calling
Markdown2HTML relies entirely on defaults. If you are not happy with those you must specify parameters in one of two ways:
MarkAPL.CreateParms), make amendments and pass the namespace via the left argument to
Markdown2HTML. The next topic explains how to do that.
In order to make MarkAPL create a complete HTML page you can either specify
outputFilename or set the
createFullHtmlPage flag to 1:
parms←MarkAPL.CreateParms parms.createFullHtmlPage←1 (html ns)←parms MarkAPL.Markdown2HTML MyMarkdown ⍪4↑html <!DOCTYPE html> <html> <head> <meta charset="utf-8">
outputFilename has the additional benefit of writing the HTML to that file.
In order to make MarkAPL create a complete HTML page you can embed either
createFullHtmlPage into the markdown:
(html ns)←MarkAPL.Markdown2HTML (⊂'[parm]:createFullHtmlPage=1'),MyMarkdown ⍪4↑html <!DOCTYPE html> <html> <head> <meta charset="utf-8">
MarkAPL.Help 0 in order to view the cheat sheet.
MarkAPL.Reference 0 in order to view the comprehensive documentation.
Note that this requires the files Markdown_CheatSheet.html and Markdown.html respectively to be found either in the the current directory or in a folder
Files\ in the current directory.
If those assumptions don't work you must tell
Reference) where to find the file in question:
parms←MarkAPL.CreateHelpParms parms.homeFolder←'C:\WhereMarkdown2HTML_lives' parms MarkAPL.Help 0
The workspace contains not only the two scripts
MarkAPL but also the test suite. To run them execute
For further information regarding the test suite consult the script
#.Tester in the workspace.
Please send comments, suggestions and bug reports to email@example.com.
Kai Jaeger ⋄ APL Team Ltd ⋄ 2016-02-17
Last update: 2018-02-19