HTML editor for Mac?

C

Chris Beall

On Windows, I use Notepad to create HTML from scratch.

Today my daughter asked me what to use on a Mac. Apparently she has
tried several tools, but has not been able to get any to work. As I
understand her problem, she can create text files, but they continue to
be recognized as only text files, even if given an .html extension. I
vaguely recall that Mac uses a 'signature' or something other than the
file extension to define the type of a file, but...

Can anyone identify a standard (part of an Apple iBook preload) editor
that can be used to create HTML files? If there's a trick to doing so,
please describe the details, as I have no system with which to experiment.

Thanks,
Chris Beall
 
D

dorayme

From: Chris Beall said:
On Windows, I use Notepad to create HTML from scratch.

Today my daughter asked me what to use on a Mac. Apparently she has
tried several tools, but has not been able to get any to work. As I
understand her problem, she can create text files, but they continue to
be recognized as only text files, even if given an .html extension. I
vaguely recall that Mac uses a 'signature' or something other than the
file extension to define the type of a file, but...

Can anyone identify a standard (part of an Apple iBook preload) editor
that can be used to create HTML files? If there's a trick to doing so,
please describe the details, as I have no system with which to experiment.

Source code /is/ just text. And it does not matter what you
append on a Mac name in regard to what program it will open in;
double clicking will open the file according to the creator and
file type (this is "under the bonnet" and you need to read up on
this stuff, if you really want to know more ask further... I
will say this here: you /could/ get one of the many facilities
for changing the type of the text file so that it then "becomes"
an IE file or a Mozilla or iCab or Safari or Opera or whatever.
Then it will open in the specified browser. But I would not
advise this. The point about the source text is that it is
independent of any particular browser. Leave it that way! It is
then easy to modify and available in the text editor program you
prefer to work in.

In the meantime your daughter will do this: She will create a
text file (Simpletext or whatever will do) and append the .html
after it (this is for a different purpose to /merely/ opening
the file) and drag the file with the mouse over any open browser
window or any browser app icon. Or (more bothersome) open a
browser and use file/open and then find the text file concerned
and it will express itself as a website page in the browser.

The best text edtor in my opinion for this sort of work is
BBEdit or its descendants from Barebones. But Simple Text or
whatever is the simple text editor on your daughter's Mac should
be ok.

-- dorayme
 
U

uranther

On Windows, I use Notepad to create HTML from scratch.

Today my daughter asked me what to use on a Mac. Apparently she has
tried several tools, but has not been able to get any to work. As I
understand her problem, she can create text files, but they continue to
be recognized as only text files, even if given an .html extension. I
vaguely recall that Mac uses a 'signature' or something other than the
file extension to define the type of a file, but...

Can anyone identify a standard (part of an Apple iBook preload) editor
that can be used to create HTML files? If there's a trick to doing so,
please describe the details, as I have no system with which to experiment.

Thanks,
Chris Beall

There is always gVim :) It has nice syntax highlighting and can be
efficient if you know how to use it.
 
C

Chris Beall

