Re: [Groff] Building a troff parser

2015-03-05 Thread James K. Lowden
On Tue, 3 Mar 2015 01:00:35 -0500 Eric Andrew Lewis wrote: > In short, I'd like to make a program that does this: > > $ explain "rm -rf *" > rm -rf * > ??? rm remove files or directories > ??? -r remove directories and their contents recursively > ??? -f ignore nonexistent file

Re: [Groff] Building a troff parser

2015-03-03 Thread Steffen Nurpmeso
Mike Bianchi wrote: |On Tue, Mar 03, 2015 at 01:00:35AM -0500, Eric Andrew Lewis wrote: |> In short, I'd like to make a program that does this: |> |> $ explain "rm -rf *" |> rm -rf * |> └── rm remove files or directories |> ├── -r remove directories and their contents recursive

Re: [Groff] Building a troff parser

2015-03-03 Thread Ingo Schwarze
Hi Eric, Ralph Corderoy wrote on Tue, Mar 03, 2015 at 10:50:37AM +: > Eric Andrew Lewis wrote: >> $ explain "rm -rf *" >> rm -rf * >> ? rm remove files or directories >> ? -r remove directories and their contents recursively >> ? -f ignore nonexistent

Re: [Groff] Building a troff parser

2015-03-03 Thread Mike Bianchi
On Tue, Mar 03, 2015 at 01:00:35AM -0500, Eric Andrew Lewis wrote: > In short, I'd like to make a program that does this: > > $ explain "rm -rf *" > rm -rf * > └── rm remove files or directories > ├── -r remove directories and their contents recursively > ├── -f ignore nonexisten

Re: [Groff] Building a troff parser

2015-03-03 Thread Ralph Corderoy
Hi Eric, > $ explain "rm -rf *" > rm -rf * > └── rm remove files or directories > ├── -r remove directories and their contents recursively > ├── -f ignore nonexistent files, never prompt > └── *Remove (unlink) files matching this text pattern. (The `text pattern' is actu

Re: [Groff] Building a troff parser

2015-03-02 Thread Eric Andrew Lewis
Ingo said: For which specific purpose do you want to build this tool, and which set of > manual pages to you want to process with it? I would like to build a command-line port of Idan Kamara's wonderful explainshell.com, which, given a command (e.g. rm -rf *) breaks it down it into its constitue

Re: [Groff] Building a troff parser

2015-02-27 Thread Steffen Nurpmeso
Hallo Ingo, Ingo Schwarze wrote: |> Eric Andrew Lewis wrote on Thu, 26 Feb 2015 07:49:18 -0500: |>> I'm interested in building a troff parser to extract information |>> from manpages (e.g. what do the flags mean when we say `rm -rf *`?). |Steffen Nurpmeso wrote on Fri, 27 Feb 2015 11:31:36 +

Re: [Groff] Building a troff parser

2015-02-27 Thread Ingo Schwarze
Hi, > Eric Andrew Lewis wrote on Thu, 26 Feb 2015 07:49:18 -0500: >> I'm interested in building a troff parser to extract information >> from manpages (e.g. what do the flags mean when we say `rm -rf *`?). >> >> I'm curious, would the marked up source be the format to parse? Which format? One t

Re: [Groff] Building a troff parser

2015-02-27 Thread Steffen Nurpmeso
|> I'm interested in building a troff parser to extract information from |> manpages (e.g. what do the flags mean when we say `rm -rf *`?). For the mdocmx(7) project i have written a simple mdoc(7) parser in awk(1), the entire thing 18966 bytes but that includes comments and a shell wrapper that

Re: [Groff] Building a troff parser

2015-02-26 Thread Kristaps Dzonsons
>> I'm interested in building a troff parser to extract information from >> manpages (e.g. what do the flags mean when we say `rm -rf *`?). > > That's a hard problem. You may want to look at Eric Raymond's > doclifter. http://www.catb.org/esr/doclifter/ Eric, If the pages are in mdoc(7) (which