Hello.

I am thinking about writing a somewhat primitive HTML editor (to get more advanced as needed/as I can manage). The goals are to be able to (once given a base directory where the webpage is stored) have some way of accessing each of the html files. These would be presented to the user in some way (a tree-type structure, a tab interface, etc.). The user could select some given file, and it would be entered into a viewing window (the defualt being the index file in the base directory). This window would parse the document and in a separate window somewhere display the results in some way (distantly related to something like Visual C++ 6, if anyone is familiar with that). Also, the HTML tags/text in them/non-html content would be in some way altered -- font/size/color/combo -- to make it visually stand out to the user, and possibly an indentation system used.

Well, anyway, before I get too involved in details (most of which I haven't thought out, as I'm just beginning to toy with this idea), I'll say why I'm posting here. There's a lot of intelligent people in this community, many of which use HTML on a regular basis (and presumably most/all which use perl on some basis), and I imagined it would be a great place to gather ideas/tips/suggestions/preferences (e.g., if you'd like to see something in an editor that you would find helpful, just say something)

I'll post the resulting code on this site (and possibly periodically along -- definitely if I run into problems I have trouble fixing!).

I will be developing this application so that people not very familiar with HTML (beginners/those just learning) can have an easier time with it, but also with an interface that allows more advanced users to harness the power they need (CSS/Javascript/etc., as the case may be). I don't have tons of time to work on this, but if there's interest out there to make this, I'd be glad to accept any help or participation (i.e., we'd co-work on the project; the more the merrier, and more importantly, more features which would be enabled).

If the latter's the case, just say.

I plan to use Tk and HTML::Parser as a start. (I'm not familiar with the latter, if anyone knows a good site that explains its features, though I'll be downloading it shortly and will learn more about it then.) Again, all suggestions and help welcome!

Replies are listed 'Best First'.
Re: HTML Editor: a project
by FoxtrotUniform (Prior) on Jun 25, 2002 at 17:23 UTC

    That sounds ambitious. Good luck.

    On the subject of interfaces: I urge you not to cater too blatantly to the "first-time user". By all means, keep the window simple and nonthreatening, with buttons and menus for people who haven't yet mastered your editor, but make sure that your more advanced users have plenty of power at their fingertips, with an interface that doesn't get in the way. As much as possible, let the user configure the editor the way they want it: this way, you can provide a simple, user-obsequious default interface without driving away people who want to do more faster, and are willing to spend some time learning how to do it.

    One major advantage to a pure-Perl editor is the opportunity to run the text through arbitrary Perl code on the fly, very easily. Give your users the chance to take advantage of the perl process that's already running.

    --
    The hell with paco, vote for Erudil!
    :wq

Re: HTML Editor: a project
by kvale (Monsignor) on Jun 25, 2002 at 19:48 UTC
    On the perl/Tk side, check out Tk::Tree for the hierarchical display or Tk::NoteBook for the tabbed display - they are both easy to use. Syntax highlighting should be easily doable using the tagging support available in a Text widget. For a library that implements a basic editor, check out Tk::Workspace.

    -Mark
Re: HTML Editor: a project
by thraxil (Prior) on Jun 26, 2002 at 03:36 UTC

    do us all a favor and try to write your editor so it produces html that actually conforms to the relevant standards. if you can do that, i, and a large community of web programmers would be very impressed.

    this means (among others):

    • inserting the correct DOCTYPE
    • attributes="quoted"
    • using tags for what they semantically represent rather than for visual effects (eg, <blockquote> should only be used around a blockquote, not just as a generic way to indent a paragraph)
    • proper closing and nesting of elements. (<p> has a closing tag and goes around paragraphs, not between them).
    • your application should not ever produce deprecated or proprietary tags like <font> or <marquee>

    most of the existing html editors (dreamweaver, frontpage, golive, etc) fail pretty miserably on these kinds of things.

    anders pearson

      Just an interjection: a problem with using tags for semantical rather than visual representation is that the average HTML monkey at the keyboard will use these tags for their optical effect anyway. If he sees that <blockquote>s are displayed invented, he'll use <blockquote>s to indent things and the only way to prevent that would be to ask him about five times in a row whether he is indeed using the tag for a quote. The concept of semantical markup vs visual layout is a distinction that has to take place in the author's mind and cannot be made by his tool. Of course, the tool should make the distinction possible; but it can't enforce proper use of HTML. Sadly.

      Makeshifts last the longest.

        yeah, it'll never be a replacement for the user being educated about proper markup techniques. but i think that an editor whose overarching principle is generating correct semantic markup with presentation secondary would go a long way. at the very least, it would then be a useful tool for those authors who do care more about correct markup.

        what i'm saying is instead of having an 'indent paragraph' button that just generates a blockquote, you would have a 'blockquote' button and maybe somewhere else an actual 'indent paragraph' button which applies the right <acronym title="Cascading Style Sheets">CSS</acronym> rules to the selected paragraph.

        i guess what i'd like is sort of an html oriented LyX.

        anders pearson