/**
  * Creates an html list of all classes sorted by category (or package if no category)
  *
  * @return   string   the html for the menu
  */
 public static function menu()
 {
     return Kodoc::packages();
 }
 public function api($package = NULL, $class_name = NULL)
 {
     if ($class_name) {
         // Do we have anything cached?
         if ($this->cache and ($class = $this->cache->get('kodoc_class_' . $class_name)) !== NULL) {
             // Nothing to do, it's cached.
         } else {
             try {
                 $class = Kodoc_Class::factory($class_name);
             } catch (Exception $e) {
                 Event::run('system.404');
             }
             if ($this->cache) {
                 $this->cache->set('kodoc_class_' . $class_name, $class);
             }
         }
         $this->breadcrumb['userguide/api/kohana'] = 'API Reference';
         $this->template->title = $class_name;
         $this->template->content = View::factory('userguide/api/class', array('class' => $class));
         $this->template->menu = View::factory('userguide/api/menu', array('class' => $class));
     } else {
         $this->template->title = 'API Reference';
         $this->template->content = View::factory('userguide/api/toc', array('toc' => Kodoc::packages()));
         $this->template->menu = $this->markdown('kohana/menu');
     }
     $breadcrumb[] = $this->template->title;
 }