joeyespo / grip

Preview GitHub README.md files locally before committing them.
MIT License
6.49k stars 424 forks source link

Allow for manual refresh with ^R #203

Closed bcongdon closed 8 years ago

bcongdon commented 8 years ago

It would be nice to be able to manually refresh the markdown render.

Use case: I use grip to preview my markdown, and run grip with --norefresh (I was hitting up against the Github API limit). It would be nice to be able to do a ^R (or whatever) in the console and manually regenerate the markdown (Jekyll has functionality similar to this)

I'm willing to make the changes in a PR, so I just want a signal as to if this would be something acceptable by the authors.

joeyespo commented 8 years ago

Even though Jekyll does this, I'm not convinced it's actually a good feature.

Grip is a CLI app that runs a server and prints its output (until a stop signal is received somehow). All interaction takes place at the HTTP request level, whereas the terminal is a one-way channel (aside from the standard "terminate signal" handling). Handling bidirectional communication at that level will complect the system and its design. (How would cat README.md | grip - work? Grip would have to become a bit more aware of the environment its run in.)

Since the underlying problem is the rate limit, there's two other things you can do here:

Adding ^R is just patching the symptom. On the other hand, the offline renderer (#35) would solve this for good. So I'd rather focus energy on that.

Thanks for the suggestion, @bcongdon!