-
Notifications
You must be signed in to change notification settings - Fork 460
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
New auto #1734
Conversation
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
suggestion:
Will make things a bit cleaner. |
def inject_js(self, mimetype, data): | ||
"""Inject livereload.js in HTML files.""" | ||
if mimetype == 'text/html': | ||
data = re.sub('</head>', self.snippet, data, 1, re.IGNORECASE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</body>
or add <script async …>
Note that HTML5 do not guarantee any element. It requires doctype and title only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the suggestion. How would you inject it?
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
import wsgiref.util | ||
|
||
from blinker import signal | ||
import pyinotify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works on Linux only and crashes on other platforms:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\yapsy\PluginManager.py", line 484, in loadPlugins
candidate_module = imp.load_module(plugin_module_name,None,candidate_filepath,("py","r",imp.PKG_DIRECTORY))
File "C:\projects\nikola\nikola\plugins\command\auto\__init__.py", line 43, in <module>
import pyinotify
ImportError: No module named pyinotify
You would have to find another library, like watchdog.
This replaces livereload with a homebrew version. It seems to fix #1729 and #1757 to me, and also adds a nice thing in that it shows build failures in the web page as an alert (may be too annoying ;-)
Missing bits: