All Projects → noties → Markwon

noties / Markwon

Licence: apache-2.0
Android markdown library (no WebView)

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Markwon

Unmarkdown
Convert HTML to Markdown. Sometimes you just need to go the other way.
Stars: ✭ 131 (-93.28%)
Mutual labels:  markdown
Pandoc Markdown Template
Markdown templates for Pandoc
Stars: ✭ 135 (-93.07%)
Mutual labels:  markdown
Unisolder Notes
Markdown documentation repo for building and chosing parts for Unisolder, the open source universal soldering iron controller
Stars: ✭ 138 (-92.92%)
Mutual labels:  markdown
Gosora
Gosora is an ultra-fast and secure forum software written in Go that balances usability with functionality.
Stars: ✭ 131 (-93.28%)
Mutual labels:  markdown
Mdx
Markdown for the component era
Stars: ✭ 11,948 (+513.03%)
Mutual labels:  markdown
Mkdocs Awesome Pages Plugin
An MkDocs plugin that simplifies configuring page titles and their order
Stars: ✭ 136 (-93.02%)
Mutual labels:  markdown
Pandoc Action Example
using the pandoc document converter on GitHub Actions
Stars: ✭ 131 (-93.28%)
Mutual labels:  markdown
Mdme
Self-rendering Markdown content
Stars: ✭ 140 (-92.82%)
Mutual labels:  markdown
Editor.md
The open source embeddable online markdown editor (component).
Stars: ✭ 11,741 (+502.41%)
Mutual labels:  markdown
Cecil
Your content driven static site generator.
Stars: ✭ 137 (-92.97%)
Mutual labels:  markdown
Oblog
An Auto Rendering 🔽 Blogging System Based on MarkDown & Vue.js | 自动渲染装载 MarkDown 内容的博客系统
Stars: ✭ 133 (-93.18%)
Mutual labels:  markdown
Nuxpress
A Nuxt-based blogging engine and boilerplate
Stars: ✭ 135 (-93.07%)
Mutual labels:  markdown
Mdtool
A tool which can process markdown to HTML
Stars: ✭ 136 (-93.02%)
Mutual labels:  markdown
Remarker
▶️ Remark cli
Stars: ✭ 132 (-93.23%)
Mutual labels:  markdown
Texy
Texy is a lightweight markup language with plain text formatting syntax engine.
Stars: ✭ 138 (-92.92%)
Mutual labels:  markdown
Md
Generate a Markdown Documentation for a SFC Vue Component. Contribute: https://gitlab.com/vuedoc/md#contribute
Stars: ✭ 131 (-93.28%)
Mutual labels:  markdown
Github Action Markdown Link Check
Check all links in markdown files if they are alive or dead. 🔗✔️
Stars: ✭ 132 (-93.23%)
Mutual labels:  markdown
Texme
Self-rendering Markdown + LaTeX documents
Stars: ✭ 1,970 (+1.08%)
Mutual labels:  markdown
X0
Document & develop React components without breaking a sweat
Stars: ✭ 1,706 (-12.47%)
Mutual labels:  markdown
Remarkable
Remarkable - The Markdown Editor for Linux http://remarkableapp.github.io
Stars: ✭ 1,763 (-9.54%)
Mutual labels:  markdown

logo

Markwon

Build

Markwon is a markdown library for Android. It parses markdown following commonmark-spec with the help of amazing commonmark-java library and renders result as Android-native Spannables. No HTML is involved as an intermediate step. No WebView is required. It's extremely fast, feature-rich and extensible.

It gives ability to display markdown in all TextView widgets (TextView, Button, Switch, CheckBox, etc), Toasts and all other places that accept Spanned content. Library provides reasonable defaults to display style of a markdown content but also gives all the means to tweak the appearance if desired. All markdown features listed in commonmark-spec are supported (including support for inlined/block HTML code, markdown tables, images and syntax highlight).

Markwon comes with a sample application. It is a collection of library usages that comes with search and source code for each code sample.

Since version 4.2.0 Markwon comes with an editor to highlight markdown input as user types (for example in EditText).

Installation

stable snapshot

