Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a lightweight markup language library for Android exist?

Suppose I want to render/present a text transmitted in the form of some lightweight markup language. Are there any ready-to-use libraries for Android, which take as input text in a lightweight markup language and present it nicely? When I say lightweight markup language, I mean Markdown (http://en.wikipedia.org/wiki/Markdown) or something similar.

like image 423
Karen Tamrazyan Avatar asked Nov 29 '10 23:11

Karen Tamrazyan


3 Answers

There's also AndDown, an Android wrapper around the C-based parser sundown:

By using the NDK with this C library, parsing speeds are nice and fast -- 5K of input can be converted into HTML in about 1 millisecond. Also, sundown is a fairly popular Markdown processor and is the brains behind GitHub-flavored Markdown.

like image 82
miek Avatar answered Sep 21 '22 02:09

miek


You can look at:

MarkdownJ

I haven't tried this.

JMD

This works, but the latest build has issues with some numbers in the text being interpreted as entities; e.g. "The 39th President" becomes "The &39;th President".

PegDown

This works properly, but in the rather old 0.8.0.1 version I am currently using it's really surprisingly CPU intensive(*) - much more so that JMD. It's dependent on the separate parboiled PEG parser (which also has a newer version than I am currently using). (Stricken based on comment below)

(*) The excessive CPU load seems to only occur on the IBM Classic JVM for the AS/400.


NOTE: I have used these only on Java VMs, not on Android, but I know of no reason why any or all of them should not work on Android.

like image 25
Lawrence Dol Avatar answered Sep 22 '22 02:09

Lawrence Dol


You can also check markdown4j, which is a lightweight java library (and can be used in Android).

like image 25
Plato Avatar answered Sep 22 '22 02:09

Plato