Ensure README in all modules

This commit is contained in:
Dimitry Ivanov 2019-06-26 19:05:23 +03:00
parent b7606c7ee7
commit f99952ec01
14 changed files with 36 additions and 151 deletions

3
markwon-core/README.md Normal file
View File

@ -0,0 +1,3 @@
# Markwon Core
https://noties.io/Markwon/docs/v4/core/getting-started.html

View File

@ -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/

View File

@ -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();
}
});
}
})
```
https://noties.io/Markwon/docs/v4/ext-strikethrough/

View File

@ -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/

View File

@ -0,0 +1,3 @@
# Task-list Extension
https://noties.io/Markwon/docs/v4/ext-tasklist/

3
markwon-html/README.md Normal file
View File

@ -0,0 +1,3 @@
# HTML
https://noties.io/Markwon/docs/v4/html/

View File

@ -0,0 +1,3 @@
# Images (Glide)
https://noties.io/Markwon/docs/v4/image-glide/

View File

@ -0,0 +1,3 @@
# Images (Picasso)
https://noties.io/Markwon/docs/v4/image-picasso/

3
markwon-image/README.md Normal file
View File

@ -0,0 +1,3 @@
# Images
https://noties.io/Markwon/docs/v4/image/

View File

@ -1,2 +1,3 @@
# Linkify
https://noties.io/Markwon/docs/v4/linkify/

View File

@ -0,0 +1,3 @@
# Recycler Table
https://noties.io/Markwon/docs/v4/recycler-table/

View File

@ -0,0 +1,3 @@
# Recycler
https://noties.io/Markwon/docs/v4/recycler/

View File

@ -0,0 +1,3 @@
# Simple Extension
https://noties.io/Markwon/docs/v4/simple-ext/

View File

@ -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/