-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add instruction on how to visit HTML document from browser #62
base: master
Are you sure you want to change the base?
Conversation
Just as a pointer (not really related to the substance of the pull request), you could use a convenience function along these lines to browse the file the current buffer is visiting. It's untested, and there are lots of things about it you might want to change, but maybe it will be useful nonetheless. (defun browse-this-file (file)
(interactive (list (buffer-file-name)))
(unless (and file (file-exists-p file))
(error "File does not exist: ‘%s’" file))
(unless (process-status "httpd")
(httpd-start))
(let ((name (file-name-nondirectory file))
(httpd-root (file-name-directory file)))
(browse-url (format "http://127.0.0.1:%s/%s" httpd-port name)))) |
When I first tried skweer-mode, I looked everywhere to find a solution as to why HTML part was not working. I watched tuts on youtube and looked in the docs yet found no solution. I cannot remember which tutorial pointed out that httpd-root must be set properly. |
I still couldn't drive web browser from emacs with skewer-load-buffer, I'll study your suggestion above. Thanks for replying.! Yu On Fri, Nov 6, 2015 at 8:37 AM, John Mastro notifications@github.com
|
I don't really want to recommend users use the underlying simple-httpd server for hosting their page. It's both unnecessary and insufficient. It's unnecessary because your document can be hosted anywhere, including directly from your filesystem, no server needed. You can even Skewer websites you don't control (though this is becoming less possible as more security controls are being put into place on the web). For example, create <script src="http://localhost:8080/skewer"></script> And open the HTML file (e.g. I say it's insufficient because you really shouldn't be using simple-httpd as your production host, especially not if it's connected to the Internet. Emacs isn't secure enough for that. So just use whatever platform you intend to use for actual hosting. Since you were stuck for 45 minutes, may I ask what was unclear in the README under "Manual version" at "To skewer your own document"? That's where I intended to cover this exact information. |
Hi Christopher, Thanks for addressing my problems! My pull request was due to the fact that I was and is not able to see the I did the following procedure:
I expected to see the effects of the edit. But I didn't see it. Only until I did not do the following as I don't know what to do:
I did see any complaints of lack of dependencies though. As I had the problem of seeing the effect, so I thought that I might need Now, I understand that my pull request is due to misunderstanding. It's no I'm running with emacs Prelude in Windows 7. For HTML, it ran with Please let me know any other information needed, and how I can debug my Thanks again! Yu On Sat, Nov 7, 2015 at 6:36 AM, Christopher Wellons <
|
It took me 45 minutes by googling to figure out how to actually do "Visit the document from your browser" as a new user. So I feel that the time can be saved by adding the instruction of how to in README.md:
+1.
(setq httpd-root "~/web-page-making")
web-page-making
is the directory where the HTML document to be visited is.+2. At your browser's URL field enter:
http://127.0.0.1:8080/index.html
8080
is the value ofhttpd-port
andindex.html
is the HTML document name.