diff --git a/README.md b/README.md index 88327bf..24d6e05 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,76 @@ options.getSafelist().removeProtocols("img", "src", "http", "https"); String html2 = Marked.marked("![alt text](/img/some-image.png \"title\")", options); // =>

alt text

+``` + +## Extensions + +Markedj can be extended by implementing [custom extensions](https://github.com/gitbucket/markedj/blob/master/src/main/java/io/github/gitbucket/markedj/extension/Extension.java). +Extensions can be used by adding them to the options. + +```java +Options options = new Options(); +options.addExtension(new NotificationExtension()); +String html = Marked.marked("! This is an info message", options); + // =>

This is an info message

+``` + +### Notification extension + +The notification extension helps you to add information messages to your markdown content. +Keep in mind, you still need the CSS to style the messages as desired. + +#### Info message +```text +! This is an info message +``` +```html +
+

This is an info message

+
+``` + +#### Success message +```text +!v This is a success message +``` +```html +
+

This is a success message

+
+``` + +#### Warning message +```text +!! This is a warning message +``` +```html +
+

This is a warning message

+
+``` + +#### Error message +```text +!x This is an error message +``` +```html +
+

This is an error message

+
+``` + +#### Multiline notifications +Notifications can span multiple lines. + +```text +! This is an info message +! That spans over several lines +``` +```html +
+

This is an info message +That spans over several lines

+
+ ``` \ No newline at end of file