From owner-freebsd-questions@FreeBSD.ORG Fri Nov 21 16:09:48 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B63741065673 for ; Fri, 21 Nov 2008 16:09:48 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from mail.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 86E6F8FC13 for ; Fri, 21 Nov 2008 16:09:48 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (mail.rachie.is-a-geek.net [192.168.2.101]) by mail.rachie.is-a-geek.net (Postfix) with ESMTP id 56406AFD252; Fri, 21 Nov 2008 07:09:46 -0900 (AKST) From: Mel To: freebsd-questions@freebsd.org Date: Fri, 21 Nov 2008 17:09:36 +0100 User-Agent: KMail/1.9.7 References: <4926922C.8050702@gmail.com> <200811211539.28898.jonathan+freebsd-questions@hst.org.za> <4926D965.8010104@gmail.com> In-Reply-To: <4926D965.8010104@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200811211709.37939.fbsd.questions@rachie.is-a-geek.net> Cc: pwn , Jonathan McKeown Subject: Re: ascii text format X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2008 16:09:48 -0000 On Friday 21 November 2008 16:53:09 pwn wrote: > Jonathan McKeown wrote: > > On Friday 21 November 2008 12:49:16 pwn wrote: > >> algouth this is not a freebsd specific text, i need to format some texts > >> under freebsd for they appear in the center of the page when opened in a > >> browser, but i dont want to use HTML for format them, i just want to add > >> tabulation to my *.txt. > >> what software/tool can i use for format my *.txt? there is command on > >> VIM like "set textwidth" but this is not suitable for me. any help i > >> appreciate. > >> i add an example on a temporary host for make sure all understand. > >> (i need to format the text for he appear like the example good.txt) > >> http://one.xthost.info/temphost/good.txt > >> http://one.xthost.info/temphost/bad.txt > > > > You seem to be fighting against your tools rather than working with them > > - the browser will strip out your whitespace and reflow your text anyway > > unless you prevent it somehow (
 tags?) so you might be better off
> > just using HTML/CSS to control the format.
> >
> > However, you could look at various tools for processing text, depending
> > exactly what you're trying to do: the manpages for fmt, groff, and pr
> > might all offer some ideas.
> >
> > Jonathan
>
> yes, i want that the text appears displayed such as manpages like, how
> can i accomplish this task?


Manpages use advanced formatting codes. You can achieve some result, by:

fmt -c 70 80 bad.txt

But anything further you will have to edit the text. Maybe you can wrap some 
formatting codes around the text for the tbl(1) program. But I agree with 
Jonathan - it's easier to reformat the text using HTML code and some of that 
can be done with a script/parser, providing the text uses some degree of 
consistency.
-- 
Mel

Problem with today's modular software: they start with the modules
    and never get to the software part.