Share My Creation MarkCraft - Markdown Editor

MarkCraft - Markdown Editor

A modern, fast, and intuitive Markdown editor, developed in B4J.
It combines a user-friendly text editor with a real-time HTML preview.

Main Features

Full Markdown Editor

  • Formatting: bold, italic, strikethrough
  • Headings H1 to H6
  • Bulleted and Numbered Lists
  • Quotations
  • Tasks: - [ ] and - [x]
  • Horizontal Lines
  • Code Insertion (```)
Content Insertion
  • Adding Links via a Dialog Box
  • Adding Images with ALT + URL
  • Auto-fill based on selection

Undo/Redo
  • Custom Undo/Redo System
  • History reset after each action
  • Dedicated buttons with Font Awesome icons

Preview
  • Real-time HTML preview
  • Integrated WebView
  • Instant Markdown rendering
  • Two-way scroll synchronization
  • Java ↔ JavaScript communication

File management
  • Open a .md file
  • Save as…
  • Copy all Markdown to clipboard
  • Automatic saving

Modern interface
  • Font Awesome icons
  • Compact toolbar
  • Adjustable SplitPane

Technologies used
  • B4J (RAD framework)
  • JavaFX (UI + WebView)
  • Font Awesome (icons)
  • JavaScript for Markdown rendering
  • HTML/CSS for the Preview

How it Works
  1. The user types Markdown in the TextArea.
  2. The text is sent to the WebView via JavaScript.
  3. The HTML is rendered instantly.
  4. Toolbar actions modify the text and update the preview.
  5. Undo/Redo allows for easy reverting.

ScreenShot.png


Have fun !
 

Attachments

  • lib.png
    lib.png
    2 KB · Views: 10
  • MarkCraft.zip
    211.8 KB · Views: 11
  • MarkdownFileTest.zip
    3.7 KB · Views: 11

Toley

Active Member
Licensed User
Longtime User
Thank you will be very useful. I have this error when compiling in B4J

B4X:
B4J Version: 10.30
Parsing code.    (0.04s)
    Java Version: 19
Building folders structure.    (0.02s)
Running custom action.    (0.05s)
Compiling code.    (0.23s)
Compiling layouts code.    (0.02s)
Organizing libraries.    (0.00s)
Compiling generated Java code.    Error
src\b4j\example\b4xmainpage.java:1645: error: method _webscroll in class b4xmainpage cannot be applied to given types;
    _webscroll(null, s);    // lazy way to call sub
    ^
  required: String
  found:    <null>,String
  reason: actual and formal argument lists differ in length
1 error

javac 19.0.2

Edit: Happens only on release on debug it run fine thank you.
 
Last edited:

zed

Well-Known Member
Licensed User
Replace the Java code with this one.
JAVA:
#if java
import javafx.scene.web.*;
import javafx.event.*;

public void setAlertHandler(WebView wv) {

 wv.getEngine().setOnAlert(new EventHandler<WebEvent<String>>(){

            @Override
            public void handle(WebEvent<String> arg0) {          
               caller(arg0.getData());
            }

        });
}
public void caller(String s){
    try{
    _webscroll(s);    // lazy way to call sub
    } catch (Exception e) {
    }
}
#End If

_webscroll(null,s); It asked for two parameters, but we only passed one.
 
Top