How to Use Code Snippets

Version 3.7 introduces new feature – “Code Snippets”. Essentially, “code snippet” is a formatted portion of code you use in your help file to show how to use your library, document API or something like that. Helpinator now has “Code snippets” manager, code editor with syntax highlighting and a new pseudo-tag to insert code snippets into editor.

Here’s how it looks like.

Code snippets manager. You can hide it from the tree and show again using the visibility control button on the left.

codesnippets

 

You can add, rename and delete snippets and also import them from the file.

 

Code editor looks like this:

codesnippet

 

It has cut/copy/paste/import from file toolbar buttons and syntax selector.

 

To insert code snippet into topic editor use “CODE” pseudo-tag like this:

editorcodesnippet

 

On compile time Helpinator will turn a snippet into corresponding format. Here how it looks like in CHM:

codesnippet-chm

 

And in PDF:

 

codesnippet-pdf