⚡ Fast. 🖼️ Beautiful. 🎯 Real-Time. 🌓 Theme-Aware.
JavaFX Markdown Preview is a modern and lightweight library designed to render Markdown content seamlessly in JavaFX applications.
Whether you’re building a Markdown editor, a documentation viewer, or just need a clean way to preview .md
content inside your app — this tool saves you hours of work by offering a plug-and-play experience.
✅ Embed anywhere – Tabs, windows, or any JavaFX layout
✅ Live preview – Automatic updates when files change
✅ Syntax highlighting – Beautiful, GitHub-style code blocks
✅ Copy buttons – One-click copy of code snippets
✅ Dark and light themes – Easy toggling
✅ Markdown to HTML export – Generate styled HTML
✅ Cross-platform – Windows, macOS, Linux
✅ No browser dependency – Uses JavaFX WebView
Whether you're developing documentation tools, note-taking apps, IDE plugins, or just need a Markdown viewer, this tool offers a ready-made and customizable solution.
Note: Version 1.0.2 contained all the new features below but failed deployment to Maven Central. Version 1.0.3 is the first properly signed and published release. Please upgrade to 1.0.3.
- 🎯 Tab and TabPane Support
- Embed previews inside
TabPane
with lifecycle management.
- Embed previews inside
- 🧩 Standalone WebView Component
- Use a
WebView
node in any JavaFX layout (VBox
,HBox
,BorderPane
).
- Use a
- 🌈 Enhanced GitHub-Style Themes
- Cleaner dark and light themes matching GitHub styling.
- 📝 Syntax Highlighting & Copy Buttons
- Beautiful code blocks with one-click copy support.
- ⚡ Improved Real-Time Updates
- Live reload when files change, with reduced flicker.
- 💡 JavaFX 17 Compatibility
- Runs smoothly on JavaFX 11–17.
✅ Why use 1.0.3?
This version ensures a verified signature, successful publication to Maven Central, and fully reproducible builds.
Artifact Name | Includes Flexmark | Use Case |
---|---|---|
javafx-markdown-preview |
❌ No | For Maven users with their own Flexmark setup |
javafx-markdown-preview-all |
✅ Yes | Works out of the box, no extra setup |
- 📂 Load
.md
file or raw Markdown string - 🔄 Real-time preview with file change detection
- 🖥️ Opens in a separate JavaFX window
- 🔁 Reopen preview window if closed
- 🧩 Embed in any JavaFX scene or layout
- ☕ Supports both Java and JavaFX projects
- ⚡ Lightweight and reusable as a utility
Add the dependency in your pom.xml
:
<dependency>
<groupId>io.github.raghul-tech</groupId>
<artifactId>javafx-markdown-preview-all</artifactId>
<version>1.0.3</version>
</dependency>
Or browse it on Maven Central.
<dependency>
<groupId>io.github.raghul-tech</groupId>
<artifactId>javafx-markdown-preview</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>com.vladsch.flexmark</groupId>
<artifactId>flexmark-all</artifactId>
<version>0.64.8</version>
</dependency>
Or browse it on Maven Central.
-
You’ll find ready-to-run examples in the
examples/
directory:-
ExampleWindow.java
– Launches the preview in a standalone JavaFX window, ideal for external Markdown viewers or editor popouts. -
ExampleTabPane.java
– Embeds the preview as a tab inside aTabPane
, great for multi-tab document editors. -
ExampleWebview.java
– Shows how to embed the preview WebView into any JavaFX layout, such asVBox
,BorderPane
, orStackPane
. -
ExampleRenderer.java
– Demonstrates using theMarkdownRenderer
utility to convert Markdown content into styled HTML, useful for exporting or rendering elsewhere.
-
✅ To run an example:
-
Download or clone this repository.
-
Navigate to
examples/
folder. -
Compile and run the desired file.
✅ Tip: Each example is standalone—feel free to adapt and copy the patterns directly into your project.
javac -cp java-markdown-preview-all-1.0.3.jar Markdown.java
Windows:
java -cp .;java-markdown-preview-all-1.0.3.jar Markdown
Linux/macOS:
java -cp .:java-markdown-preview-all-1.0.3.jar Markdown
-
📚 Javadoc
-
OpenJFX libraries if using Java 11+
-
JavaFX (use OpenJFX for Java 11+)
-
Maven for dependency management
- View all releases on the Releases Page.
- For a detailed log of all changes, refer to the CHANGELOG.md file.
-
We welcome contributions of all kinds:
-
🛠️ Bug fixes
-
🌟 Feature suggestions
-
📚 Documentation improvements
-
🧪 More usage examples
-
Please check the Contributing Guide before starting.
- If you've encountered a bug, please report it by clicking the link below. This will guide you through the bug-reporting process: ➡️ Click here to report a bug
- This project is licensed under the GNU General Public License v3 (GPL-3.0).
Email: [email protected]
If you find this project useful, consider buying me a coffee!