The main index page is mostly a template frameset, but includes
 the initial page. If the <tt>--main</tt> option was given,
 we use this as our main page, otherwise we use the
 first file specified on the command line.
779510
def gen_main_index
      template = TemplatePage.new(RDoc::Page::INDEX)
      File.open("index.html", "w") do |f|
        values = {
          "initial_page" => main_url,
          'title'        => CGI.escapeHTML(@options.title),
          'charset'      => @options.charset
        }
        if @options.inline_source
          values['inline_source'] = true
        end
        template.write_html_on(f, values)
      end
    end
338754
private function readTemplateContent()
    {
        // Get page content if static file used
        if ($this->router_instance->getPageData()['html_file'] && file_exists(DIR_BASE . $this->router_instance->getPageData()['html_file'])) {
            if (Settings::isFrontendLogEnabled()) {
                FrontendLogger::getInstance()->log('Rendering simple HTML file');
            }

            ob_start();
            // Read file as is
            require_once DIR_BASE . $this->router_instance->getPageData()['html_file'];

            $this->html = ob_get_clean();
            // Prevent future component parse
            $this->use_html_file_without_parse = true;

            // Usual template read for parsing
        } elseif (is_file($this->router_instance->getPageData()['template_file'])) {

            // Get page content with components
            $this->html = file_get_contents($this->router_instance->getPageData()['template_file']);

            // Nothing found
        } else {
            $this->html = 'No template "' . $this->router_instance->getPageData()['template_file'] . '" for this page.';
        }
    }
669699
public function index()
    {
        $argv = \Console_Getopt::readPHPArgv();
        $opts = \Console_Getopt::getopt(array_slice($argv, 2, count($argv) - 2), 'h::p::d::r::', null, true);
        if (!empty($opts[0]) && is_array($opts[0])) {
            foreach ($opts[0] as $val) {
                if (!empty($val[0]) && !empty($val[1]) && is_string($val[0]) && is_string($val[1])) {
                    switch ($val[0]) {
                        case 'h':
                            $this->host = $val[1];
                            break;
                        case 'p':
                            $this->port = $val[1];
                            break;
                        case 'd':
                            $this->docroot = $val[1];
                            break;
                        case 'r':
                            $this->router = $val[1];
                            break;
                    }
                }
            }
        }

        $documentRoot = $this->docroot;
        $address = $this->host . ':' . $this->port;
        if (!is_dir($documentRoot)) {
            Lb::app()->stop("Document root \"$documentRoot\" does not exist.\n", self::EXIT_CODE_NO_DOCUMENT_ROOT);
        }
        if ($this->isAddressTaken($address)) {
            Lb::app()->stop("http://$address is taken by another process.\n", self::EXIT_CODE_ADDRESS_TAKEN_BY_ANOTHER_PROCESS);
        }
        if ($this->router !== null && !file_exists($this->router)) {
            Lb::app()->stop("Routing file \"$this->router\" does not exist.\n", self::EXIT_CODE_NO_ROUTING_FILE);
        }
        $this->writeln("Server started on http://{$address}/\n");
        $this->writeln("Document root is \"{$documentRoot}\"\n");
        if ($this->router) {
            $this->writeln("Routing file is \"$this->router\"\n");
        }
        $this->writeln("Quit the server with CTRL-C or COMMAND-C.\n");
        passthru('"' . PHP_BINARY . '"' . " -S {$address} -t \"{$documentRoot}\" $this->router");
    }
