/MarkdownView

Android library to display markdown text.

Primary LanguageJavaApache License 2.0Apache-2.0

MarkdownView

Android library to display markdown text.

It uses Flexmark and some of its extensions.

Setup

Add it in your root build.gradle at the end of repositories:

allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add the dependency:

compile 'com.github.tiagohm:MarkdownView:library:LATEST-VERSION'

LATEST-VERSION is

Usage

<br.tiagohm.markdownview.MarkdownView
 android:id="@+id/markdown_view"
 app:escapeHtml="false"
 android:layout_width="match_parent"
 android:layout_height="match_parent"/>
mMarkdownView = (MarkdownView)findViewById(R.id.markdown_view);
mMarkdownView.loadMarkdown("**MarkdownView**", MarkdownView.Styles.GITHUB);
mMarkdownView.loadMarkdownFromAsset("markdown1.md", MarkdownView.Styles.GITHUB);
mMarkdownView.loadMarkdownFromFile(new File(), MarkdownView.Styles.GITHUB);
mMarkdownView.loadMarkdownFromUrl("url", MarkdownView.Styles.GITHUB);

Using Emojies

Without internet

Add the dependency:

compile 'com.github.tiagohm:MarkdownView:emoji:LATEST-VERSION'
With internet

Add the permission:

<uses-permission android:name="android.permission.INTERNET"/>
mMarkdownView.setEmojiRootPath("http://emojione.com/wp-content/uploads/assets/emojis/");
mMarkdownView.setEmojiImageExtension("svg");

Themes

  • GitHub
  • Electron

Support

  • Bold **Text** or __Text__
  • Italic *Text* or _Text_
  • Strikethrough ~~Text~~
  • Horizontal Rules ---
  • Headings #
  • Links [alt](url)
  • Images ![alt](url)
  • Code
  • Blockquote
  • Nested Blockquote
  • Lists
  • Tables
  • TaskList
  • AutoLink
  • Abbreviation
  • Mark ==Text==
  • Subscript H~2~O
  • Superscript 10^-10^
  • Keystroke @ctrl+alt+del@
  • MathJax $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
  • Footnotes
  • Image Resizing ![alt](url@100px|auto)
  • Syntax Highlighting (using Highlight.js)
  • Emoji (EmojiOne) :smile:

LICENSE

Copyright 2017 tiagohm

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.