Practice with the “hnb” Outline Editor

Need some practice getting up to speed with hnb? Try this sequence of tasks:

  1. Login to your ssh account and create a directory called HnbPractice. Use the “cd” command to go into that directory.

  2. Start hnb with this command: hnb

  3. Use the up/down arrow keys to move up and down through the subtree items. Once you see how that works, up-arrow so that Using Outlines is highlighted.

  4. Press the right arrow key to expand the subtree; use the left arrow key to collapse it. Do this a few times. Notice that whenever you left arrow from a subtree, it automatically collapses as you leave the subtree, and expands when you enter it.

  5. With a subtree expanded, use the up and down arrow keys to traverse the subtree items. Try using the right and left arrow keys to expand and collapse those items, as well as subtrees within the subtrees. (Notice that if a subtree has a '+' sign on the far left of its entry, it means that it can be expanded; if instead it has a '-' that means it cannot.)

  6. If you want a subtree to remain expanded even after you leave it, you can use the ']' key. For example, use the arrow keys to highlight Managing entries which is a subtree under Using Outlines. Then press the ']' key; you should see the subtree expanded with all of its subtrees visible. Go ahead and use the arrow keys to descend into that tree's items. If you leave any of the tree's items, the Managing entries subtree will remain expanded.

  7. Use the arrow keys to highlight the Managing entries branch and collapse it by using the '[' key. Try expanding and collapsing this branch with ']' and '[' several times.

  8. Try inserting a new subtree under Using Outlines. Move the cursor to the subtree so it's highlighted, then press the "Insert" key. This will create a new subtree directly under Using Outlines; at this point hnb is waiting for you to type something. Type “This is my subtree” and press the "Enter" key to create the new subtree.

  9. Try adding an item to your new subtree. With it highlighted, press the right arrow and you should see the new subtree appear indented under the subtree you just created. Type “This is a branch” and press "Enter". You can create a hierarchy nested subtrees in this manner. Try inserting new subtree entries with the “Insert” key and making subtrees off of those with the right arrow key. Go crazy!

  10. You can also delete an item by moving the cursor to it with the arrow keys so it's highlighted, then pressing the "Delete" key. Try removing some of the branches you created.

  11. If you want to quit hnb, just press the “Esc” key and a pop-up menu will appear in the upper left corner. (You might want to arrow right and left to see what's available!) Select the "exit" item from the "File" menu (notice it has a keyboard shortcut of Ctrl+q). At the bottom of the screen you should see a prompt asking if you wish to save your changes, just press the 'N' key to quit without saving.

  12. After you've done the steps above, you should be ready to create your own outlines from scratch! Once you find yourself back at the command line prompt, type "hnb foo.hnb" (or whatever you want to call your outline) and press the Enter key; you should find yourself in the editor with an empty outline. Try creating an outline hierarchy using the keystrokes you've learned so far. Experiment with copying and pasting subtree items (Ctrl+c and Ctrl+v) around the outline, this will become handy when writing a functional specification. And be sure to read the “Useful hnb Keyboard Commands” on the Handouts page so you're editing is even more easier.

You're going to have to use hnb to write your functional specifications, so spending some time to get familiar with hnb is a wise investment!