Prev Next Index-> contents reference index search external Up-> overview files srcfile overview-> License why Install get_started running files titles+headings cross format spellchecking latex other browser glossary wish_list whatsNew files-> path children include image verbatim srcfile srccode execute KeyCharacter srcfile Headings-> Syntax See Also Optional Purpose Delimiter Sequence filename indent ---..Example start ---..escape stop ---..escape ---..Example skip Tab Stops

Displaying Source Code From a File

Syntax
$srcfile%filename%$$ srcfile%filename%indent%$$  $srcfile%filename%indent%start%stop%$$ srcfile%filename%indent%start%stop%skip$$ 
getting started , srccode , codep , verbatim

Optional
This command is optional and only supported when the boost_regex and source_highlight library are successfully found by the cmake command.

Purpose
This command will display the specified input file as program source code with highlighting.

Delimiter Sequence
     %filename%indent%start%stop%skip%$$ is a delimiter sequence where % can be any character that is not a letter. filename The value of filename specifies the name of the file that is displayed. Leading and trailing white space in filename is ignored. The filename must have a file extension . The file extension, without the period '.', is used to determine the source code language. indent If indent is present, it is a positive integer and specifies the number of spaces to indent the output. (It is best if the indent is a multiple of the tabsize .) Example The following command  tabsize 4$$ $srcfile%../src/highlight.h%4%$$ displays the entire file highlight.h, with a four space indentation as follows:  # ifndef HIGHLIGHT_INCLUDED # define HIGHLIGHT_INCLUDED /* ---------------------------------------------------------------------------- OMhelp: Language Independent Embedded Documentation Copyright (C) 1998-2015 Bradley M. Bell OMhelp is distributed under the terms of the GNU General Public License Version 2. ---------------------------------------------------------------------------- */ // BEGIN PROTOTYPE extern char* highlight( const char* input_text_cstr , const char* input_lang_cstr , const char* output_lang_cstr , int indent , int tabsize ); extern char* file_ext2lang(const char* file_ext_cstr); // END PROTOTYPE # endif Note that a newline was automatically added at the beginning of the file. start If start is present, it specifies a sequence of characters after which output should start. In this case none of the characters in the file before, and including, this starting sequence are displayed. escape If the escape character is present in start , there must be three decimal digits following it. In this case the escape character together with the three following characters, represent the single character with ascii code equal to the decimal value of the three decimal digits. stop If start is present, stop must also be present. It specifies a sequence of characters just before which output should stop. In this case none of the characters in the file following, and including, this stopping sequences are displayed. escape If the escape character is present in stop , there must be three decimal digits following it. In this case the escape character together with the three following characters, represent the single character with ascii code equal to the decimal value of the three decimal digits. Example The following command sequence  srcfile%../src/highlight.h%8%// BEGIN PROTOTYPE%// END PROTOTYPE%$$  displays the following output:  extern char* highlight( const char* input_text_cstr , const char* input_lang_cstr , const char* output_lang_cstr , int indent , int tabsize ); extern char* file_ext2lang(const char* file_ext_cstr); Note that the newline after // BEGIN PROOTYPE, and the newline before // END PROTOTYPE, are included in the output. Also note that the previous tabsize command is still in effect. If skip is present, it is a positive integer that specifies the number of start matches to skip. This is very useful when the $srcfile command refers to the same file as the command is in. The skip option can be used to skip the match on the command and go forward to the location that you wish to display.

Tab Stops
The tabsize command enables you to match the indentation of the src command with one of the tabbing columns.
Input File: srcfile.omh