On 2006-05-19, cga2000 <[EMAIL PROTECTED]> wrote:
> On Fri, May 19, 2006 at 08:22:40AM EDT, Benji Fisher wrote:
> > On Thu, May 18, 2006 at 10:08:53PM -0400, cga2000 wrote:
> > >
> > > I was wondering if another approach such as using a markup language
> > > that supports tables might not be preferable in the long run. What I
> > > mean by this is that it might be a little more difficult to start off
> > > with but might provide more control and facilities and end up being a
> > > more "portable" solution.
> > >
> > > html would be an obvious candidate but I suppose that there are others
> > > in the linux world?
> > >
> > > Is there any way I can split the screen and have the source version of a
> > > document written in a markup language in one window and the compiled
> > > version in the other? With a simple command or key combo that I could
> > > issue in the "source" window that would cause a refresh of what is
> > > displayed in the other window..? Or is vim just not suited for this
> > > kind of approach?
> >
> > It depends on what you mean by "split the screen."
>
> vim vertical split on an xterm.
If the compiled version is plain text, sure. You could use an
autocommand with the BufWritePost event that would run the compiler
on your source file, switch vim windows, delete the existing
contents, and :read in the compiler output file.
This will work with HTML and with man pages, with some limitations
on fonts and styles.
> > If you want one window that has vim running in the bottom half and an
> > HTML browser running in another,
>
> yes.. pretty much what I had in mind.. another example: I'm writing a
> man page and I would like to work on the source in the left vim window
> and check the rendered man page in the right vim window:
>
> 1. I make changes to my man page & save to disk
> 2. I switch to the other window and hit the "refresh" key
> 3. Now I can see the results of my changes
> 4. Back to 1. above etc..
>
> In order to do this in vim you would probably need to be able to run a
> shell in a vim window - doesn't seem to be possible.
You don't need a shell in a window, just do what I suggested above.
Or use a "refresh" key instead of an autocommand, if you prefer.
There is a plugin that lets you read man pages within vim. You
could probably use this directly or adapt it to your needs.
> It doesn't have to be html, though. Some very basic markup language
> that provides headers, paragraphs, lists, and tables and that could be
> easily translated to html, pdf, postscript, and simple text would be
> well-adapted to my needs.
>
> No idea if linux has such a thing.
Well, there is nroff. Man pages are actually written using nroff
macros. At least one implementation of the man command uses the
following to format the pages it finds:
tbl -TX <file name> | neqn | nroff -man | col -x
The tbl command is used to format tables and the neqn command is
used to format equations.
Nroff does some things really well and some things not so well. I
think w3m does a better job of creating tables from HTML than tbl
and nroff do from their source code.
Then there's latex, which I know nothing about other than it is
supposedly a very nice typesetting language for everything from
short letters to long dissertations and books. A lot of people
swear by it.
HTH,
Gary
--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
| Spokane, Washington, USA