Skip to content

define help

D Groth edited this page Oct 11, 2024 · 4 revisions

define-help

The manual page define-help(2) which can be displayed in MicroEmacs for instance with the following keyboard sequence

Esc x help-item<ENTER>define-help<ENTER>

explains the addition of help documentation to your own MicroEmacs macros. In principle any free text can be written within a define-help / !ehelp section. Since ME version 20240903 it is as well possible to use some Markdown formatting for the help page. IHere is an example taken from the hkpydoc.emf file (Please replace the triple quotes with triple back-ticks therein - triple quotes are here required to display Markdown markup within this Markdown based wiki), the $a entry is a place holder to display current key-bindings if any for the given command:

define-help "pydoc" "3"
## NAME

__pydoc__ - display Python function, module or package documentation

$a

## SYNOPSIS

__pydoc__ ["manualpage"]

## DESCRIPTION

The __pydoc__ macro asks the user for Python manual page and then displays the 
appropriate manual page in a buffer *pydoc* which provides hilighting for the 
section headers and the classes and folding support for them. Further you can use
the [item-list(3)](item-list\(3\)) command to browse the content using the outline
shown in the _item-list_ buffer.

## EXAMPLE

Here an example to display the "argparse" package documentation and open an 
_item-list_ buffer for easy navigation.


'''{emf}
    pydoc "argparse"
    find-buffer "*pydoc*"
    beginning-of-buffer
    item-list
'''


## NOTES

The __pydoc__ macro is implemented in the file _hkpydoc.emf_ which is currently 
placed in the contribs folder. For installation copy that file into your user-path 
folder - usually `~/.config/jasspa` and made the macro available by placing the 
following line into your `username.emf` file.

## SEE ALSO

[py(0)](py\(9\)) and [r-doc(3)](r-doc\(3\)).

!ehelp

More information can be found as said on the define-help(2) help page.

Below you see an image which displays the resulting help page in the top window of a MicroEmacs session, and the documentation editing window at the bottom in a ME session using the Solarized Light theme.

Clone this wiki locally