greghendershott / frog

Frog is a static blog generator implemented in Racket, targeting Bootstrap and able to use Pygments.
916 stars 96 forks source link

Improve --watch #233

Closed sorawee closed 5 years ago

sorawee commented 5 years ago
  1. There are several reasons why frog.rkt might not be loadable. We only want to show a nice warning that users should initialize the project when the exception is filesystem-related. Other errors like syntax errors / unbound ids should not be caught.

  2. Improve --watch flag by allowing users to customize whether or not they want to trigger a rebuild or not. The default behavior is backward-compatible with the current behavior.

  3. Don't print \n when beeping in --watch.

  4. If an error happens during a build with --watch, prevent Frog from catastrophically fail. Note that this is especially common when editing a Scribble post file.

sorawee commented 5 years ago

Oh no, the build fails because I use a function that was added in 6.5.0.3. Do we really need to support Racket from 2 years ago? If the answer is yes, I will update the patch to avoid using the function.

greghendershott commented 5 years ago

There are a couple "for older Racket" functions in private/util.rkt; if you could define path-get-extension there, that would be great. Someday we can just delete them, as we require newer versions of Racket for Frog.

I try to keep Frog working on older Rackets. Sometimes people want to use Racket installed from an OS package manager, and sometimes those are old versions.

sorawee commented 5 years ago

@greghendershott should be all right now.

sorawee commented 5 years ago

Hello @greghendershott, do you get any chance to review this? Let me know if there's any problem with it!

greghendershott commented 5 years ago

You happened to do a number of issues and PRs, at a time when I'm really swamped with work programming. Also, I haven't really been focused on Frog beyond simple maintenance, lately; it takes awhile to reload my L1 brain cache.

So, I've been slow to review. I have started to look at things a few times, but got deflected.

Although I'm not yet sure about the others, I think this PR seems good -- both the intended change and the implementation. Thank you for making the changes I suggested.

I will try to give it one last review later today, then probably merge it.

Also, if I notice anything trivial (e.g. a typo or phrasing in documentation), I'll just go ahead and change that myself in new commit, to avoid more cycles on this.

(It may take me awhile to get to the other PRs.)

greghendershott commented 5 years ago

I squashed this down to 2 commits (the first 5, and the 6th), and rebased onto master. Tests passed again. Merged to master as commit 219301a and commit 1d6d42b.

Thank you.

sorawee commented 5 years ago

Thanks! :)