From f99952ec0143e14164a4d809665551c2d625dce9 Mon Sep 17 00:00:00 2001 From: Dimitry Ivanov Date: Wed, 26 Jun 2019 19:05:23 +0300 Subject: [PATCH] Ensure README in all modules --- markwon-core/README.md | 3 ++ markwon-ext-latex/README.md | 12 +----- markwon-ext-strikethrough/README.md | 36 +--------------- markwon-ext-tables/README.md | 46 +------------------- markwon-ext-tasklist/README.md | 3 ++ markwon-html/README.md | 3 ++ markwon-image-glide/README.md | 3 ++ markwon-image-picasso/README.md | 3 ++ markwon-image/README.md | 3 ++ markwon-linkify/README.md | 1 + markwon-recycler-table/README.md | 3 ++ markwon-recycler/README.md | 3 ++ markwon-simple-ext/README.md | 3 ++ markwon-syntax-highlight/README.md | 65 +---------------------------- 14 files changed, 36 insertions(+), 151 deletions(-) create mode 100644 markwon-core/README.md create mode 100644 markwon-ext-tasklist/README.md create mode 100644 markwon-html/README.md create mode 100644 markwon-image-glide/README.md create mode 100644 markwon-image-picasso/README.md create mode 100644 markwon-image/README.md create mode 100644 markwon-recycler-table/README.md create mode 100644 markwon-recycler/README.md create mode 100644 markwon-simple-ext/README.md diff --git a/markwon-core/README.md b/markwon-core/README.md new file mode 100644 index 00000000..1d8653c2 --- /dev/null +++ b/markwon-core/README.md @@ -0,0 +1,3 @@ +# Markwon Core + +https://noties.io/Markwon/docs/v4/core/getting-started.html \ No newline at end of file diff --git a/markwon-ext-latex/README.md b/markwon-ext-latex/README.md index 442fc61e..aad7a9ea 100644 --- a/markwon-ext-latex/README.md +++ b/markwon-ext-latex/README.md @@ -1,11 +1,3 @@ -# LaTeX +# LaTeX Extension -![stable](https://img.shields.io/maven-central/v/io.noties.markwon/ext-latex.svg) -![snapshot](https://img.shields.io/nexus/s/https/oss.sonatype.org/io.noties.markwon/ext-latex.svg) - -```kotlin -implementation "io.noties.markwon:ext-strikethrough:${markwonVersion}" -``` - - -[Documentation](https://noties.github.io/Markwon/docs/v3/ext-latex) +https://noties.io/Markwon/docs/v4/ext-latex/ diff --git a/markwon-ext-strikethrough/README.md b/markwon-ext-strikethrough/README.md index 8ef64b38..c8bd9c60 100644 --- a/markwon-ext-strikethrough/README.md +++ b/markwon-ext-strikethrough/README.md @@ -1,35 +1,3 @@ -# Strikethrough +# Strikethrough Extension -![stable](https://img.shields.io/maven-central/v/io.noties.markwon/ext-strikethrough.svg) -![snapshot](https://img.shields.io/nexus/s/https/oss.sonatype.org/io.noties.markwon/ext-strikethrough.svg) - -```kotlin -implementation "io.noties.markwon:ext-strikethrough:${markwonVersion}" -``` - - -This module adds `strikethrough` functionality to `Markwon` via `StrikethroughPlugin`: - -```java -Markwon.builder(context) - .usePlugin(StrikethroughPlugin.create()) -``` - -This plugin registers `SpanFactory` for `Strikethrough` node, so it's possible to customize Strikethrough Span that is used in rendering: - -```java -Markwon.builder(context) - .usePlugin(StrikethroughPlugin.create()) - .usePlugin(new AbstractMarkwonPlugin() { - @Override - public void configureSpansFactory(@NonNull MarkwonSpansFactory.Builder builder) { - builder.setFactory(Strikethrough.class, new SpanFactory() { - @Override - public Object getSpans(@NonNull MarkwonConfiguration configuration, @NonNull RenderProps props) { - // will use Underline span instead of Strikethrough - return new UnderlineSpan(); - } - }); - } - }) -``` \ No newline at end of file +https://noties.io/Markwon/docs/v4/ext-strikethrough/ \ No newline at end of file diff --git a/markwon-ext-tables/README.md b/markwon-ext-tables/README.md index 5bb0effd..fce38a27 100644 --- a/markwon-ext-tables/README.md +++ b/markwon-ext-tables/README.md @@ -1,45 +1,3 @@ -# Tables +# Tables Extension -[![ext-tables](https://img.shields.io/maven-central/v/io.noties.markwon/ext-tables.svg?label=ext-tables)](http://search.maven.org/#search|ga|1|g%3A%22io.noties.markwon%22%20AND%20a%3A%22ext-tables%22) - -This extension adds support for GFM tables. - -```java -final Markwon markwon = Markwon.builder(context) - // create default instance of TablePlugin - .usePlugin(TablePlugin.create(context)) -``` - -```java -final TableTheme tableTheme = TableTheme.builder() - .tableBorderColor(Color.RED) - .tableBorderWidth(0) - .tableCellPadding(0) - .tableHeaderRowBackgroundColor(Color.BLACK) - .tableEvenRowBackgroundColor(Color.GREEN) - .tableOddRowBackgroundColor(Color.YELLOW) - .build(); - -final Markwon markwon = Markwon.builder(context) - .usePlugin(TablePlugin.create(tableTheme)) -``` - -Please note, that _by default_ tables have limitations. For example, there is no support -for images inside table cells. And table contents won't be copied to clipboard if a TextView -has such functionality. Table will always take full width of a TextView in which it is displayed. -All columns will always be the of the same width. So, _default_ implementation provides basic -functionality which can answer some needs. These all come from the limited nature of the TextView -to display such content. - -In order to provide full-fledged experience, tables must be displayed in a special widget. -Since version `3.0.0` Markwon provides a special artifact `markwon-recycler` that allows -to render markdown in a set of widgets in a RecyclerView. It also gives ability to change -display widget form TextView to any other. - -```java -final Table table = Table.parse(Markwon, TableBlock); -myTableWidget.setTable(table); -``` - -Unfortunately Markwon does not provide a widget that can be used for tables. But it does -provide API that can be used to achieve desired result. +https://noties.io/Markwon/docs/v4/ext-tables/ diff --git a/markwon-ext-tasklist/README.md b/markwon-ext-tasklist/README.md new file mode 100644 index 00000000..d86b540c --- /dev/null +++ b/markwon-ext-tasklist/README.md @@ -0,0 +1,3 @@ +# Task-list Extension + +https://noties.io/Markwon/docs/v4/ext-tasklist/ \ No newline at end of file diff --git a/markwon-html/README.md b/markwon-html/README.md new file mode 100644 index 00000000..1e165bd6 --- /dev/null +++ b/markwon-html/README.md @@ -0,0 +1,3 @@ +# HTML + +https://noties.io/Markwon/docs/v4/html/ \ No newline at end of file diff --git a/markwon-image-glide/README.md b/markwon-image-glide/README.md new file mode 100644 index 00000000..59fb1db0 --- /dev/null +++ b/markwon-image-glide/README.md @@ -0,0 +1,3 @@ +# Images (Glide) + +https://noties.io/Markwon/docs/v4/image-glide/ \ No newline at end of file diff --git a/markwon-image-picasso/README.md b/markwon-image-picasso/README.md new file mode 100644 index 00000000..be648fee --- /dev/null +++ b/markwon-image-picasso/README.md @@ -0,0 +1,3 @@ +# Images (Picasso) + +https://noties.io/Markwon/docs/v4/image-picasso/ \ No newline at end of file diff --git a/markwon-image/README.md b/markwon-image/README.md new file mode 100644 index 00000000..fd86cbf4 --- /dev/null +++ b/markwon-image/README.md @@ -0,0 +1,3 @@ +# Images + +https://noties.io/Markwon/docs/v4/image/ \ No newline at end of file diff --git a/markwon-linkify/README.md b/markwon-linkify/README.md index 437ce4e4..08bdc0c9 100644 --- a/markwon-linkify/README.md +++ b/markwon-linkify/README.md @@ -1,2 +1,3 @@ # Linkify +https://noties.io/Markwon/docs/v4/linkify/ \ No newline at end of file diff --git a/markwon-recycler-table/README.md b/markwon-recycler-table/README.md new file mode 100644 index 00000000..786cece9 --- /dev/null +++ b/markwon-recycler-table/README.md @@ -0,0 +1,3 @@ +# Recycler Table + +https://noties.io/Markwon/docs/v4/recycler-table/ \ No newline at end of file diff --git a/markwon-recycler/README.md b/markwon-recycler/README.md new file mode 100644 index 00000000..cbe20950 --- /dev/null +++ b/markwon-recycler/README.md @@ -0,0 +1,3 @@ +# Recycler + +https://noties.io/Markwon/docs/v4/recycler/ \ No newline at end of file diff --git a/markwon-simple-ext/README.md b/markwon-simple-ext/README.md new file mode 100644 index 00000000..51f8be2f --- /dev/null +++ b/markwon-simple-ext/README.md @@ -0,0 +1,3 @@ +# Simple Extension + +https://noties.io/Markwon/docs/v4/simple-ext/ \ No newline at end of file diff --git a/markwon-syntax-highlight/README.md b/markwon-syntax-highlight/README.md index 4c7a0c74..e7892419 100644 --- a/markwon-syntax-highlight/README.md +++ b/markwon-syntax-highlight/README.md @@ -1,64 +1,3 @@ -# Markwon-syntax +# Syntax Highlight -This is a simple module to add **syntax-highlight** functionality to your markdown rendered with Markwon library. It is based on [Prism4j](https://github.com/noties/Prism4j) so lead there to understand how to configure `Prism4j` instance. - -![theme-default](../art/markwon-syntax-default.png) - -![theme-darkula](../art/markwon-syntax-darkula.png) - ---- - -First, we need to obtain an instance of `Prism4jSyntaxHighlight` which implements Markwon's `SyntaxHighlight`: - -```java -final SyntaxHighlight highlight = - Prism4jSyntaxHighlight.create(Prism4j, Prism4jTheme); -``` - -we also can obtain an instance of `Prism4jSyntaxHighlight` that has a _fallback_ option (if a language is not defined in `Prism4j` instance, fallback language can be used): - -```java -final SyntaxHighlight highlight = - Prism4jSyntaxHighlight.create(Prism4j, Prism4jTheme, String); -``` - -Generally obtaining a `Prism4j` instance is pretty easy: - -```java -final Prism4j prism4j = new Prism4j(new GrammarLocatorDef()); -``` - -Where `GrammarLocatorDef` is a generated grammar locator (if you use `prism4j-bundler` annotation processor) - -`Prism4jTheme` is a specific type that is defined in this module (`prism4j` doesn't know anything about rendering). It has 2 implementations: - -* `Prism4jThemeDefault` -* `Prism4jThemeDarkula` - -Both of them can be obtained via factory method `create`: - -* `Prism4jThemeDefault.create()` -* `Prism4jThemeDarkula.create()` - -But of cause nothing is stopping you from defining your own theme: - -```java -public interface Prism4jTheme { - - @ColorInt - int background(); - - @ColorInt - int textColor(); - - void apply( - @NonNull String language, - @NonNull Prism4j.Syntax syntax, - @NonNull SpannableStringBuilder builder, - int start, - int end - ); -} -``` - -> You can extend `Prism4jThemeBase` which has some helper methods +https://noties.io/Markwon/docs/v4/syntax-highlight/ \ No newline at end of file