On Sun, May 25, 2014 at 04:46:42PM +0200, Rishabh Yadav wrote:
> On Sun, May 25, 2014 at 4:14 PM, Felix Salfelder <[email protected]>wrote:
> What I am able to understand from your model is that you want to have a
> module embedded in each source file that contains the documentation and
> examples and then we need a plugin which gives a call to that module to
> present the help manual to the user.Correct me,if I am wrong.

not a module in each source file, but a procedure in each card.

the basic idea (very rough sketch, actually)

class CMD_HELP: public CARD {
  do_it(){
    string what;
    cmd >> what;
    const CARD* thing = find(what);
    out = <some stream>;
    out << "help on " << what << ":" << endl;
    what.help(out);
  }

  static string helptext;
  void help(stream out){
    out << helptext
  }
}c;

string CMD_HELP::helptext = "helptext on help";

DISPATCHER<CMD>::INSTALL d0(&command_dispatcher, "help", &c);

and then:
gnucap> help help
help on help:
helptext on help

cheers
felix

_______________________________________________
Gnucap-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnucap-devel

Reply via email to