MarkdownEditorControlFX
An advanced markdown-editor control for JavaFX.
Features
- Three view modes :
EDITOR_ONLY
,PREVIEW_ONLY
,BOTH
- Formatting toolbar items:
bold
,italic
,strikethrough
,monospaced
- Live preview
- Styleable through
JavaFX CSS
- ...and more
TODO
- Syntax highlighting in the
editor-area
- Internationalization support
- Find dialog
Contributions are welcome!
Requirements
Java 11 or higher
Download
Maven example
<repositories>
<repository>
<id>jitpack.ioid>
<url>https://jitpack.iourl>
repository>
repositories>
<dependency>
<groupId>com.github.DansoftownergroupId>
<artifactId>MarkdownEditorControlFXartifactId>
<version>0.6.3version>
dependency>
Gradle example
repositories {
...
// For MarkdownEditorControl
maven { url 'https://jitpack.io' }
// For some of it's dependencies
maven { url "http://sandec.bintray.com/repo"}
maven { url "https://dl.bintray.com/jerady/maven" }
}
dependencies {
implementation 'com.github.Dansoftowner:MarkdownEditorControlFX:0.6.3'
}
View modes
As mentioned, the control supports multiple view modes.
Each view mode is represented by the enum: com.dansoftware.mdeditor.MarkdownEditorControl.ViewMode
.
It can be set using the MarkdownEditorControl#setViewMode
method.
ViewMode.EDITOR_ONLY
)
1. Editor only (In this mode, only the editor-area is visible.
ViewMode.PREVIEW_ONLY
)
2. Preview only (In this mode, only the preview-area is visible.
ViewMode.BOTH
)
3. Editor and preview (
Basic usage
MarkdownEditorControl control = new MarkdownEditorControl();
control.setToolbarVisible(true); // setting the toolbar visible on the top
control.setMarkdown("# Default "); // setting an initial text
// ...add it to your container or whatever
container.getChildren().add(control);
Demos
Used libraries
- markdown-javafx-renderer - JavaFX markdown renderer based on flexmark
- RichTextFX - Rich-text area for JavaFX
- FontAwesomeFX - for the icons
Used libraries for the demos:
Feedback
If you use this library in your project, let me know in the discussions!
License
Apache 2.0