當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript jupyter-js-utils.getBaseUrl函數代碼示例

本文整理匯總了TypeScript中jupyter-js-utils.getBaseUrl函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getBaseUrl函數的具體用法?TypeScript getBaseUrl怎麽用?TypeScript getBaseUrl使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了getBaseUrl函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: getBaseUrl

import {
  SplitPanel
} from 'phosphor-splitpanel';

import {
  Widget
} from 'phosphor-widget';

import 'jupyter-js-notebook/lib/index.css';
import 'jupyter-js-notebook/lib/theme.css';
import 'jupyter-js-ui/lib/dialog/index.css';
import 'jupyter-js-ui/lib/dialog/theme.css';


let SERVER_URL = getBaseUrl();
let NOTEBOOK = 'test.ipynb';


function main(): void {
  // Initialize the keymap manager with the bindings.
  var keymap = new KeymapManager();

  // Setup the keydown listener for the document.
  document.addEventListener('keydown', event => {
    keymap.processKeydownEvent(event);
  });
  // TODO: check out static example from the history
  // and make that a separate example.

  let contents = new ContentsManager(SERVER_URL);
開發者ID:ellisonbg,項目名稱:jupyter-js-notebook,代碼行數:30,代碼來源:index.ts

示例2: Copyright

| Copyright (c) 2014-2015, Jupyter Development Team.
|
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
'use strict';

import {
  startNewSession
} from 'jupyter-js-services';

import {
  getBaseUrl, getWsUrl
} from 'jupyter-js-utils';


const BASE_URL = getBaseUrl();
const WS_URL = getWsUrl();


function main() {
  // Start a new session.
  let options = {
    baseUrl: BASE_URL,
    wsUrl: WS_URL,
    kernelName: 'python',
    path: 'foo.ipynb'
  };
  startNewSession(options).then(session => {
    // Rename the session.
    session.rename('bar.ipynb').then(() => {
      console.log('Session renamed to', session.path);
開發者ID:mahesh2013,項目名稱:jupyter-js-services,代碼行數:31,代碼來源:index.ts


注:本文中的jupyter-js-utils.getBaseUrl函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。