Does a lightweight markup language library for Android exist?
Asked Answered
I

3

8

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.

Interknit answered 29/11, 2010 at 23:53 Comment(0)
C
3

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.

Croaky answered 30/11, 2010 at 0:13 Comment(1)
Actually, PegDown will not work -- I just tried it. It attempts to generate classes on the fly, which will not work without a Dalvik-specific implementation.Arabian
T
8

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.

Tera answered 20/2, 2012 at 9:29 Comment(0)
C
3

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.

Croaky answered 30/11, 2010 at 0:13 Comment(1)
Actually, PegDown will not work -- I just tried it. It attempts to generate classes on the fly, which will not work without a Dalvik-specific implementation.Arabian
B
1

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

Broderick answered 20/5, 2014 at 0:7 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.