On Fri, May 19, 2006 at 11:35:09PM EDT, Gary Johnson wrote: > 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.
Sounds pretty straight-forward. > > 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. > Yes, your description of the process is very clear. If I understand correctly I would just need to direct the output of the compile command to a temp file and cause vim to re-read it and display the updated version. > There is a plugin that lets you read man pages within vim. You > could probably use this directly or adapt it to your needs. > I was just going to ask whether you could suggest something comparable that I could adapt.. :-) As it happens, the :Man plugin is one of my favorites. > > > 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. I have used it once in the past to write a test man page. Just taking a look at how things work. And I don't remember running into any problems. > 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 I don't remember a man page that has a table in it. I mean a table that actually visualizes the cells with box drawing characters. > > 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. I use mostly elinks and it also does a very good job of rendering HTML tables. > > 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. Yes, I've used LyX in the past and it's rather nice. Don't know if latex is quite suitable for the small documentation tasks I have in mind but from what I have heard it's probably worth the effort. > > HTH, Gary > Very much so. Thanks, cga