This un-encripted 100% Xojo code class with access to the source code, gives Xojo developers the ability to parse Markdown to HTML + CSS instantly! Use the markdown text as the source for the class instance and get the HTML with the CSS styles on the fly, so you get the visually enriched HTML ready to use or for additional purposes in your project, thanks to the flexibility provided by HTML!
You can buy your Markdown Parser License in the AprendeXojo Store using this link.
Markdown parser for Xojo is compatible with 32 and 64 bits deployments for Console, Desktop, Web and RaspberryPi. MacOS, Windows, Linux!
In order to get a instance of the parser, use:
MarkDownParser.getinstance
To parse Markdown text:
MarkDownParser.getinstance.Parse(source as String, compact as Boolean=False) as String
To set the CSS Style of the resulting HTML:
MarkDownParser.getinstance.setCSSStyle(CSSStyles as String)
MarkDownParser for Xojo assigns the blockcode CSS class to the code tag when it applies to a block of code, so you can define different styles to the inline and block code in your CSS styles.
For example, while defining the CSS Style:
code.blockcode {display:block; white-space:pre-wrap;}
Text with inline-style `code`
``` Use three back-ticks to surround a block of code. Like this one. ```
**text** (Two asterisk characters followed by text, with two asterisks at the end)
__text__ (Two underline characters followed by text, with two underlines at the end)
# h1
## h2
### h3
#### h4
##### h5
###### h6
![alt text](http://www.examplelink.com/toImage.png "Image Text")
![alt text](http://www.examplelink.com/toImage.png "Image Text" =number-for-image-size)
*text* (Asterisk character followed by text, and asterisk at the end)
_text_ (Underline character followed by text, and underline at the end)
[Text to be linked inline-style](http://www.examplelink.com)
[Inline-style with Title](http://www.examplelink.com "Title Text")
1. (Use a number to identify the item in an ordered list)
*,-,+ (Unordered lists items can use any of these characters)
> [space] text ("greater than" followed by space and the quoted text)
~~text~~ (Two Tilde characters surrounding the text)
|text|Text|Text| (A pipe character defines columns. Repeat for every row)
|=| Use this character sequence to mark the previous row as the table header