889412
async function main() {
  event.$emit('before-client-render')

  if (globalState.initialData) {
    dataStore.replaceState(globalState.initialData)
  }

  await routerReady(router)

  if (router.getMatchedComponents().length === 0) {
    throw new ReamError(pageNotFound(router.currentRoute.path))
  }
}
1215227
function main() {
  var topWindow = window.top;
  var isTop = window.top === window;

  // Check the top window for options.
  var options = null;
  try {
    var optionsEl = topWindow.document.querySelector('x-wtf-options');
    if (optionsEl) {
      // Options exist in the DOM, use those.
      options = JSON.parse(optionsEl.text);
    }
  } catch (e) {
    // Failed, likely because of cross-domain iframe issues.
  }

  // Grab options - if not found, not injected.
  if (!options) {
    options = fetchOptions(topWindow);
  }
  if (!options) {
    return;
  }

  // Add options to the document for other frames/etc to find.
  if (!optionsEl) {
    try {
      optionsEl = document.createElement('x-wtf-options');
      optionsEl.text = JSON.stringify(options);
      topWindow.document.documentElement.appendChild(optionsEl);
    } catch (e) {
      // Failed, likely because of cross-domain iframe issues.
    }
  }

  if (options['__instrumented__']) {
    // Instrumentation mode.
    if (isTop) {
      // Create a blob that is both the falafel and process scripts.
      // This is used to create the worker.
      var xhr = new XMLHttpRequest();
      xhr.open('GET', chrome.extension.getURL('third_party/falafel.js'), false);
      xhr.send();
      var falafelSource = xhr.responseText;
      xhr = new XMLHttpRequest();
      xhr.open('GET', chrome.extension.getURL('wtf-process.js'), false);
      xhr.send();
      var processSource = xhr.responseText;
      var blob = new Blob([
        falafelSource,
        processSource
      ], {
        type: 'application/javascript'
      });
      var blobUrl = URL.createObjectURL(blob);
      options['wtf.instrumentation.blob'] = blobUrl;

      injectScriptFile(chrome.extension.getURL('third_party/falafel.js'));
      injectScriptFile(chrome.extension.getURL('wtf-process.js'));
      injectScriptFile(chrome.extension.getURL('wtf-call-tracing.js'));
    }
    injectScriptFunction(function(options) {
      // If we are nested in an iframe, protect against cross-origin errors.
      try {
        window.top.wtfi.prepare(options, window);
      } catch (e) {
      }
    }, [
      options
    ]);
  } else {
    // Normal tracing mode.
    // Inject the tracing framework script and the prepare function.
    if (isTop) {
      var traceScriptUrl =
        chrome.extension.getURL('wtf_trace_web_js_compiled.js');
      injectScriptFunction(function(traceScriptUrl) {
        window.WTF_TRACE_SCRIPT_URL = traceScriptUrl;
      }, [traceScriptUrl]);
      injectScriptFile(traceScriptUrl);
    }
    injectScriptFunction(function(options) {
      // If we are nested in an iframe, protect against cross-origin errors.
      try {
        window.top.wtf.trace.prepare(options, window);
      } catch (e) {
      }
    }, [
      options
    ]);

    if (isTop) {
      // Inject addons, if required.
      var addons = injectAddons(options['wtf.addons'] || []);
      // Inject preparation code to start tracing with the desired options.
      injectScriptFunction(startTracing, [
        addons
      ]);
    }
  }

  if (isTop) {
    setupCommunications();
  }
}
810749
public function detectMainTemplate()
    {
        $name = (isset($this->mainxsl) && !empty($this->mainxsl)) ? $this->mainxsl : 'index';

        foreach ($this->getIncludePaths() as $path) {
            if (is_readable($path.DIRECTORY_SEPARATOR.$name.'.xsl')) {
                $this->xsl->includeXSL($path.DIRECTORY_SEPARATOR.$name.'.xsl', true);

                return $path.DIRECTORY_SEPARATOR.$name.'.xsl';
            }
        }
    }
389682
private void beginMainBlock() {
        int blockNo = registerBlock(null); // =0
        BlockTabRec btr = blockTab[blockNo];
        btr.tPosBegin = 0;
        btr.tPosContentsBegin = 0;
        openBlocksTab[currentNestingLevel] = blockNo;
        currentNestingLevel++;
    }
625563
async def index_page(self, request):
        
        context = {"initial_state": self.schema.to_json()}

        return render_template(
            self.template,
            request,
            context,
            app_key=TEMPLATE_APP_KEY,
        )
1125568
def initializePage(self):
        
        tree = self.uiStructureTREE
        tree.blockSignals(True)
        tree.setUpdatesEnabled(False)
        self.uiStructureTREE.clear()
        xstruct = self.scaffold().structure()
        
        self._structure = xstruct
        for xentry in xstruct:
            XScaffoldElementItem(tree, xentry)
        
        tree.blockSignals(False)
        tree.setUpdatesEnabled(True)
198335
public function indexFront()
    {
        $this->setTitleIndexFront();
        $this->setDataCollectionFront('page');
        $this->setDataCollectionFront('file');
        $this->setDataCollectionFront('product');

        $this->outputIndexFront();
    }
