Why does Nvu change my markup?
By glazou on Tuesday 29 March 2005, 07:57 - Nvu - Permalink
In answer to a long thread about Nvu and its markup quality on our public mailing-list, I have posted a long answer that deserves to be cross-posted here. Click on the link below to read it.
People, I have carefully read the whole thread about changing code, but did not contribute, being too busy on forthcoming v1.0PR. The reason why Nvu modifies a little bit the code is INTRINSICLY linked to XML parsing rules. So please understand that the problem exists BECAUSE Nvu is a conformant editor that cares about the standards. Other famous editors - I won't name them here - are not based on an XML parser. 1. imagine you are typing, in the Normal View, ten long paragraphs of text. Those ten paragraphs do not contain <br> elements. The only line breaks are created by the paragraph's default style itself. So the WHOLE markup for those paragraphs is NOT broken into lines and if you don't include some sort of "intelligent" line breaking, the whole markup WILL STAND ON ONE LINE ONLY!!! Question1 : who wants that? Answer1 : nobody, trust me, nobody... Question2 : what should Nvu do? Answer2 : insert line breaks in the markup. 2. you open with Nvu a document you made by hand. I mean you wrote it in a text editor caring about indentation, whitespaces, hyphenation and line breaks. Obviously, you're some sort of a geek. Oh possibly a not-so-geeky geek, but still. Compared to the vast majority of Nvu users, you **can** switch to the Source View and understand its contents. Obviously too, you don't want your indentation and line breaks to be modified. This is important to you because you WILL switch back at some point to the Source View or a text editor and you want the document to have your usual coding style. Question1 : how does it fit in the model of item 1? Answer1 : that's simple, it does not fit at all Question2 : wait, could we have a mode "reformat" for item 1's problem and a mode "never touch" for our need here? Answer2 : so in that "never touch" mode, and if you type the 10 paragraphs described above, you'll end up with a suppppppeeeeerrr-loooooong line. I can bet a box of cookies, you're going to complain about that too! Question3 : but you could do that long line and add a "wrap lines" checkbox option in the Source View but not in the serializer for Save? Answer3 : that is __very__ hard, because the Source View is based on the serializer too. Basically, when you switch to Source or Save the document, the process is the same. Only the final output location differs, a widget or a file. I hope you all see the problem is INCREDIBLY complex. I hope you all also see that I **do** care about the problem. I also find painful to have my markup modified, but I also find TERRIBLE to create new paragraphs that are not wrapped. Please be patient. Nvu only reaches a 1.0 status, and you're expecting the quality of Dreamweaver MX. I perfectly remember Dreamweaver 1. Let me tell you, Nvu is better. MUCH better. Its Site Manager is a bit weaker, but its rendering engine, its CSS support, its extensibility already go FAR BEYOND what gave DW1. For the first time, Linux and Mac users get a really **free** open-source Wysiwyg editor. People who should not have to learn the markup language can put their hands on a POWERFUL and SIMPLE tool to make their web page, and it doesn't cost a penny. Let me please THOSE people first, because THEY need it. Geeks can hard-code. The others can't. We're _that_ close to satisfy the beginners. After that, we'll try to please the geeks with an acceptable compromise, if we can :-) Thanks, </Daniel>
Comments
David, you're right! I use Dreamweaver since version 2 and I think that NVU is better than DW 2, too!
I get pretty attached to stuff I format and the way I format it whilst programming. What I think *I* need to do is, define my formatting rules formally. So e.g. in a C program, I could add a call to GNU indent into my Makefile rules before committing. If people who want to roll their own (X)HTML and use NVU do a similar thing they never need see the output of nvu.
As a real geek, i hand-code my html files with Scite and it does the job nicely. I think Nvu should focalize on "normal" users instead of trying to please the geeks who, however will always return to their cherisched text-editor.
(sorry for my poor english, i'm french)
Hello Daniel,
That is a *very* interesting response to the main concern of developpers.
Now, at least, we know you care about the problem :)
Another thing : I am absolutely confident that NVU is intrinsicly better than Dreamweaver (all versions, DW CSS support is awful). That's why people (and I among them) have been so demanding. You certainly know the saying "Qui aime bien, chatie bien" ;)
I wish you all the best of luck,
Bruno
NVU is much better than Dreamweaver MX 2004 Pro (yeah, the latest). Why? It's based on Gecko engine :).
This makes NVU perfectly render and edit ANY advanced page with full CSS layout.
NVU also got a much better CSS editor :). I hope NVU will have a better source code editor (auto-complete tags and attributes).
I agree with giz404, Nvu targets normal users, geeks have Emacs/Vi or bluefish/screem/quanta+/gedit which are good enough for that purpose...etc If they want to use Nvu, they have to deal with it. Besides, it could be the work of a specific extensions not of the core software.
Sinon, on risque de finir avec une usine à gaz qui fera peur aux utilsateurs non expérimentés.
Mozilla Firefox 1.0 > Internet Explorer 6.0.
Nvu 1.0 < Dreamweaver MX.
Daniel, what mean here is that saying that Nvu 1.0 is better than Dreamweaver 1.0 is idiotic nonsense. The quality of products aren't decided by their version numbers. Quality is decided by the times. And you have to look at usability too.
Firefox is a lot more usefull / user-friendly than Internet Explorer.
Nvu is a lot LESS usefull / user-friendly than, let's say, Frontpage 2000. (Or at least for coders it is. At least Frontpage is more configurable then Nvu, and it has a drag 'n drop compatible site manager, and it doesn't screw my PHP includes/templates up if I configure it properly.)
If Firefox managed to beat Internet Explorer, then Nvu should be able to do the same with at least, say, Frontpage 2000, right? (Frontpage 2000, after all, is almost as old als Internet Explorer 6.0 is...)
And the problems you noted aren't even the real problem with Nvu. The REAL problem is that is throws in <HTML>, etc. code in .tpl files for example.
The solution: an optional text-only parser that can be enabled/disabled and configured from the options etc...
But anyway, I'm sure Nvu 1.0 won't find a lot of fans right now. It will still be a bit too complicated for the newbs and useless for the professionals. Unless you decide to delay it 6 months or so. (That, in my opinion, would be the wisest decision.) So that you can actually finish it of to create a Nvu that actually deserves to be version 1.0.
Not that you will listen to me, and I can hardly blame you either. But don't expect any serious coders to use Nvu.
Daniel, I love NVU. I use it as a backup whenever I want to do forms and can't remember the markup. I'd use it for a lot of other stuff too, but i have one problem, and it's related to what you're talking about.
I have some html in my pages that looks like this;
<b class="rtop"><b class="r1"></b><b class="r2"></b><b class="r3"></b><b class="r4"></b></b>
I know it looks weird, but it's because i'm using CSS to make rounded windows that work in both internet explorer and firefox. That little bit of code is a lot smaller than the pictures/tables setup i'd have to use otherwise.
Anyway, when i save my page, this code gets deleted! I can understand it's just nvu optimising my code, and seeing as there is no contents, it's getting rid of it. But sometimes you have elements for their layout, rather than their contents! I've used styled divs to make boxes before! Is there anything I can do about nvu's behaviour in respect to these elements?!
Thanks for a great editor!
Anko
Yogarine, coders aren't Nvu's targeted users... especially "serious" coders... those ones use vi/emacs or another barbarian tool... And yes, probably six more months of development would be useful... Wait for 1.x where x > 0 versions, they will have more dev time behind. Disruptive Innovations has been contracted by Linspire, there is probably a red line. The Open Source "dogma" says : "release soon, release often"... Too bad, Mozilla code is much too complicated for "simple users" to be able to help without a *very serious* formation... And even with that handicap of people, even coders, not being able to help much with the code (and remember, it's probable that very few project followers are advanced C++ coders...), Daniel releases new Nvu pre-versions with regularity, and is listening to requests and bug reports... requests and reports that probably sometimes look like more work, no help... except to find defaults, problems, things to fix, to modify... and he has to sort all those things, answer to the most important, and continue his job in the same time.
My opinion is... Today, Nvu 0.9 is more usable, potentially more useful, but far less polished than Dreamweaver 1, 2, and even 3. I won't compare it to FrontPage, its goals are totally different : one has been made to be easy to use and to push users to use IE proprietary extensions, the other is XML-oriented and tries, before all, to make it possible to any user to make a website with good code inside... and it's not the work of some big team inside a big big editor...! And any *serious* coder will never use a tool that generates shity code, like FrontPage is... I am a coder, I won't use it much, but I think this project is one of the most important in the Open Source world today... AND BECAUSE OF THAT IT HAS TO RELEASE A STABLE VERSION SOON. Even with less functionalities than many do expect... Certainly Nvu 1.0 won't be perfect. But I am absolutely sure it will be good enough. And what the hell are you complaining about ? It's free in both senses of the word, you have the right to fork or to patch it if you think you can do better, you can make suggestions for coming versions...
By the way... Just like you, I'm sure too Nvu 1.0 won't have many fans... Just like Mozilla 1.0 did not have many fans either... It won't make a failure of it. With browsers, when Firefox was released, things changed... but would never have been able to change that much without Mozilla SeaMonkey opening the way. In my opinion Nvu 1.0 will be the Mozilla 1.0 of editors. The precursor... I am confident about the evolution of the project... It will have a great future. Wait and you will see...
Hi Daniel,
Ok, got you for point 2.
I do like to see my code alligned the way I want, so I can always read it even if I'm stuck to using vi. I developed a coding practice while coding in C, and I like to look at a page of code and see the big picture right away, without having to read all the lines ... My coding practice/technique often allowed me to see bugs right away after opening the file. A lot of times, just reformating a piece of code written by somebody else was enough to extract most bugs
I'll wait for the right version.
BTW, are you still planning that big Parisian beer party for the launch of NVU 1.0 ? If so, count me in !
Cheers and keep up the good work.
Richard
I do not have a problem with the reflowing in general, as I quite understand the basic problem. I /am/ puzzled that the margins of the flow are so very narrow -- 20-30 columns or so -- and I've noticed that the reflow breaks TITLE, which is an unquestionable Bad Thing.
Will NVU continue development after 1.0? I only ask since I had read the other day that David was considering retiring from the project?
I hope not since I'd really like to see this project go forward.
The irony is that I never would have learned to be an HTML geek if NVU was around 3 or 4 years ago when I first developed the need to make simple webpages. I liked Composer, but I hated having to launch it from within Netscape, which was sluggish. Back then the last thing that I ever wanted to do was write a line of code (now I do it every day). But I still remember the view that I used to have of hand-coding documents. For someone without any experience, it's daunting.
We should all remember that. There are people that occasionally need to make a webpage for work, for school, for personal use, etc. that don't want to learn HTML. Now they can download NVU and make nice looking page or two without having to. And luckily for us geeks, the code that NVU will generate for them will be standards compliant. No other editor can say that.
I use NVU to make basic to intermediate HTML documents.
For these types of documents, I don't really care about the formatting of the code, and I'll probably barely even look at it.
Editing via FTP with NVU is horrible. It's impossible to create .PHP (or another) files, to move files through directories. The PHP files are ALWAYS damaged, and if you publish a PHP file it saves all gif PHP-tags O_o
Après avoir essayé une tonne d'éditeurs de texte et de logiciels WYSIWYG je trouve Nvu très mature et je n'utilise presque plus Dreamweaver.
Maintenant, je code directement en XHTML et CSS avec un éditeur texte. Je n’utilise plus de WYSIWYG de façon intensive, car aucun de ceux-ci n’est parfait dans le positionnement du visuel; Dreamweaver est très loin de me satisfaire sur ce plan.
J’utilise un logiciel WYSIWYG seulement pour la saisie de texte et la transformation automatique des caractères français en ISO-LATIN 1, pour créer des tableau ou des formulaires. Quand vient le temps de coder le visuel et le positionnement CSS je me tourne vers BBEdit ou TextWrangler.
Ceci dit, je déteste quand un logiciel reformatte le code, sauf à la ligne précise ou se trouve le curseur en mode WYSIWYG. Ainsi, si je me retrouve avec un paragraphe de 12 lignes j'aime bien que mon éditeur de texte l'affiche sur une seule ligne. Si j'ajoute manuellement des fin de ligne à mon code, j'aime bien que mon éditeur de texte ne touche à rien.
De même pour les indentations et les espaces.
Mon éditeur de texte favoris me permet toujours de choisir l'option Wrap Long Lines en cas de besoin.
Je ne me suis pas encore habitué à utiliser Nvu, bien que celui-ci est nettement supérieur à Dreamweaver pour le positionnement et le visuel. Cependant, comme je travaille surtout en mode source, pour le moment je reste avec le combo Dreamweaver et BBEdit. Bien que j'ai commencé de temps en temps à créer mes structures XHTML dans Nvu.
J'espère que vous trouverez une solution afin de permettre à Nvu d'être plus conciliant avec le format du code source.
Félicitations pour votre bon travail!
First thanks to Disruptive Innovations (specially you Daniel) and Linspire that bring us NVU in the first place.
Many people criticized NVU because it is incomplete, unmatured, etc, etc. Remember, Nvu hasn't even get to a 1.0 release, so comparison with Dreamweaver MX, and Frontpage 2004 which both have been in design for a lot more time is not fair. And also the money and resources Macromedia and Microsoft assign to their proyects.
In addition, the fact that NVU itself is a cross platform product, which means that it's more difficult to made than, for example, a Windows or Mac only product.
If you count the price/performance ratio that NVU offers compared to any other product, it is a deal any day.
@ Le Saint Bernard
Okay, you convinced me. ;) Lot's of things you said there really made sense. I'll just be patient from now on... :P
Ok, reflow is accepted, but only if you add
Insert line break in HTML code at position [80]
in Edit > Preferences somewhere. Make the
default 80 (not 30 what it is now), and allow
us geeks to enter 240 (I have a 1920x1200 monitor
anyway). There is a justifiable need for long lines.
Reflow at the current line width 30 annoys users, with
reflow at 80 nobody will notice and the above proposal
of user-defined will please all.
Cas
I don't think Nvu is perfect either... though it's the only wysiwyg editor I use (mainly because of the good CSS support). Like giz404 I like to use SciTE, which I can link to htmlTidy to get the nicest, most readable XHTML code as possible.
I understand (at least some of) the technical difficulties behind that serialization, but I would prefer:
1/ to have line breaks in the (x)html code only after tags: I think it would be much more readable, even with long lines of text
2/ to be able to write stuffs like <a href="{ref}">{link}</a> whithout Nvu escaping it as <a href="%7Bref%7D">{link}</a> (I don't even tell about stuffs like <img src="<?php echo($source) ?>"> ...)
3/ to have marks in the normal view for all kind of scripts (not only php), since even FrontPage Express does it :-(
Oh yes, and I would prefer not to have any bugs in Nvu, to have the same site manager as in DW, and another president in the US ;-) but I'll ask Santa Claus for that.
Personnally I use companion tools for everything that Nvu does not well.
Concerning the poor code formatting, it got me mad until I finally use command-line tools like htmlTidy and fart.
I designed an extension to get a Launchy menu directly in the site manager, so reformatting the code only takes another click
screenshot: leocms.free.fr/Nvu/NsmCon...
extension: leocms.free.fr/Nvu/Launch...
[thread en français] geckozone.org/forum/viewt...
Hope it'll help some users...
IMHO Nvu is ok for "production use" with appropriate external programs - mainly, a text editor and htmlTidy ;-)
Daniel,
I have introduced Nvu to a lot of people who were basically only interested in producing screen-shots and the like. They almost always love it. I think you need to keep concentrating on user-friendliness. The geeks can use whatever tool they are comfortable with, but for non-geeks Nvu is great!
Like many have already written before me, I concur 100% that comparing Nvu to Dreamweaver is a flawed comparison, no matter which way you look at it.
Nvu is the FIRST FREE (as in speech), POWERFUL, USER-FRIENDLY wysiwyg web editor for windows, mac and *nix.
^^^This sole sentence is worth its weight in gold, and it is heavy.
Dreamweaver will never come close to what Nvu is today, it will never be able to touch it, not even come close.
Nothing beats the combination of user-friendliness and "libre".
And, my god, extensions!
I open up Nvu every time I need to quick fix a page, and I am glad I have it every time I use it. I don't have the money to invest in a powerful web editing suite, what we have here is perfect for me, and mom and pops.
Encore une fois, merci Daniel. Ton travail est précieux.
J'ai appris à coder à la main après avoir réalisé tout un site avec Adobe GoLive et avoir vu le résultat sous Firefox.
J'ai ouvert Dreamweaver une fois, et je l'ai refermé tout de suite - trop de fenêtres, de palettes, etc. pas envie de m'auto-former pendant une semaine.
J'ai ouvert Frontpage une fois, et je l'ai refermé tout de suite - mauvais échos, et me semblait archaïsant.
J'ai ouvert Nvu plein de fois, et je l'ai adopté, parce que, à mon sens, les éditeurs sont là pour faire gagner du temps à "ceux qui savent" et donner envie d'apprendre le code aux débutants.
Or, Nvu a un éditeur de CSS ultra-efficace, une très bonne ergonomie (claire et ordonnée), et c'est aussi un bon pédagogue pour les curieux, par son respect des standards.
Quant aux changements qui interviennent automatiquement dans la source, ceux que ça incommode ont en général les moyens d'y remédier. Il ne faut pas oublier que les logiciels, c'est un peu comme les médicaments: un compromis entre l'avantage et l'inconvénient, entre le bienfait et l'effet secondaire. Faut que ça fasse plus de bien que de mal. Et Nvu fait beaucoup de bien.
Enfin, si Nvu s'adresse d'abord aux "débutants", alors je donne 9/10 (faut laisser de la marge), parce qu'il leur évitera la plupart des erreurs typiques des 'pages persos' (mise en page pleine de tables, code extra-lourd, tentation du javascript copié-collé, etc.). Une excellente chose pour un web standard et unifié - que les adeptes du bloc-notes apprécieront à sa juste valeur.
About item 2, if someone preferred "never touch" mode and decided to see a very long paragraph in source code (why he would?), let him suffer his own decision! A geek won't care if he see a very long line, and a beginner won't use the "never touch" mode. So just let "never touch" mode do what it ought to do.
On the argue about programmers not using Nvu. I am a programmer. I have been using Mozilla composer for a long time and now Nvu. I love to use normal mode and let the editor do most of HTML codes for me and I only modify these codes a little bit in source mode for my special needs. I love Nvu's tagging of comments in normal mode since my project relies on comments much. Unfortunately Nvu 0.90 has a serious bug on the comment tag (forum.nvudev.org/viewtopi... and it moves all comments in a line to front (forum.nvudev.org/viewtopi... which can be destructive to my work.
Anyway, Mozilla composer and Nvu are my favorite WYSIWYG editors because they do not have extra features I don't need and they are fast and useful. I sure hope Nvu is able to eliminate these issues soon.
"....WILL STAND ON ONE LINE ONLY!!!
Question1 : who wants that?
Answer1 : nobody, trust me, nobody..."
?? hä??
Sorry but I need that! OK?
I second the suggestion of a "never touch" mode. I might live with the line breaks in long lines, but the one thing that really, really keeps me from using Nvu is the treatment of the <pre> tag. Why (oh, why) are <br /> tags inserted into the code, and all the lines joined together in one long line? I can't work with that. Sorry.
I believe the 2 problems you mention, Daniel, are not related to each other. If you are editing in Normal mode, and make ten paragraphs, you can still have the <p> and <br> tags inserted into the code, and since the user is editing in Normal mode, that would be expected because that's how "what they see" is coded in XHTML.
However, not reformatting code means not changing code that exists, whether inserted by Nvu or by hand/whatever. To me, it does not mean that you can't add tags while a user is editing in Normal mode so that the rendering of the code results in what the user sees in that mode. It means that once the code is there...don't touch it. I.e., if the user has inserted 10 long "paragraphs" of information by hand or via another editor (they didn't put them there via Normal mode) then Nvu should keep the "paragraphs" as they are.
This doesn't appear to be as complicated as your explanation seemed to imply...