Gallery Tutorial [TECHNICAL SLIDE TRAIL] The Webel libraries for Wolfram Mathematica: With SysMLv1 models. Section SECTION: The Webel Doc` package and the HelpF, HelpO`& HelpM` help registry packages Tags and keywords Mathematica keywords ::usage Webel Mathematica keywords W`Base` HelpF` addFunction '$info$f$' '$opt$' '$arg$' 'rule$arg$' 'rule$opt$' Keywords Wolfram Wolfram Language Mathematica Webel::SysML4Mathematica Webel IT Australia Click on the image to view it full size Up next HelpF`example: addFunction (2) Notes [CONVENTION, NAMING, PATTERN, POLICY]{STRICT} Webel: Mathematica: CONVENTION: A function's description (but not its signature, arguments, or options) may be captured as an '$info$f$' Stringhelp holder for use by the Doc` package for ::usage generation and the HelpF`& HelpO` help registry packages. [NAMING, PATTERN, POLICY]{STRICT} Webel: Mathematica: CONVENTION: Option help holders use a String variable with the prefix '$opt$', a related '$info$opt$' String, a 'def$opt$' default value expression, and optional '$warn$opt$', '$tip$opt$', '$lab$opt$', and 'type$opt$' indicator ... [NAMING, PATTERN, POLICY]{STRICT} Webel: Mathematica: CONVENTION: Argument help holders use a String variable with the prefix '$arg$', a related '$info$arg$' String, a 'def$arg$' default value expression and/or 'req$arg$', and optional '$warn$arg$', '$tip$arg$, '$lab$arg$', 'type$arg$'.. [NAMING, PATTERN, POLICY]{STRICT} Webel: Mathematica: A help Rule 'rule$arg' for an '$arg$' (argument) accepts keys: '$k$help' (required), '$k$def' (required if $k$req = True not given), '$k$req' (True if $k$def not given), '$k$warn', '$k$tip', '$k$lab', '$k$type', '$k$mult' and '$k$pat' [NAMING, PATTERN, POLICY]{STRICT} Webel: Mathematica: A help Rule 'rule$opt$' for an '$opt$' (option) accepts keys: '$k$help' (required), '$k$def' (required), and optional '$k$warn', '$k$tip', '$k$lab' (a label), '$k$type' (indicator only), '$k$mult' (SysML multiplicity), and '$k$pat'. Snippets (quotes/extracts) Visit also Visit also (backlinks) Related slides (includes other tutorials) Why the Webel HelpF` & HelpO` registries? HelpF`example: helpFunction[$pac$HelpF, addFunction] DRY not WET! "Don't Repeat Yourself!" Related slides (backlinks, includes other tutorials) HelpF`example: addFunction (2) HelpF`: Pull Mathematica Options[] from a Webel HelpF` options superset HelpF`: Pull Mathematica Options[] for a function registered with addFunction The HelpF` & TestF` packages: General query based help HelpF`: packageFunctionTree[$pac]: Function ::usage help and signatures within a package TestF`: Function search by argument number/kind to aid testing automation (1) TestF`: Function search by argument number/kind to aid testing automation (2) TestF`: Simple package function DownValues vs ::usage checker HelpF`: Simple function DownValues inspector GUI: gui$helpDownStrings HelpF`: gui$helpDownStrings signature display modes HelpM`: Using the Webel MFunction class and MArg & MOpt with HelpF` HelpM`: Use MFunction and MMethod with MArg & MOpt for ::usage (and consistent with the HelpF` and HelpO` registries) Incremental benefit through Doc`, Var`, HelpF`, HelpO`, HelpM` HelpM`: Using the Webel MPackage helper with MFunction and MClass and the HelpF` and HelpO` help registries Generate shared option groups using ‘$opt$’ helpers: wl$optsFromOpts, docsFromOpts, rulesFromOpts, and odrMap triplet HelpF`: OptionsPattern groups as SysML shared between functions Webel ODR (Options, Docs, Rules) as SysML HelpF`: DownValues: sigsDown[f]: Signature(s) from ExpressionTree Flags Book traversal links for HelpF`example: addFunction (1) Previous Up Next