Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: watch local themes, stylesheets and templates for changes #128

Open
neelabhg opened this issue Nov 5, 2015 · 5 comments
Open

Comments

@neelabhg
Copy link

neelabhg commented Nov 5, 2015

cleaver watch should rebuild on changes to a template, style, or any file included as part of a theme. I know #120 added support for watching stylesheets if passed with --style arg, but this should be implemented for files mentioned in the YAML front matter as well.

This will not be feasible for themes pulled from remote repositories, but we can check if the theme is in a local directory, and then watch every theme-related file for changes.

@neelabhg neelabhg changed the title Watch local themes, stylesheets and templates for changes Feature: watch local themes, stylesheets and templates for changes Nov 5, 2015
@wuleninja
Copy link

Yeah, that would be a very nice addition.

In the meantime, I'm using chokidar-cli to watch for all the changes, and restart the generation.

@sudodoki
Copy link
Collaborator

@ninjawule can you share, please, command you are using for others to reference?

@wuleninja
Copy link

wuleninja commented Feb 10, 2017

Yup, I'm using chokidar-cli like this:

chokidar 'my_folder/my_doc.md' 'my_folder/my_doc.css' --initial --silent \
-c 'cleaver --debug my_folder/my_doc.md --title "My HTML Title" --output my_folder/my_doc.html --theme jdan/cleaver-retro --style my_folder/my_doc.css'

With chokidar, I'm monitoring the MD file, but also the CSS file, and when one of them changes, the command given with the -c option is run.

The tradeoff for doing this is that the live reload does not seem to work anymore. Maybe I should try letting the "watch" option in the cleaver command, I don't know.

But I prefer reloading my browser rather than killing the cleaver process to restart it each time I change my CSS, which happens quite a lot in my case.

@sudodoki
Copy link
Collaborator

sudodoki commented Dec 3, 2017

There's a PR that does some of this in #161

@neelabhg
Copy link
Author

Thank you, please feel free to close this issue once that PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants