Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I got this text editor Gedit and I really like it. The one thing I wish it had though was the ability to view the html as it would appear in a browser. (A feature which Notepadd++ had.) Anybody know how I might be able to get that (via a plug-in or whatever). And if not, what's a good way of 'selecting all' in Gedit and then copying and pasting the html somewhere so I can see it as if it were in a browser). Thanks so much.
Sorry, John, I didn't explain myself well in my original post. In Notepad++ they have a feature in the toolbar where you can "view in browser." If you click it, it opens Chrome (or whatever browser you choose) and you can see how your html looks as displayed on a web page. (Esp. to see if your css is properly displayed.) That's what I was hoping to find in Gedit. And if I couldl't find it, I was wondering what's a good way to put (I know how to select all and copy and paste) the html in the text editor into a browser-type setting, where I would be able to see it displayed on a web page.
(Why not...) Simply open the saved file in your browser of choice.
Thanks astro, Did not realize I could do that. But still curious if there's a way to do it in Gedit. And btw when I open my html from Gedit(see 007)in a browser I get this gobbledeygook (see 008). Any ideas as to why and how it can be remedied? Thanks.
That is a character encoding issue. From the looks of it I would say probably results from the dumb idea "smart-quotes" (Apple or M$ term I think) being turned on, a common problem. Instead of using an ASCII or UTF8 equivalent apostrophe, it is using another unicode character that displays as the goop. The same will happen with single and double quotes. When used in HTML format it causes many problems (for example when used to quote attribute values).
You can probably simply set/change the character encoding in the browser, but that does not fix it for others who might open it in their own browser with different settings.
The "smart" choice is always to realize that HTML is not bit-for-bit compatible with non-web document formats and encodings, and disable smart-quotes in the editor.
I don't really know where gedit might do that, but it should be easy enough to find.
*** UPDATE ***
It is also possible that you copy/pasted the text from a word or apple doocument, in which case the smart quotes came from outside gedit. I think Wordpress also has the annoying habit of converting simple quotes to dumb-quotes. In that case you may need to find/replace the offending characters in gedit or using a sed type script.
Standard static html is very easy to just " visualize "
and back in 2000 MS's "Notepade.exe" was all that was needed for that
now if one starts adding in php and javascript and a database
then the only "real" way to "look" at the code is in a running Apache server and a web browser
That is a character encoding issue. From the looks of it I would say probably results from the dumb idea "smart-quotes" (Apple or M$ term I think) being turned on, a common problem. Instead of using an ASCII or UTF8 equivalent apostrophe, it is using another unicode character that displays as the goop. The same will happen with single and double quotes. When used in HTML format it causes many problems (for example when used to quote attribute values).
You can probably simply set/change the character encoding in the browser, but that does not fix it for others who might open it in their own browser with different settings.
The "smart" choice is always to realize that HTML is not bit-for-bit compatible with non-web document formats and encodings, and disable smart-quotes in the editor.
I don't really know where gedit might do that, but it should be easy enough to find.
*** UPDATE ***
It is also possible that you copy/pasted the text from a word or apple doocument, in which case the smart quotes came from outside gedit. I think Wordpress also has the annoying habit of converting simple quotes to dumb-quotes. In that case you may need to find/replace the offending characters in gedit or using a sed type script.
Thanks astro. In LO I had smart quotation marks and dumb apostrophes. So I changed the apostrophe to smart. Which I like. But the problem was not there. The problem was I was copying and pasting into this facebook app "html box" that didn't have any need for the "doc type"etc. stuff at the top of the html so I deleted it. So when I put that file in the browser it had the weird markings for both the quotation marks and apostrophe. So when I went back and opened the full html file in the browser everything was fine. Thanks for cluing me in to what to look for.
P.S. Read "Wolf Solent" by Cowper a couple of months ago. Really enjoyed it.
Bluefish is an editor intended for html and other code: that has an option in the menu to display in a browser.
Thanks, David. I had Bluefish and got rid of it. I liked it but I did not notice the browser option. I will revisit it. And speaking of Bluefish, perhaps you could give me some feedback on this. I was looking for a text editor that would notify me when I made an error with the html. The only thing I know of like that is the epub editor Sigil. Anyway, someone suggested that Bluefish with Weblint would do the same sort of thing. I checked the Synaptic Package Manager and found this(see screenshot 16). First of all, is this (Bluefish & Weblint) an effective way of getting the html violation notifications? And if it is,would I just check bluefish and weblint-perl? And lastly, there is weblint-check (see 18). Which sounds great for dropping whole html files into for a check. It looks thourougly over my head though(I'm pretty new) at this point, but will it do the html checking on entire files (kind of like epubCheck for epubs)? Thanks!
I'm not a web-site creator, but I think that Bluefish and Weblint should do fine. Weblint is produced by the World Wide Web Consortium, so it gives you official validation.
I'm not a web-site creator, but I think that Bluefish and Weblint should do fine. Weblint is produced by the World Wide Web Consortium, so it gives you official validation.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.