Ensure README in all modules
This commit is contained in:
parent
b7606c7ee7
commit
f99952ec01
3
markwon-core/README.md
Normal file
3
markwon-core/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Markwon Core
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/core/getting-started.html
|
@ -1,11 +1,3 @@
|
|||||||
# LaTeX
|
# LaTeX Extension
|
||||||
|
|
||||||

|
https://noties.io/Markwon/docs/v4/ext-latex/
|
||||||

|
|
||||||
|
|
||||||
```kotlin
|
|
||||||
implementation "io.noties.markwon:ext-strikethrough:${markwonVersion}"
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
[Documentation](https://noties.github.io/Markwon/docs/v3/ext-latex)
|
|
||||||
|
@ -1,35 +1,3 @@
|
|||||||
# Strikethrough
|
# Strikethrough Extension
|
||||||
|
|
||||||

|
https://noties.io/Markwon/docs/v4/ext-strikethrough/
|
||||||

|
|
||||||
|
|
||||||
```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();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
```
|
|
@ -1,45 +1,3 @@
|
|||||||
# Tables
|
# Tables Extension
|
||||||
|
|
||||||
[](http://search.maven.org/#search|ga|1|g%3A%22io.noties.markwon%22%20AND%20a%3A%22ext-tables%22)
|
https://noties.io/Markwon/docs/v4/ext-tables/
|
||||||
|
|
||||||
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.
|
|
||||||
|
3
markwon-ext-tasklist/README.md
Normal file
3
markwon-ext-tasklist/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Task-list Extension
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/ext-tasklist/
|
3
markwon-html/README.md
Normal file
3
markwon-html/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# HTML
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/html/
|
3
markwon-image-glide/README.md
Normal file
3
markwon-image-glide/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Images (Glide)
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/image-glide/
|
3
markwon-image-picasso/README.md
Normal file
3
markwon-image-picasso/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Images (Picasso)
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/image-picasso/
|
3
markwon-image/README.md
Normal file
3
markwon-image/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Images
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/image/
|
@ -1,2 +1,3 @@
|
|||||||
# Linkify
|
# Linkify
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/linkify/
|
3
markwon-recycler-table/README.md
Normal file
3
markwon-recycler-table/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Recycler Table
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/recycler-table/
|
3
markwon-recycler/README.md
Normal file
3
markwon-recycler/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Recycler
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/recycler/
|
3
markwon-simple-ext/README.md
Normal file
3
markwon-simple-ext/README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# Simple Extension
|
||||||
|
|
||||||
|
https://noties.io/Markwon/docs/v4/simple-ext/
|
@ -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.
|
https://noties.io/Markwon/docs/v4/syntax-highlight/
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
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
|
|
Loading…
x
Reference in New Issue
Block a user