本文整理匯總了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);
示例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);