Code Monkey home page Code Monkey logo

Comments (23)

joeyespo avatar joeyespo commented on May 23, 2024

Thanks, Aidan!

That would be a fantastic addition!

If you're looking for a good file monitoring library, check out Watchdog. I'm interested to see how you'd signal the browser to refresh.

Thanks for your interest =)

from grip.

afeld avatar afeld commented on May 23, 2024

websockets yo :-) will take a stab at it soon.

from grip.

iandanforth avatar iandanforth commented on May 23, 2024

👍

from grip.

rhyolight avatar rhyolight commented on May 23, 2024

👍

from grip.

dsummersl avatar dsummersl commented on May 23, 2024

👍 PR welcome for this?

from grip.

joeyespo avatar joeyespo commented on May 23, 2024

@dsummersl Absolutely 😃

from grip.

carlesso avatar carlesso commented on May 23, 2024

This will be the killer feature!

from grip.

egel avatar egel commented on May 23, 2024

Totally agree, this feature will kill all competitors in this field. 👍

I even just wondering is that be a good idea to have this great tool into Vim! Maybe vim-grip ? 😄 What do you think?

from grip.

carlesso avatar carlesso commented on May 23, 2024

@egel what for? If (hopefully when) the autoreload will be implemented, triggering a save will do the job. Or am I missing something?

from grip.

egel avatar egel commented on May 23, 2024

Yup @carlesso, I see your point and you've got right with it, but I meant to totally automate this process by creating new instances whenever you open .md file. I thought of something similar to vim-instant-markdown. If you wondering - why create something similar? - well, vim-instant-markdown is a great idea, but it has some real issue with compiling files. With grip I didn't notice any issues similar to vim-instant-markdown. So this I think could be a really great vim plugin 😃

from grip.

joeyespo avatar joeyespo commented on May 23, 2024

@egel Grip does expose a Python API, so you could easily write a plugin using that, or like vim-instant-markdown, use the CLI to accomplish the same thing. Like @carlesso is suggesting, Grip will be flexible enough to remain editor-agnostic. That's an advantage because if grip did start accepting editor-specific code, it could easily grow out of control with the number of editors there are out there.

If you have some time, you could even fork vim-instant-markdown right now and do the following

  1. Replace s:startDaemon with code that creates a temporary Markdown file with initialMD and run grip on that file with grip <filename>
  2. Replace s:refreshView with code that saves the current buffer contents to the temp file
  3. Replace s:killDaemon with code that sends SIGINT to the grip process
  4. Reflect your changes in the README, e.g. including pip install grip

This obviously won't include auto-reload at the moment, but will still save you time by starting and stopping grip for you. When auto-reload is ready, you'll have a working vim plugin. All you'll have to do is upgrade grip. (You may have to add --autoreload to step 1, but that's about it.)

I've been using Sublime Text for pretty much everything these days, so I won't personally be writing this vim plugin anytime soon.

from grip.

joeyespo avatar joeyespo commented on May 23, 2024

@afeld Did you get anywhere before? If not, I'll finally tackle this in the new year.

from grip.

joeyespo avatar joeyespo commented on May 23, 2024

Unless you're suggesting you're willing to take a look, @dsummersl. PRs always welcome :-)

I'll assign the issue to myself before I begin so we're not doing duplicate work.

from grip.

egel avatar egel commented on May 23, 2024

Thank you @joeyespo for great tips. If I find some time to run this project I'll definitely use it :)

from grip.

afeld avatar afeld commented on May 23, 2024

@joeyespo No, sorry. I've been using Atom as my primary editor, which has Markdown previewing built in, so the need wasn't so pressing for me anymore.

from grip.

joeyespo avatar joeyespo commented on May 23, 2024

@afeld That's pretty awesome. Atom does have some attractive features for sure. Ok then, I'll take it on unless someone else chimes before I start.

from grip.

dsummersl avatar dsummersl commented on May 23, 2024

Go for it! If you stall lemme know I'd love to jump in (just not in the holidays :) ). Speaking of, Happy Christmas, all!

from grip.

madflow avatar madflow commented on May 23, 2024

I have made some success with the https://pypi.python.org/pypi/livereload library. I simply had to replace the grip.server.serve method:

def serve(path=None, host=None, port=None, gfm=False, context=None,
          username=None, password=None,
          render_offline=False, render_wide=False, render_inline=False):
    """
    Starts a server to render the specified file
    or directory containing a README.
    """
    app = create_app(path, gfm, context, username, password,
                     render_offline, render_wide, render_inline)

    # Set overridden config values
    if host is not None:
        app.config['HOST'] = host
    if port is not None:
        app.config['PORT'] = port

    # Run local server
    from livereload import Server
    server = Server(app.wsgi_app)
    server.serve(app.config['PORT'])

Maybe there are some pit falls - I do not not know.

from grip.

bob-rossi avatar bob-rossi commented on May 23, 2024

I tried this patch and it works great. I suggest adding a command line option for it like --auto-reload.

from grip.

sayanee avatar sayanee commented on May 23, 2024

+1 👍

from grip.

joeyespo avatar joeyespo commented on May 23, 2024

Implemented by @markbt in #135 ✨ 🎆 😄

from grip.

joeyespo avatar joeyespo commented on May 23, 2024

FYI, this feature was officially released n 4.0.0 😄

Be sure to upgrade with pip install --upgrade grip.

from grip.

pdurbin avatar pdurbin commented on May 23, 2024

Works great! Thank you @markbt!

from grip.

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.