danjah
danjah

Reputation: 3059

What software/webapp can I use to edit HTML pages?

Ok, my question's not as broad as it seems, to summarize 8 months effort on my part:

I create chunks of re-usable, extensible XHTML which degrades gracefully and is all kinds of awesome. Most of my code chunks are provided a Javascript interaction layer, and are styled with CSS. I set to work pulling my code chunks into Dreamweaver as 'Snippets' but they're unintelligent chunks of text. Also, once inserted, my beautiful code chunks get mangled by the non-techies who are the ones actually using Dreamweaver.

Also, because they're unintelligent snippets, I have a line of Javascript which configures the code chunks when initialised - see this post for further detail on my approach. But currently I have to replicate a single code chunk as many times as there are configuration options (so each 'snippet' may only differ from another of the same type by ONE config value). This is incredibly lame, it works, but its lame and time-consuming for me to re-deploy a bunch of snippets and hard for my team to remember all the variations.

So I have a series of requirements, to my mind, as the most likely things to solve in any system I put my chunks into:

  1. The inserted code is not modified at insertion time, by the system
  2. The code to be inserted needs to allow config options
  3. I'd be overjoyed if, once inserted, the only editable parts are text nodes
  4. Copy and pasting these whole objects
  5. A clean interface from which to choose from my range of code chunks

It's a serious list of requirements I presume, much searching led me to Kompoze and its 'Smart widgets' which, according to a random post from 2004, suggests XUL files can be created and extensions can be made which sounds vaguely like what I want. The text editor itself was less prone to destruction, when compared to Dreamweaver.

So yeah, I've chased too many rabbits on this one, keen as for a solution whether Software+extension, or Webapp.

EDIT: Btw, it did occur to me to investigate a highly customised TinyMCE instance, but I don't know feasible that is, and unless there's some sweet backend available, I'm stuck with local editing of files for now - not even on a web server...

To my mind the best answer to this question will solve most of the above, and provide some general workflow advice alongside the suggestion(s).

Upvotes: 2

Views: 622

Answers (3)

simon
simon

Reputation: 16280

I would go with a solution based around the excellent markItUp! editor. It's very simple to extend it to cope with the requirements you have. You can add sophisticated logic, and it's nice and shiny.

I'd probably combine it with Jeditable for the inline node editing, and build the whole thing on top of Django, for ease and convenience. Completely customisable, surprisingly easy to work with, portable and cross-platform, and easy to set-up for off-line use. Oh, and all free and open-source.

Upvotes: 2

Dour High Arch
Dour High Arch

Reputation: 21711

Have you considered server-side includes where the directive is either a generated page or a shell command? E.g.:

<!--#include virtual="./activePage.aspx?withParam1=something&amp;param2=somethingelse" -->

or

<!--#exec cmd="shellCommand -withParams" -->

You can reuse the same page or command, and provide parameters specific to each usage in each XHTML page.

Upvotes: 0

mtelis
mtelis

Reputation: 674

What do you think of this approach:

<div class="thing">
    <elements... />
    <script type="text/javascript">
      document.write('<span id="thing' + thingNo + '"></span>')
      new Thing().init({ id:'thing'+thingNo; });
      thingNo += 1;
    </script>
</div>

Of course, you'll have to change Thing().init so that it would initialize the parent (instead of current) node.

Upvotes: 0

Related Questions