Wysiwyg editor component for Markdown text and components to build similar editors.
This repo contains 2 libraries and one app to demonstrate the libs' capabilities.
The libraries are hosted on Maven Central, so you can use them directly from there.
Gradle:
dependencies {
api("me.okonecny:interactive-text:0.3.0") // You can omit this one if you only want the whole editor.
api("me.okonecny:markdown-editor:0.3.0")
}
Located in the interactive-text
are the basic tools, that will enable you to create WYSIWYG editors
for various text-based file formats.
InteractiveContainer
This is the glue that makes everything work. It has a few responsibilities:
InteractiveText
.InteractiveText
This is the text, that is editable, if placed inside the InteractiveContainer
. Supports InlineTextContent
.
TextMapping
Mapping of the visual representation of the document to its source code (and vice-versa). This is the reason why only supports text-based formats are supported.
WysiwygEditor
Builds on top of all the above to give you a simple framework for building your editor.
Most importantly it handles the source code editing. Just fill your view
to render the document and start editing.
Component MarkdownEditor
, that builds on the above WysiwygEditor
, provides capabilities to edit strings in Markdown
format using the fabulous flexmark-java library.
:emoji-name:
codes - e.g. :thumbsup: .To render the document, MarkdownEditor
uses the MarkdownView
component, which you can also use standalone to display
documents that should not be editable.
Demo app is located in the root project. To try it out and play around with MarkdownEditor
, just run:
./gradlew :run