Giter Club home page Giter Club logo

md-editor's Introduction

I use this for editing Markdown if I want live previews. It's designed to run with no server as a file:// URL.

This uses multiple third-party javascript libraries; setup.sh retrieves these, or can be read to find the URLs to download in a different way. I use a CDN delivery service to bundle these libraries into <script-includeable files, but download them locally because I want the editor to work when I'm offline too.

Markdown rendering is handled by https://markdown-it.github.io/, but I usually use https://pandoc.org/ for final rendering so I've tried to match these two through various plugins and with JavaScript in index.html that parses and partially handles YAML metadata blocks. It's not a perfect match, and as I run into parts that don't work as I hope they do I add more plugins or other code to line them up.

The UI is dominated by a CodeMirror editor, with a preview pane (provided by Split.js) that automatically updates and syncs scrolling on every edit and on a double-click in either pane. Save and load buttons use the browser's native tools to save and load the Markdown source, not the HTML. Edits are also stored in the browser's localStorage as two items: text contains the current markdown, and history contains all CodeMirror change objects that led to its creation. The history is currently unused and is erased after a load event, but I have vague aspirations of eventually adding a time line scrubber to the UI.

md-editor's People

Contributors

tychonievich avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.