dorayme said:
Source code /is/ just text. And it does not matter what you
append on a Mac name in regard to what program it will open in;
double clicking will open the file according to the creator and
file type (this is "under the bonnet" and you need to read up on
this stuff, if you really want to know more ask further... I
will say this here: you /could/ get one of the many facilities
for changing the type of the text file so that it then "becomes"
an IE file or a Mozilla or iCab or Safari or Opera or whatever.
Then it will open in the specified browser. But I would not
advise this. The point about the source text is that it is
independent of any particular browser. Leave it that way! It is
then easy to modify and available in the text editor program you
prefer to work in.

In the meantime your daughter will do this: She will create a
text file (Simpletext or whatever will do) and append the .html
after it (this is for a different purpose to /merely/ opening
the file) and drag the file with the mouse over any open browser
window or any browser app icon. Or (more bothersome) open a
browser and use file/open and then find the text file concerned
and it will express itself as a website page in the browser.

The best text edtor in my opinion for this sort of work is
BBEdit or its descendants from Barebones. But Simple Text or
whatever is the simple text editor on your daughter's Mac should
be ok.

-- dorayme
dorayme,

OK, I think I'm getting closer. Let me repeat what I think you said and
see if I got it right.

Let's take the simplest case possible: I want to create a new web page
from scratch. Keep in mind that I have no Mac in front of me and don't
know the correct terminology, so I'll use Windows terms and you can
correct me where the Mac terms are different.

I open Simpletext and create a New file. I type in my HTML. I Save the
file, naming it xxx.html.

At this point, although I've NAMED the file xxx.html, it is still just
TEXT to the Mac OS. Unlike Windows, which associates file extensions
with an executable program, Mac has a separate function to do this.
Simpletext itself does not contain the logic to do this, i.e. I can't
say Save As HTML from within Simpletext.

Instead, I can either:
1. Drag and drop the file on the application that I want to associate
it with, in this case Safari.
2. Open the application I want to associate the file with, then, using
that application, do a File, Open and select the target file.

This will establish the association for THAT SPECIFIC FILE, but will NOT
define an association for all files with the same file extension (unlike
Windows).

Once I've established this association, I can then just click on this
file in the future and it will, by default, open in Safari.

OK, how far off base am I?

Thanks,
Chris Beall
 
L

Leonard Blaisdell

Chris Beall said:
On Windows, I use Notepad to create HTML from scratch.

Today my daughter asked me what to use on a Mac. Apparently she has
tried several tools, but has not been able to get any to work. As I
understand her problem, she can create text files, but they continue to
be recognized as only text files, even if given an .html extension. I
vaguely recall that Mac uses a 'signature' or something other than the
file extension to define the type of a file, but...

BBEdit is the Cadillac of text processors on the Mac, and HTML files can
be opened by any browser you have installed by simply selecting it in a
menu in BBEdit.
Now for the tough part. As I understand it, the file extension doesn't
open a default app for your daughter other than the program that created
it. Extensions don't mean squat to Macs less than OSX unless the file
association is changed internally, or the file is opened and 'saved as'
in a current app. The file is associated with the application that
created it. You drag and drop the file onto the application you want it
to run in, generally.
But with a web browser, make sure the file has an .html extension or the
browser won't read it properly. Type it in text.editor.whatever, make
sure it has a .html filename ending, and drag it to any.webbrowser you
have. From there, even relative links work for any directory (or folder
in old Mac terms).
To summarize, tell her to drag her file with .html extension onto any
browser icon she has on her system.
In reverse, if she has saved her file as say an IE file with 'save as',
she won't be able to open it in a text editor unless she drags it onto
the text editor icon.
All simple if you are Mac oriented. Not so intuitive otherwise.
OSX has other options to create file associations. For instance, when
opening a HTML file, do you _always_ want it to be opened by a web
browser? That'd make it hard to edit. But you can do it trivially in OSX
if you want to. You can open a jpg in a music player if you're nuts but
know how to.

leo
 
A

Alan J. Flavell

Now for the tough part. As I understand it, the file extension doesn't
open a default app for your daughter other than the program that created
it. Extensions don't mean squat to Macs less than OSX unless the file
association is changed internally, or the file is opened and 'saved as'
in a current app. The file is associated with the application that
created it. You drag and drop the file onto the application you want it
to run in, generally.
But with a web browser, make sure the file has an .html extension or the
browser won't read it properly. Type it in text.editor.whatever, make
sure it has a .html filename ending, and drag it to any.webbrowser you
have. From there, even relative links work for any directory (or folder
in old Mac terms).

But for best results, run a local Apache web server, and browse the
files via localhost (127.0.0.1). That's what our chief Mac-OSX-based
web author does, and it avoids lots of different shortcomings that he
could not solve when he was trying to browse the local file system
directly.

Apache then controls the file types issue, and the browser correctly
responds to the MIME types as the HTTP protocol demands - not to some
incidental file association defined by the OS. The httpd environment
can be as close as you bother to make it, to the production server
where the files will ultimately be served out. Highly recommended.
 
L

Leonard Blaisdell

Alan J. Flavell said:
But for best results, run a local Apache web server, and browse the
files via localhost (127.0.0.1). That's what our chief Mac-OSX-based
web author does, and it avoids lots of different shortcomings that he
could not solve when he was trying to browse the local file system
directly.

But that doesn't work for OS9 or less or in what I read the context to
be. I'm not sure which version of the OS his daughter is running. And it
doesn't address the local issues of .txt or .html opening up in what. I
thought that was what the issue was. Drag and drop the file you want on
the application you want, and if the app doesn't recognize it, it won't
open.
I run Apache as (127.0.0.1) on my Mac to illustrate to me what my
scripts will look like in my HTML when I upload them to a UNIX based
ISP. I even have PHP and MySQL available. Wow! Then again, I'm running
OSX.
Apache then controls the file types issue, and the browser correctly
responds to the MIME types as the HTTP protocol demands - not to some
incidental file association defined by the OS. The httpd environment
can be as close as you bother to make it, to the production server
where the files will ultimately be served out. Highly recommended.

Agreed.

leo
 
C

Chris Beall

Leonard said:
(snip)

But that doesn't work for OS9 or less or in what I read the context to
be.

(snip)

Alan & Leonard,

Thanks for both suggestions. She's on OS X (I think it's version
10.2.8, but I don't seem to have written that down anywhere).

Looks like drag-and-drop will solve her immediate problem and let her
see what her HTML will actually look like, but the Apache suggestion is
better as a long-term approach. I don't think she's at that level of
competence yet. And I don't know what sort of server this work will end
up on, nor how she will get it there. All part of the adventure...

Thanks,
Chris Beall
 
D

dorayme

From: Chris Beall said:
dorayme,

OK, I think I'm getting closer. Let me repeat what I think you said and
see if I got it right.

Let's take the simplest case possible: I want to create a new web page
from scratch. ...

I open Simpletext and create a New file. I type in my HTML. I Save the
file, naming it xxx.html.

Yes.

At this point, although I've NAMED the file xxx.html, it is still just
TEXT to the Mac OS. Unlike Windows, which associates file extensions
with an executable program, Mac has a separate function to do this.
Simpletext itself does not contain the logic to do this, i.e. I can't
say Save As HTML from within Simpletext.

Pretty well. The text file is a text file and it will open as
text in any text program according to the "under the bonnet"
Creator and File Type 4 digit names associated. with this file.
(Simpletext is "ttxt" for creator and "TEXT" for file type. If
you give it a browser creator and file type. If this is changed
to the BBEdit codes it will open in that text editor instead.
And, to home in on one of your main points of interest, if you
change it to "MSIE for creator and "TEXT" for type, then it will
open in IE as a website page (assuming the text is well formed
as HTML). The creator and file type tells the OS to open it in
IE. IE has built in intelligence to open it as a webpage (no
matter what the over file name is). Not Mozilla though! Mozilla
will open it as a text file - given the right creator and file
type codes - ok! You know, you see in the browser window the
actual text: <html> <head> blah blah.... But - and here is the
reason I said for your daughter to put .html on the end of the
name - Mozilla will open it as a webpage if it has .html
appended. This last is a peculiarity of the intelligence built
into some or all Mac Mozillas, it has little to do with Mac OS.
So, it is a good idea and does no harm to anything to append
..html to web text files.

There are further oddities and things to note. Where do I stop?
In IE one can call it anything, even an alias on the desktop
(shortcut) works, it will open it as a webpage. But not Mozilla!
Mozilla wants the extension.
Instead, I can either:
1. Drag and drop the file on the application that I want to associate
it with, in this case Safari.
2. Open the application I want to associate the file with, then, using
that application, do a File, Open and select the target file.

This will establish the association for THAT SPECIFIC FILE, but will NOT
define an association for all files with the same file extension (unlike
Windows).

Once I've established this association, I can then just click on this
file in the future and it will, by default, open in Safari.

Not really I am afraid. The creator codes and file types are
serious things in the Mac world. You can't simply change these
codes by using the files in some particular way.

I have described how to solidly change the program you want to
open any file with. You need for this a little app or a
facility. Typeshuffler is good, Norton's and other programs have
various facilities, ResEdit can do it. But read on...

I have recommended your daughter forget all this. Don't bother.
Leave text files as text files. Keep them in a folder along with
all the website associated folders like images for the site. You
would not normally want to change a file.jpg file to be an IE
file (though you can and it /will/ then open in IE). No, leave
..jpgs as they are and .html as they are (jpgs may be openeable
in QuickTime if that is what the creator code is set at) and
..html text files (openeable in Simpletext). If the jpgs and html
files (as links) are referenced in the text files, they will
work in the browser as you expect.

I know it is hard to grasp for Windows folk. If you do really
"associate" - by way of creator code and type "under the
bonnet" changes - text files with browsers apps, you then will
/lose/ the easy access to the text files! Where will they be
found? You can open the webpage and open the source in View
Source etc but then you need to be able to change the text and
there /may/ be ways of setting things to do this. But it is not
how I work or a lot of Mac people work. Don't worry about
associations so that "next time" it will open in a browser. It
is dead easy to drop the file.html over a browser icon or window
everytime you open your website. You don't have to do this more
than once per session. All the other html pages on the site will
be linked from within the browser and be found automatically,
just as they are when accessing text files on a server. My
websites on various servers look like this: index.html,
main.css, file.jpg, etc etc - (and logically ordered in folders
which are reflected in the paths written into the links in the
text files ) This is what is on my machine, and it is what is on
the server. All just text files and jpgs... plain and simple.
When accessing the website via a url (also, by the way, possible
off line to one's own files), the browser has the intelligence:
it looks for the file mentioned or else for something called
index.html and away you go...
 
D

dorayme

From: "Alan J. Flavell said:
But for best results, run a local Apache web server, and browse the
files via localhost (127.0.0.1). That's what our chief Mac-OSX-based
web author does, and it avoids lots of different shortcomings that he
could not solve when he was trying to browse the local file system
directly.


This is interesting. Any examples of shortcomings avoided?
 
D

dorayme

just ignore the sentence "If you give it a browser creator and file type."
in my post last post "to" the OP, forgot to delete it, sorry...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top