Call Kramdown with Ruby on Android
21 Dec 2017
This is the first blog. The example shows how to use kramdown to convert markdown file to html on android platform.
Normally, jekyll uses kramdown to parse the markdown file. kramdown can convert markdown file to html which is written in pure ruby.
The example shows how to use kramdown to convert markdown file to html.
This example is based on CLE. CLE supports android platform, ruby language, and interaction between ruby and java.
1. Create project and Add the dependent files
- add starcore_android_rX.XX.jar and share libraries
- pack ruby libraries to zip file
In this sample, ruby 2.2 is used.
- pack kramdown-1.16.2 to zip file
- add files to project folder assets
Using the code
1. Unzip the file to app folder
2. Initilize CLE
2. Initilize ruby
3. Set ruby libraries searching path
4. Call kramdown