• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

tiagohm/MarkdownView: Android library to display markdown text.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

tiagohm/MarkdownView

开源软件地址(OpenSource Url):

https://github.com/tiagohm/MarkdownView

开源编程语言(OpenSource Language):

Java 99.8%

开源软件介绍(OpenSource Introduction):

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:

implementation '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.addStyleSheet(new Github());
mMarkdownView.loadMarkdown("**MarkdownView**");
mMarkdownView.loadMarkdownFromAsset("markdown1.md");
mMarkdownView.loadMarkdownFromFile(new File());
mMarkdownView.loadMarkdownFromUrl("url");

Using Emojies

Without internet

Add the dependency:

implementation 'com.github.tiagohm.MarkdownView:emoji:LATEST-VERSION'

Custom CSS

//InternalStyleSheet css = new InternalStyleSheet();
InternalStyleSheet css = new Github();
css.addFontFace("MyFont", "condensed", "italic", "bold", "url('myfont.ttf')");
css.addMedia("screen and (min-width: 1281px)");
css.addRule("h1", "color: orange");
css.endMedia();
css.addRule("h1", "color: green", "font-family: MyFont");
mMarkdownView.addStyleSheet(css);

mMarkdownView.addStyleSheet(ExternalStyleSheet.fromAsset("github.css", null);
mMarkdownView.addStyleSheet(ExternalStyleSheet.fromAsset("github2.css", "screen and (min-width: 1281px)");

JavaScript

JavaScript js = new ExternalJavaScript(url, async, defer);
mMarkdownView.addJavascript(js);

Twitter

Embed a Single Tweet

From https://twitter.com/RealGrumpyCat/status/845101936550469634

  • #[tweet](845101936550469634)
  • #[tweet-hide-cards](845101936550469634)

Follow Button

From https://twitter.com/tiag0hm

  • #[follow](tiag0hm)

Themes

  • GitHub

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 Inline $x = {-b \pm \sqrt{b^2-4ac} \over 2a}$
  • MathJax $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$
  • Footnotes
  • Image Resizing ![alt](url@100px|auto)
  • Syntax Highlighting (using Highlight.js)
  • Emoji (EmojiOne v2) :smile:
  • Custom CSS
  • Youtube @[youtube](fM-J08X6l_Q)
  • Twitter
  • JavaScripts
  • Label --DEFAULT-- ---SUCCESS--- ----WARNING---- -----DANGER-----
  • Bean {{fieldName}}
  • Custom Attributes { #id .class name=value name='value'}
  • Text Align, Text Size and Text Colors using Custom Attributes

LICENSE

Copyright 2017-2018 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.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap