Comments (23)
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.
websockets yo :-) will take a stab at it soon.
from grip.
👍
from grip.
👍
from grip.
👍 PR welcome for this?
from grip.
@dsummersl Absolutely 😃
from grip.
This will be the killer feature!
from grip.
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.
@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.
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.
@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
- Replace
s:startDaemon
with code that creates a temporary Markdown file withinitialMD
and run grip on that file withgrip <filename>
- Replace
s:refreshView
with code that saves the current buffer contents to the temp file - Replace
s:killDaemon
with code that sends SIGINT to the grip process - 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.
@afeld Did you get anywhere before? If not, I'll finally tackle this in the new year.
from grip.
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.
Thank you @joeyespo for great tips. If I find some time to run this project I'll definitely use it :)
from grip.
@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.
@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.
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.
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.
I tried this patch and it works great. I suggest adding a command line option for it like --auto-reload.
from grip.
+1 👍
from grip.
Implemented by @markbt in #135 ✨ 🎆 😄
from grip.
FYI, this feature was officially released n 4.0.0 😄
Be sure to upgrade with pip install --upgrade grip
.
from grip.
Works great! Thank you @markbt!
from grip.
Related Issues (20)
- `safe_join` in Flask is deprecated HOT 3
- Add server killing functionality HOT 2
- Feature request:math HOT 4
- Does this send user content to github? HOT 1
- Missing support for WARNING and NOTE formatting HOT 4
- Apt package fails with error on Ubuntu 22.04
- Project dependencies may have API risk issues
- Question: navigation
- table of contents: link to sections
- Spelling of "Trust Over IP" HOT 1
- There is no longer any need for the hack, as GitHub now supports [LaTeX equations in Markdown](https://github.blog/changelog/2022-05-19-render-mathematical-expressions-in-markdown/) natively using MathJax. It would be great, however, if grip could display such equations correctly in its preview.
- grip reports not finding README (but does not try to open that file)
- Create CONTRIBUTION.md to guide open source developers to contribute to this project
- Render only difference
- grip is not working w/ latest flask and werkzeug versions HOT 2
- Use grip --export in flask.
- Having issues with latest release, 4.6.2 HOT 1
- Tag for 4.6.2 missing
- GitHub API Rate Limit HOT 1
- GRIP (possible regression) giving me an error for some reason HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grip.