By Martin Stut, 2013-09-27

Every now and then, I need to document computer code, such as a configuration defined by text files, including snippets of code (2 - 30 lines) in the documentation. I do like using FreeMind as a fast editing tool to collect information and thoughts. But usually, nodes in mind maps are just keywords or text snippets with little formatting. So I was looking for a way to include multi-line code snippets in mind map nodes that require preserving line breaks and whitespace.

It turned out to be easier than I thought:

  1. Open the node, about to contain the file snippet, with the long text editor (Alt+enter).
  2. When asked whether you want to use formatting (bold, italic, etc.), click "yes". The editing window will open.
  3. Near the bottom of the editing windows, click on the HTML-code-view tab. You'll see plain HTML code.
  4. Move the cursor to the place where you want to insert the configuration file snippet.
  5. Enter this code:
  6. Move the cursor between <pre> and </pre>
  7. Copy the code you want to insert from the source.
  8. Paste it between <pre> and </pre> .
  9. Switch back to layout view and continue editing/saving etc.

Of course you can adopt this to your style of work:

I'm pleased with the versatility offered by FreeMind.