Prev Next

Embedding OMhelp Commands in Source Code

begin, end
OMhelp is designed to be embedded in computer source code. In fact, it is language independent and can be can combine source code files in multiple languages to form one documentation system. Only the text between a begin and a $end is processed by OMhelp. It is intended that these commands be comments in the language.

A Language with Block Structured Comments
This example covers all languages that have block structured comments; e.g., C, C++, Java, Python.

near_equal_c.c
Use an editor of your choice to create the file near_equal_c.c in the test directory the contents of which can be seen by selecting view_near_equal_c . Note that you can copy and paste the contents of near_equal_c.c to your editor window. You may just copy the file near_equal_c.c from the getting started directory .

Example In This Web Site Context
You can view the result of making near_equal_c.c part of the OMhelp help web site by selecting near_equal_c .

Execute OMhelp
In a command window and in the htm directory execute the following command
 
     omhelp ../near_equal_c.c -noframe

Example by Itself
Use a web browser of your choosing to view the file test/htm/near_equal_c.htm .

A Language with only One Line Comments
This example covers languages that only have one line comments; e.g., Matlab, Fortran, R. (The R language uses the $ character, this it may be necessary to change the OMhelp KeyCharacter .)

near_equal_f.f
Use an editor of your choice to create the file near_equal_f.f in the test directory the contents of which can be seen by selecting view_near_equal_f . Note that you can copy and paste the contents of near_equal_f.f to your editor window. You may just copy the file near_equal_f.f from the getting started directory .

Example In This Web Site Context
You can view the result of making near_equal_f.f part of the OMhelp help web site by selecting near_equal_f .

Execute OMhelp
In a command window and in the htm directory execute the following command
 
     omhelp ../near_equal_f.f -noframe

Example by Itself
Use a web browser of your choosing to view the file test/htm/near_equal_f.htm .
Input File: getstarted/start_embed.omh