https://ifnowcode.github.io/marky
Marky is a fast, lightweight, browser‑based Markdown editor and previewer designed for live editing, scroll‑sync, SLML/Dataseps parsing, and safe HTML/script prototyping. It’s built for rapid iteration, debugging, and experimentation without needing a full project scaffold.
Disclaimer: The following was written by AI and has not been vetted or edited yet.
-
Live Markdown Editing with instant preview
-
Bidirectional Scroll Sync between editor and preview
-
SLML + Dataseps Parsing for semantic markup workflows
-
Iframe‑based HTML Execution using
srcdocorcontentDocument -
Script Rehydration for inline
<script>execution -
Default Markdown Templates with reset support
-
Zero Dependencies — runs in any modern browser
Code
marky/ │ ├── index.html # Main UI ├── marky.js # Core logic: parsing, preview, scroll sync ├── parser.js # SLML + Dataseps line parser ├── styles.css # Layout + theme └── README.md
Just open index.html in any modern browser. No build step, no server required.
-
Type Markdown in the left pane
-
See rendered output in the right pane
-
Scroll either pane — the other stays in sync
Marky uses a Markdown parser to convert editor text into HTML. SLML and Dataseps tokens are processed before Markdown conversion to preserve semantic structure.
Two rendering modes are supported:
Full document reload
Scripts execute automatically
Best for HTML prototyping
In‑place DOM updates
Faster incremental rendering
Scripts require rehydration
Scripts inserted via innerHTML do not execute.
Marky re‑creates them using:
js
const newScript = document.createElement('script');
newScript.textContent = oldScript.textContent;
oldScript.replaceWith(newScript);
This enables safe, sandboxed execution inside the preview iframe.
Marky includes a lightweight line‑by‑line parser that detects:
-
::tokens→ semantic labels -
---or===→ dataseparators -
provenance tags
-
structural markers
These are transformed into Markdown‑compatible HTML attributes for future semantic rendering.
Marky maintains proportional scroll sync between:
-
The
<textarea>editor -
The iframe preview document
It uses scroll ratios:
Code
ratio = scrollTop / (scrollHeight - clientHeight)
And applies them to the target pane.
Marky can load a default Markdown file on reset. You can configure this via:
-
A template literal
-
A
fetch()call to a.mdfile -
A custom loader
Marky runs all preview content inside a sandboxed iframe. Scripts execute only inside the sandbox, never in the parent page.
-
Markdown editing
-
HTML prototyping
-
Script experimentation
-
SLML/Dataseps research
-
Teaching + demos
-
Rapid UI mockups
Pull requests and feature ideas are welcome. Future enhancements may include:
-
SLML block folding
-
Semantic overlays
-
Chunk provenance visualization
-
Plugin architecture