Giter Site home page Giter Site logo

Comments (4)

suan avatar suan commented on June 26, 2024

The meat of the logic is in the backend code: http://github.com/suan/instant-markdown-d Do you want an explanation on that, this vim plugin, or both?

Also, if you're diving into the code cause of instability issues, I'm aware of those, and am working on a more stable and flexible backend which will also be in pure ruby (easier to install) You can follow the progress here: https://github.com/suan/instant-markdown-d/tree/rate_limiting

from vim-instant-markdown.

oivvio avatar oivvio commented on June 26, 2024

I'm just curious about the communication between the three parts, vim, the browser and the node instance. How is that set up?

from vim-instant-markdown.

suan avatar suan commented on June 26, 2024

It's roughly like this:

  1. When you open a markdown file in vim, it starts the backend server
  2. when the backend server starts, it opens a browser tab and a websocket connection
  3. When the buffer for the markdown file is changed in vim, the plugin sends a PUT request to the server with the new markdown content
  4. The server converts to to HTML and sends it over the websocket
  5. The javascript in the browser tab replaces the old HTML content with the new one
  6. When you close/leave the vim buffer, it sends a DELETE request to the server
  7. The server sends a message over the websocket it to close the browser tab, and then shuts itself down

from vim-instant-markdown.

oivvio avatar oivvio commented on June 26, 2024

Nice!

from vim-instant-markdown.

Related Issues (20)

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.