HTML Formatting - html

I have to make a few changes to some unformatted HTML (no line breaks, nothing) and was wondering if there are any web-based or open source tools that will automatically format it so it's easier to read.
Thanks!

Take a look at tidy - overview from the documentation:
When editing HTML it's easy to make
mistakes. Wouldn't it be nice if there
was a simple way to fix these mistakes
automatically and tidy up sloppy
editing into nicely layed out markup?
Well now there is! Dave Raggett's HTML
TIDY is a free utility for doing just
that. It also works great on the
atrociously hard to read markup
generated by specialized HTML editors
and conversion tools, and can help you
identify where you need to pay further
attention on making your pages more
accessible to people with
disabilities.

Check out Notepad++
In the menu, click TEXTFX -> HTML Tidy.

jedit also contains some plugins to do the job. (I think it is also using tidy)

Related

Check which <div>'s dont have a </div>

I recently was handed an old template to make changes to. Its a really long horribly indented one. In the process of adding new design, I seem to have deleted </div> tags in several places, and the whole thing now seems to have taken an entirely new shape. Is it possible to easily identify which <div>'s don't have a </div>. Dreamweaver was good at this, but we don't use it anymore.
Can you please suggest tools, browser add-ons or anything else that can help do this?
The program you are looking for is HTML Tidy
From the documentation:
When editing HTML it's easy to make mistakes. Wouldn't it be nice if
there was a simple way to fix these mistakes automatically and tidy up
sloppy editing into nicely layed out markup? Well now there is! Dave
Raggett's HTML TIDY is a free utility for doing just that. It also
works great on the atrociously hard to read markup generated by
specialized HTML editors and conversion tools, and can help you
identify where you need to pay further attention on making your pages
more accessible to people with disabilities.

WYSIWYG HTML editor for grails gsp files