implementation "io.noties.markwon:core:${markwonVersion}"

Full list of available artifacts is present in the install section of the documentation web-site.

Please visit documentation web-site for further reference.

You can find previous version of Markwon in 2.x.x and 3.x.x branches

Supported markdown features:

  • Emphasis (*, _)
  • Strong emphasis (**, __)
  • Strike-through (~~)
  • Headers (#{1,6})
  • Links ([]() && [][])
  • Images
  • Thematic break (---, ***, ___)
  • Quotes & nested quotes (>{1,})
  • Ordered & non-ordered lists & nested ones
  • Inline code
  • Code blocks
  • Tables (with limitations)
  • Syntax highlight
  • LaTeX formulas
  • HTML
    • Emphasis (<i>, <em>, <cite>, <dfn>)
    • Strong emphasis (<b>, <strong>)
    • SuperScript (<sup>)
    • SubScript (<sub>)
    • Underline (<u>, ins)
    • Strike-through (<s>, <strike>, <del>)
    • Link (a)
    • Lists (ul, ol)
    • Images (img will require configured image loader)
    • Blockquote (blockquote)
    • Heading (h1, h2, h3, h4, h5, h6)
    • there is support to render any HTML tag
  • Task lists:
  • Not done
    • Done with X
    • and or small x

Screenshots

Taken with default configuration (except for image loading) in sample app:

By default configuration uses TextView textColor for styling, so changing textColor changes style


Documentation

Please visit documentation web-site for reference

Consulting

Paid consulting is available. Please reach me out at markwon+consulting[at]noties.io to discuss your idea or a project


Demo

Based on this cheatsheet


Headers


Header 1

Header 2

Header 3

Header 4

Header 5
Header 6

Emphasis

Emphasis, aka italics, with asterisks or underscores.

Strong emphasis, aka bold, with asterisks or underscores.

Combined emphasis with asterisks and underscores.

Strikethrough uses two tildes. Scratch this.


Lists

  1. First ordered list item
  2. Another item
  • Unordered sub-list.
  1. Actual numbers don't matter, just that it's a number

  2. Ordered sub-list

  3. And another item.

    You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).

    To have a line break without a paragraph, you will need to use two trailing spaces. Note that this line is separate, but within the same paragraph. (This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)

  • Unordered list can use asterisks
  • Or minuses
  • Or pluses

Links

I'm an inline-style link

I'm a reference-style link

I'm a relative reference to a repository file

You can use numbers for reference-style link definitions

Or leave it empty and use the link text itself.


Code

Inline code has back-ticks around it.

var s = "JavaScript syntax highlighting";
alert(s);
s = "Python syntax highlighting"
print s
/**
 * Helper method to obtain a Parser with registered strike-through &amp; table extensions
 * &amp; task lists (added in 1.0.1)
 *
 * @return a Parser instance that is supported by this library
 * @since 1.0.0
 */
@NonNull
public static Parser createParser() {
  return new Parser.Builder()
      .extensions(Arrays.asList(
          StrikethroughExtension.create(),
          TablesExtension.create(),
          TaskListExtension.create()
      ))
      .build();
}
<ScrollView
  android:id="@+id/scroll_view"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_marginTop="?android:attr/actionBarSize">

  <TextView
    android:id="@+id/text"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="16dip"
    android:lineSpacingExtra="2dip"
    android:textSize="16sp"
    tools:text="yo\nman" />

</ScrollView>
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.

Tables

Colons can be used to align columns.

Tables Are Cool
col 3 is right-aligned $1600
col 2 is centered $12
zebra stripes are neat $1

There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.

Markdown Less Pretty
Still renders nicely
1 2 3

Blockquotes

Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.

Quote break.

This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can put Markdown into a blockquote.

Nested quotes

Hello!

And to you!


Inline HTML

<u><i>H<sup>T<sub>M</sub></sup><b><s>L</s></b></i></u>

HTML


Horizontal Rule

Three or more...


Hyphens (-)


Asterisks (*)


Underscores (_)

License

  Copyright 2019 Dimitry Ivanov ([email protected])

  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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].