Tidying SGML documents

Marc Fonvieille blackend at FreeBSD.org
Sun Jun 27 19:26:36 UTC 2004


On Sun, Jun 27, 2004 at 02:10:48PM -0400, Joe Marcus Clarke wrote:
> I figure I'd ask before trying to clean these manually.  What sgml-fu do
> you guys use to tidy horrendously formatted website documents?  The
> GNOME docs are in pretty bad shape, and I've finally gotten fed up
> enough to fix them.
> 
> I'm a vim user, and found this sometime ago:
> 
> autocmd BufNewFile,BufRead *.sgml,*.ent,*.html,*.tex,*.xsl set
> autoindent formatoptions=tcq2l textwidth=70 shiftwidth=2 softtabstop=2
> tabstop=8
>

I use the same line :)

> It works great for writing new documents, but I was hoping there was a
> nice automatic recipe for existing documents.  Thanks.
> 

Well it's difficult to "really" clean an existing file without using a
complex script.
What I use to do is:

- cleaning trailing spaces (with sed)
- replacing leading spaces with tabs where needed (with sed)
- using gq command from Vim for correct indentation etc.  Most of time
  it gives good results but I often have to finish the job by myself...

Marc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-doc/attachments/20040627/c62644f8/attachment.sig>


More information about the freebsd-doc mailing list