Does anyone know about a good HTML editor which can be configured in such a way that it is gsp aware?
What I mean is that at least tags such as <g:link> and <g:input> should be displayed as their html equivalent.
Yes I know: a perfect editor is hard to write and it is easier to edit the HTML sources (that's what I do), but there are people who prefer an HTML editor...
Update: yes, I am looking for a WYSIWYG HTML editor with which I can drag'n'drop some html elements to a page without changing the <g:...> tags which might already be contained in the page. In addition, this editor should have some gsp awareness, so that <g:...> tags are displayed in an appropriate way.
Update: still looking for something, so I started a bounty. What I need is something like this plugin: http://code.google.com/p/grails-form-builder-plugin/ but more evolved...
Bounty: not easy to select the right answer for the bounty. None of the answers is a solution to my problem, but I have decided that rschlachter points me in the right direction: a wysiwyg form editor is not the right solution for a developer...
I think there may be a flaw in the process here. You could build the page first in HTML and make any changes there before putting in any gsp elements. While the page is in HTML format people can continue to use WYSIWYG editors and then developers can add in the grails functionality.
It just seems like if you need/want to use a WYSIWYG editor, you shouldn't be modifying a gsp.
The iterations I prefer to use after I have gathered requirements are:
wireframe
mockup
html
gsp
If the gsps are already there (ie you inherited the project or something) you could go back a step and create an html only version of the page by pulling the gsp elements out and putting in images of them or replacing them with their html equivalents.
the IBM Maqetta Project seems to be going in the right direction:
http://maqetta.org/
Mercury editor might be worth looking at too.
http://jejacks0n.github.com/mercury/
There is one more editor that you might want to look at:
Aloha Editor - http://www.aloha-editor.org/
Orbeon can be an option
http://www.orbeon.com/orbeon/home/
Might be able to do this with TinyMCE by configuring the valid_elements or the extended_valid_elements (docs). For example, if you want to replace <g:link> and <g:input> you would do something like:
tinyMCE.init({
valid_elements : "a/g:link,input/g:input"
});
OR If you want to simply enable the additional elements, then you could do something like:
tinyMCE.init({
extended_valid_elements : "g:link,g:input"
});

Good free html editor with shortcuts for <p>'s

Hi can anyone recommend a good free html editor.
I want something that will let me wrap sections of code in <p> tags with a shortcut for example. It would make my life easier.
I'm a developer so I want something where I'll be writing most of the html by hand.
Thanks for the help,
Alex
Visual Web Developer 2010 Express is just great for beginners, and has this functionality.
Netbeans has this functionality. It works with many languages including HTML. Get it from http://netbeans.org/ Its free
In Emacs' html-mode you're typing along, hit C-c RET, type your paragraph, hit C-c / to close the paragraph, and keep on hacking.
You can find this tip, and many more, here.
you can use Bluefish. This is a free software text editor. The "Auto tag closing" is include in the software : http://bluefish.openoffice.nl/manual/ch07s02.html
Official website : http://bluefish.openoffice.nl/
Hope it will help you!
Very simple, but with shortcuts for the most common XHTML blocks: Rejbrand Text Editor.
You press Alt+Enter to insert <p></p>; any selection will be included inside the tags. Ctrl+Enter inserts <br />, Ctrl+I inserts <li></li> etc. Ctrl+n inserts <hn></hn>.
Programmer's Notepad 2 gives you the easiness you're asking for, plus it also writes for ALL other programming languages with syntax highlighting to ALL and it adds the closing tags of HTML for you and all the optimizing stuff. Plus it is FREE. It also is VERY portable being only 2.4 megabytes! You can download it from here:
Programmers Notepad Download Latest Version

Is Dreamweaver "upwards" compatible with manually created semantic html?

A prospective client has a site with pages done in Dreamweaver(tm). I don't have Dreamweaver(tm), never use it, and have in the past have seen some spaghetti (html) code on pages created with it. As a result, I'm wondering: if I create clean sections of semantic html, will Dreamweaver continue to be able to edit it when the client wishes to modify the code that I have created by hand (assuming that I create clean and validating code). This is more of an experience based question than a research based question. I'm sure that Dreamweaver(tm)'s documentation would tell me that it's compatible with clean, semantic html, but it's hard to take that advice from the horse's mouth.
So, based on your experience, is Dreamweaver happy with clean semantic html created externally, or does the visual mode display badly when it's dealing with manually, externally-created semantic html?
Short answer: it is compatible.
It depends on how your clients want to modify the code. Dreamweaver is a good editing tool, and it supports and "understands" semantic (x)html/css. However, if your clients still use html for styling (such as table-based layouts etc.), then proper clean css-styling can be frustrating for them to deal with later. But it is another problem and it has nothing to do with the editor.
Editing HTML in the “code” mode of Dreamweaver leaves it alone. Not sure about the visual mode though.

How best to write documentation targeting both HTML and PDF? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Latex-to-html converters I've seen in the past have been pretty awful. Editing raw html is no fun and doesn't seem to translate well to the printed page. How do others solve this problem? Links to examples (both pdf and html) would be great.
Added: Another similar question was just asked:
What formatting language should I use for project documentation
For documenting code, I also recommend Sphinx. ReStructured Text is nice because it is readable and somewhat marked up in plaintext, and can do a nice job converting to html and to pdf. I still like LaTeX for certain things. My wife and I use LaTeX to write our christmas letter, which we mail out via snail mail. The pdf version is pretty fancy, with two columns, and headers and footers. The html version is simpler. I convert with plastex. Examples here:
http://fedibblety.com/annualReports
I don't think any binary format is a good choice (Word) for any sort of document that you might like to read 10 years from now. That is one of the nice things about LaTeX.
Yes, LaTeX-to-HTML converters used to suck (you've probably tried LaTeX2HTML), but of late they've got better. Tex4ht is highly configurable, and produces nice XHTML+CSS. See also other converters.
You can also use Docbook, if you can bear to write in it. There are converters from DocBook to both HTML and LaTeX (or to PDF directly); an example of the latter is dblatex.
See this post: LaTeX vs Docbook.
After many years of anguish and several false starts, I'm about to revisit this, and I'm going to give Sphinx a try. It can generate HTML or LaTeX from ReStructured Text.
I'm hoping it will be a much "lighter" option than full DocBook, but with many of the advantages.
You could take a step back and use something like DocBook and render to PDF via LaTeX and HTML straight from the DocBook files. Alternatively, Adobe Technical Communication Suite (Framemaker) will let you single-source a document to PDF and HTML. See this posting for a rundown on various technical documentation systems.
This is a personal choice but Latex in theory is perfect however in practice it's pain-in-the-arse. I'm using VS.NET HTML editor + raw HTML edit when I need it.
So I think using an WSIWYG HTML editor is best choice. You can always use a simple tool to convert it to PDF, and you can always edit HTML when you need something advanced. Also it's easier to put online when you need.
That's how I'm managing my software documentations and works fine for me.
PlasTeX looks like a nice latex-to-html converter, though I haven't tried it myself.
My friend Rob Felty wrote a blog post extolling its virtues:
http://blog.robfelty.com/2008/03/19/finally-a-better-latex-to-html-converter/
AsciiDoc looks like an interesting possibility.
Read about EPUB format. Its e-book format. http://en.wikipedia.org/wiki/EPUB
Since the answer mentioning Asciidoc was somewhat short on examples, here are some of the things your are looking for:
A pdf generated with Asciidoc
A cheatsheet with a side by side of the Asciidoc markup and the html result.
A list of publications done using Asciidoc, including O'Reilly books and the git documentation (to see both ends of the user scale).
I'm not sure that latex is really the best tool for this. The trouble you're having with the usual latex to html converter is indicative of the problem: html is simple not as expressive as latex.
If you insist on latex to html, take care to use a limited subset that can convert reasonably.
I've used TeXinfo in the past and it does a good job. Here's an example: http://yootles.com/api. I'd prefer to stick with LaTeX though instead of use another language.
If everything else fails you could grab an LaTeX to XML converter and write a simple XSLT stylesheet to convert it to HTML, or create a CSS style sheet and attach it to the XML file directly.
We've been using WebWorks ePublisher (www.webworks.com) which offers both multiple single-source formats (we are using Word) and the ability to output to many output formats (we output to Adobe PDF and Online Help (.CHM).
We were facing this problem in an academic project that involved Eclipse software, and we used plastex to convert Latex to HTML and Eclipse Help. Getting it to work was quite difficult, but the end result looks really nice. You can see all three versions here:
http://handbook.event-b.org/
Further, as this is an open project, the code (build scripts) are available. We have a continuous build system (Jenkins) that rebuilds everything when new Latex is checked in. This is particularly nice, as contributors don't need to install the toolchain on their systems. They just check in the new Latex and check on the server whether the HTML was produced correctly. Sources:
http://sourceforge.net/p/rodin-b-sharp/svn/HEAD/tree/trunk/Handbook/org.rodinp.handbook.feature/
Best, Michael
I don't have enough points to comment, but to bolster the plastex answer, here is the updated plastex example link:
http://robfelty.com/2008/03/19/finally-a-better-latex-to-html-converter
LaTeX? Seriously? I wasn't aware anyone outside academia still used it. I'd go with HTML, which you can save as PDF from the web browser. If you really must have some advanced typographic stuff, go with Word instead - it has a way to save to HTML (probably not as clean as one would like), and you can save as PDF with a free plug-in (downloadable separately).
Oh, and I wouldn't bother using things like InDesign - they are overkill. Also, don't bother paying for Acrobat Professional - there is a zillion free solutions available.