Adding a block to a page build with a call to theme (Drupal 7) I have a page on Drupal site that needs to render a webGL canvas.  This page is visited by hitting an end point defined in hook_menu.  Here is the code I use to render the webGL page.  

function inflatable_icons_canvas_page() {
    $base_path = drupal_get_path('module', 'inflatable_icons') . '/Online_Inflatable_Icons/IconEditor/public/';
    drupal_add_js(array('inflatable_icons' =&gt; array('basePath' =&gt; $base_path)), 'setting');
    drupal_add_css($base_path . 'js/dojo-release-1.7.2/dijit/themes/claro/claro.css');
    drupal_add_css($base_path . 'css/shared.css');
    drupal_add_js($base_path . 'js/includes.js');
    return theme('webgl_canvas');
}
function theme_webgl_canvas() {
    $html = file_get_contents(drupal_get_path('module', 'inflatable_icons') . '/Online_Inflatable_Icons/IconEditor/public/editor.html');
    $page = new SimpleXMLElement($html);
    $table = $page-&gt;body-&gt;table;
    $div = new SimpleXMLElement("&lt;div class='claro'&gt;&lt;/div&gt;");
    sxml_append( $div, $table );
    return $div-&gt;asXML();
}


I also need to be able to add some blocks to this page (either programmatically created or created through interface builder), how would I add these blocks to my page which is created through loading the html file editor.html and calling theme.
inflatable_icons_canvas_page() is the callback function for your hook_menu page,  therefore in your hook_menu you will define a route as: 

  function inflatable_icons_menu() {
    $items['abc/def'] = array(
      'page callback' =&gt; 'inflatable_icons_canvas_page',
    );
    return $items;
  }


Then you can use the route 'abc/def' to determine the visibility of your blocks either in the admin blocks UI or in your module code. In later case it will be something like:

$blocks['example_empty'] = array(
    'info' =&gt; t('Example: empty block'), 
    'status' =&gt; TRUE, 
    'region' =&gt; 'sidebar_first', // Not usually provided. 
    'visibility' =&gt; BLOCK_VISIBILITY_LISTED, // Not usually provided. 
    'pages' =&gt; 'abc/def', // Not usually provided here.
  );


Then configure the block as usual from blocks admin UI. If you go to configure the block you will find the configuration of visibility settings to "show block in specific pages" option "only the listed pages" and your hook_menu route in text area. You could change it now if desired, as you will with a block created through UI.