@@ -0,0 +1,2070 @@
+package com.ezware.markdownfx;%0A%0Aimport javafx.beans.value.ChangeListener;%0Aimport javafx.beans.value.ObservableValue;%0Aimport javafx.scene.control.ComboBox;%0Aimport javafx.scene.control.SplitPane;%0Aimport javafx.scene.control.TextArea;%0Aimport javafx.scene.control.ToolBar;%0Aimport javafx.scene.layout.BorderPane;%0Aimport javafx.scene.text.Font;%0Aimport javafx.scene.web.WebView;%0A%0Aimport com.github.rjeschke.txtmark.Processor;%0A%0Apublic class DocumentEditor extends SplitPane %7B%0A%0A    private WebView webView;%0A    private TextArea textArea;%0A    %0A    public DocumentEditor() %7B%0A        webView = new WebView();%0A        webView.getStyleClass().add(%22browser%22);%0A%0A        textArea = new TextArea();%0A        textArea.setWrapText(true);%0A        Font font = textArea.fontProperty().get();%0A        textArea.setFont( Font.font(font.getName(), font.getSize() *1.1 ));%0A        textArea.textProperty().addListener( new ChangeListener%3CString%3E() %7B%0A            public void changed(ObservableValue%3C? extends String%3E ob, String newText, String oldText) %7B%0A                reparse(newText);%0A            %7D%0A        %7D);%0A        %0A        BorderPane browser = new BorderPane();%0A        ToolBar toolBar = new ToolBar();%0A        toolBar.getItems().add( new ComboBox%3CString%3E());%0A        browser.setTop( toolBar);%0A        browser.setCenter( webView);%0A        %0A        getItems().addAll( textArea, browser);%0A%0A    %7D%0A    %0A    private static String doc = %22%3C!DOCTYPE html%3E%3Chtml%3E%3Chead%3E%3Clink href=%5C%22%25s%5C%22 rel=%5C%22stylesheet%5C%22/%3E%3C/head%3E%3Cbody%3E%25s%3C/body%3E%3C/html%3E%22;%0A    private static String css = //%22https://raw.github.com/nicolashery/markdownpad-github/master/markdownpad-github.css%22; %0A            %22http://kevinburke.bitbucket.org/markdowncss/markdown.css%22;%0A    %0A    %0A    private void reparse( String text ) %7B%0A        %0A        String textHtml = Processor.process(text); %0A        %0A        String html = String.format( doc, css, textHtml);%0A        System.out.println(html);%0A        webView.getEngine().loadContent( html, %22text/html%22);%0A        webView.getEngine().executeScript(%22window.scrollTo(100,100);%22);%0A    %7D    %0A    %0A    %0A%7D%0A

Create DocumentEditor