Home

Basics
Overview
Menus
Toolbar
Tree
Code Editor
Search Frame
Change History

Intermediate
Add/Delete
Keywords
Search Lists
Date/Time
Shortcut Keys
Custom Icons
HTML Export
Hyperlinks
Drag & Drop
Bookmarks
Macros
Printing
Fonts
Hex View
Easter Eggs

Advanced
Revision Control
Object Storage
Language Def
Remote Folders
Server Sync
Online Search
Import Code
gbFlashLib

Forums
Announcements
Questions
Suggestions

Personal
Webcam
Biography
Contact Me

GBIC >> gbWare >> gbCodeLib >> HTML Export
gbCodeLib - HTML Export

In order to allow users to create web pages containing their source code, gbCodeLib provides the export of a code snippet to HTML format. A single snippet or an entire language may be exported.

Here is an example of a snippet exported to HTML and displayed in a web browser:

(click to expand)

Single Snippet Export
To export a single snippet, select the snippet in the Tree and use the menu option File > Export Snippet to HTML.

The selected snippet will be exported as a file called "gbcodelib.htm" in the same folder to which gbCodeLib was installed.

The exported snippet HTML file may optionally be given a numeric suffix which will increment by one each time an export is performed. The menu option Actions > General > Increment HTML FileName will direct gbCodeLib to name the exported files with an incremental numeric suffix, such as gbcodelib1.htm, gbcodelib2.htm, gbcodelib3.htm and so on.

The HTML counter may be reset to 1 by using the menu option Actions > Clear HTML Counter.

Language Export
gbCodeLib can also export an entire language of snippets at one time. Select the language to be exported and use the menu option File > Export Language to HTML to export all snippets within the language.

In addition to the individual snippet files (which are name Language1.htm, Language2.htm, Language3.htm and so on - where 'Language' is replaced by the actual Language name), gbCodeLib will create a file called 'Language.htm', which is an index page to all of the individual snippet files ('Language' is replaced by the actual language name).

When an entire language of snippets is exported all files are placed in a folder called 'html_export' in the folder where gbCodeLib was installed. If the folder does not exist, it is created.

Note: all files in the folder are deleted prior to executing the Export Language to HTML command.

Custom HTML Template
The format of the exported snippets is determined by an HTML template file. One such file, 'default.htm' is installed in the 'html_templates' folder beneath the gbCodeLib installation folder. Users may edit this file or create their own HTML template files.

To select a user-defined HTML template to be used by gbCodeLib during HTML export, use the Actions > Select HTML Template menu option.

Each exported snippet will consist of the contents of the HTML template file, with replacement of the gbCodeLib tags as follows:

gbCodeLib TagText Used to Replace Tags
<gb_language>       Snippet language
<gb_title>Snippet title
<gb_keywords>Snippet keywords
<gb_category>Snippet category
<gb_date>Snippet date (last modification)
<gb_code>Snippet code