1364220
public function frontpage() {
        global $CFG, $SITE;

        $output = '';

        if (isloggedin() and !isguestuser() and isset($CFG->frontpageloggedin)) {
            $frontpagelayout = $CFG->frontpageloggedin;
        } else {
            $frontpagelayout = $CFG->frontpage;
        }

        foreach (explode(',', $frontpagelayout) as $v) {
            switch ($v) {
                // Display the main part of the front page.
                case FRONTPAGENEWS:
                    if ($SITE->newsitems) {
                        // Print forums only when needed.
                        require_once($CFG->dirroot .'/mod/forum/lib.php');
                        if (($newsforum = forum_get_course_forum($SITE->id, 'news')) &&
                                ($forumcontents = $this->frontpage_news($newsforum))) {
                            $newsforumcm = get_fast_modinfo($SITE)->instances['forum'][$newsforum->id];
                            $output .= $this->frontpage_part('skipsitenews', 'site-news-forum',
                                $newsforumcm->get_formatted_name(), $forumcontents);
                        }
                    }
                    break;

                case FRONTPAGEENROLLEDCOURSELIST:
                    $mycourseshtml = $this->frontpage_my_courses();
                    if (!empty($mycourseshtml)) {
                        $output .= $this->frontpage_part('skipmycourses', 'frontpage-course-list',
                            get_string('mycourses'), $mycourseshtml);
                    }
                    break;

                case FRONTPAGEALLCOURSELIST:
                    $availablecourseshtml = $this->frontpage_available_courses();
                    $output .= $this->frontpage_part('skipavailablecourses', 'frontpage-available-course-list',
                        get_string('availablecourses'), $availablecourseshtml);
                    break;

                case FRONTPAGECATEGORYNAMES:
                    $output .= $this->frontpage_part('skipcategories', 'frontpage-category-names',
                        get_string('categories'), $this->frontpage_categories_list());
                    break;

                case FRONTPAGECATEGORYCOMBO:
                    $output .= $this->frontpage_part('skipcourses', 'frontpage-category-combo',
                        get_string('courses'), $this->frontpage_combo_list());
                    break;

                case FRONTPAGECOURSESEARCH:
                    $output .= $this->box($this->course_search_form('', 'short'), 'mdl-align');
                    break;

            }
            $output .= '<br />';
        }

        return $output;
    }
1237272
public function index()
    {
        $this->defaultData();
        //redirect to the usual tao/Main/index
        if($this->hasRequestParameter('ext') || $this->hasRequestParameter('structure')){

            //but before update the first time property

            $user = $this->getServiceLocator()->get(\tao_models_classes_UserService::SERVICE_ID)->getCurrentUser();
            if($this->hasRequestParameter('nosplash')){
                TaoCe::becomeVeteran();
            }

            //@todo use forward on cross-extension forward is supported
            $this->redirect(_url('index', 'Main', 'tao', array(
                'ext' => $this->getRequestParameter('ext'),
                'structure' => $this->getRequestParameter('structure')
            )));

        } else {
            //render the index but with the taoCe URL used by client side routes
            parent::index();
        }
    }
225269
public function getMainTemplateFile()
    {
    	$main = $this->getPath() . '/main.ss';

    	if(file_exists($main)) {
    		return $main;
    	}

    	$main = (string) $this->getConfiguration()->main_template;
    	if($main) {
    		return SSViewer::getTemplateFileByType($main, 'main');
    	}

    	return false;
    }
505773
function () /*:Void*/ {

        //set the current page
        this._curPage = this._pages.shift();

        this.fire(this.TEST_PAGE_BEGIN_EVENT, this._curPage);

        //load the frame - destroy history in case there are other iframes that
        //need testing
        this._frame.location.replace(this._curPage);

    }
1022017
public static void main(String args[])
    {
        BaseApplet.main(args);
        AppointmentApplet applet = (AppointmentApplet)AppointmentApplet.getSharedInstance();
        if (applet == null)
            applet = new AppointmentApplet(args);
        new JBaseFrame("Test", applet);
    }
29671
public function main()
    {
        # The theme is activated.
        # Location: Resources/Themes/Default/
        Theme::active('Default');
        
        # The current settings are being configured.
        Masterpage::headPage('Sections/head')
                  ->bodyPage('Sections/body')
                  ->browserIcon(FILES_DIR . 'favicon.ico')
                  ->backgroundImage(FILES_DIR . 'background.jpg');
    }
1115226
def main():
    
    p = OptionParser(main.__doc__)
    p.add_option("-g", "--graphic", default=False, action="store_true",
            help="Create boilerplate for a graphic script")

    opts, args = p.parse_args()
    if len(args) != 1:
        sys.exit(not p.print_help())

    script, = args
    imports = graphic_imports if opts.graphic else default_imports
    app = graphic_app if opts.graphic else default_app
    template = default_template.format(imports, app)
    write_file(script, template)

    message = "template writes to `{0}`".format(script)
    if opts.graphic:
        message = "graphic " + message
    message = message[0].upper() + message[1:]
    logging.debug(message)