LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   help with Gedit (https://www.linuxquestions.org/questions/linux-newbie-8/help-with-gedit-4175497294/)

Gregg Bell 03-06-2014 02:29 PM

help with Gedit
 
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.

John VV 03-06-2014 03:20 PM

r-click and click on "select all" and then copy

or should be
< control > + < a >

Gregg Bell 03-06-2014 04:58 PM

sorry
 
Quote:

Originally Posted by John VV (Post 5130161)
r-click and click on "select all" and then copy

or should be
< control > + < a >

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.

astrogeek 03-06-2014 05:04 PM

(Why not...) Simply open the saved file in your browser of choice.

Gregg Bell 03-06-2014 05:57 PM

2 Attachment(s)
Quote:

Originally Posted by astrogeek (Post 5130227)
(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.

astrogeek 03-06-2014 06:06 PM

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.

John VV 03-06-2014 06:29 PM

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

Gregg Bell 03-07-2014 01:22 AM

Quote:

Originally Posted by astrogeek (Post 5130247)
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.

DavidMcCann 03-07-2014 10:38 AM

Bluefish is an editor intended for html and other code: that has an option in the menu to display in a browser.

Gregg Bell 03-07-2014 05:32 PM

2 Attachment(s)
Quote:

Originally Posted by DavidMcCann (Post 5130615)
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!

DavidMcCann 03-08-2014 11:14 AM

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.

Gregg Bell 03-08-2014 07:48 PM

Quote:

Originally Posted by DavidMcCann (Post 5131134)
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.

Thanks!


All times are GMT -5. The time now is 06:41 PM.