Make 'doc function_name' bring only help for function_name
When I type 'doc functionname', it returns the whole documentation, while http://www.gnu.org/software/octave/doc/interpreter/Getting-Help.html says it should only bring GNU Info browser at the functionname node in the online version of the manual. Thanks!
The “doc” function creates broken links for functions that either do not exist or are not parse of Octave core (i.e. in a package).
-
Victorel Petrovich commented
Well, this is probably of lowest priority as doc is not supposed to be called with package functions anyway: (when invoking "help function_name"):
"Additional help for *built-in functions* and operators is
available in the online version of the manual. Use the command
'doc <topic>' to search the manual index." -
Yeah, my implementation of the "doc" function does no check whether or not a function exists. I'll need to think about how you can determine that in code.
-
Victorel Petrovich commented
It took me a while to understand why "doc function_name" brings a broken link, for ex for:
> doc histfit
It turns out, it's because "histfit" is not a built-in function, but a stats package function, so "doc" should not be called!
(It would be nicer if it worked anyway, but then I guess it would be hard to implement as various package functions have respectively different URL paths) -
Victor commented
That was fast, Shane! It definitely looks cleaner now when doc f is called. Thanks again!
-
Hi Victor,
Good catch! I've reviewed your ticket, and here are two explanations for the behavior you experienced.
TECHNICAL EXPLANATION: When I open an instance of GNUOctave from the terminal and run `doc function_name`, it pulls up a window where you can scroll, click hyperlinks, etc. Since the Octave Online version of GNUOctave is not connected to a terminal, some commands behave differently, and it seems that GNU Info is one. Dumping the entire documentation file seems to be the expected behavior if there is no terminal attached to the process.
LAYMAN EXPLANATION: The `doc` command gives the exact same documentation as the online version at http://octave.sourceforge.net/docs.html. While seeing a snapshot of the online documentation in your console window may be useful for terminal users, it just doesn't make sense for Octave Online, whose UI is fundamentally different.